All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1 linux-next] drm/nouveau: don't opencode IS_REACHABLE()
@ 2016-11-12  8:48 Fabian Frederick
  2016-11-14 10:56   ` Jani Nikula
  0 siblings, 1 reply; 3+ messages in thread
From: Fabian Frederick @ 2016-11-12  8:48 UTC (permalink / raw)
  To: Ben Skeggs; +Cc: dri-devel, linux-kernel, fabf

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 drivers/gpu/drm/nouveau/nouveau_hwmon.c       | 6 +++---
 drivers/gpu/drm/nouveau/nvkm/subdev/pci/agp.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_hwmon.c b/drivers/gpu/drm/nouveau/nouveau_hwmon.c
index 71f764b..ddfac0b 100644
--- a/drivers/gpu/drm/nouveau/nouveau_hwmon.c
+++ b/drivers/gpu/drm/nouveau/nouveau_hwmon.c
@@ -37,7 +37,7 @@
 #include <nvkm/subdev/iccsense.h>
 #include <nvkm/subdev/volt.h>
 
-#if defined(CONFIG_HWMON) || (defined(MODULE) && defined(CONFIG_HWMON_MODULE))
+#if IS_REACHABLE(CONFIG_HWMON)
 static ssize_t
 nouveau_hwmon_show_temp(struct device *d, struct device_attribute *a, char *buf)
 {
@@ -662,7 +662,7 @@ static const struct attribute_group hwmon_power_attrgroup = {
 int
 nouveau_hwmon_init(struct drm_device *dev)
 {
-#if defined(CONFIG_HWMON) || (defined(MODULE) && defined(CONFIG_HWMON_MODULE))
+#if IS_REACHABLE(CONFIG_HWMON)
 	struct nouveau_drm *drm = nouveau_drm(dev);
 	struct nvkm_therm *therm = nvxx_therm(&drm->device);
 	struct nvkm_volt *volt = nvxx_volt(&drm->device);
@@ -749,7 +749,7 @@ nouveau_hwmon_init(struct drm_device *dev)
 void
 nouveau_hwmon_fini(struct drm_device *dev)
 {
-#if defined(CONFIG_HWMON) || (defined(MODULE) && defined(CONFIG_HWMON_MODULE))
+#if IS_REACHABLE(CONFIG_HWMON)
 	struct nouveau_hwmon *hwmon = nouveau_hwmon(dev);
 
 	if (hwmon->hwmon) {
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/agp.h b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/agp.h
index df2dd08..8de914c 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/agp.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/agp.h
@@ -1,5 +1,5 @@
 #include "priv.h"
-#if defined(CONFIG_AGP) || (defined(CONFIG_AGP_MODULE) && defined(MODULE))
+#if IS_REACHABLE(CONFIG_AGP)
 #ifndef __NVKM_PCI_AGP_H__
 #define __NVKM_PCI_AGP_H__
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1 linux-next] drm/nouveau: don't opencode IS_REACHABLE()
  2016-11-12  8:48 [PATCH 1/1 linux-next] drm/nouveau: don't opencode IS_REACHABLE() Fabian Frederick
@ 2016-11-14 10:56   ` Jani Nikula
  0 siblings, 0 replies; 3+ messages in thread
From: Jani Nikula @ 2016-11-14 10:56 UTC (permalink / raw)
  To: Fabian Frederick, Ben Skeggs; +Cc: fabf, linux-kernel, dri-devel

On Sat, 12 Nov 2016, Fabian Frederick <fabf@skynet.be> wrote:
> -#if defined(CONFIG_HWMON) || (defined(MODULE) && defined(CONFIG_HWMON_MODULE))
> +#if IS_REACHABLE(CONFIG_HWMON)

The changes seem to make sense per se, but I'd be interested in hearing
the rationale for not expressing this dependency in terms of Kconfig to
begin with. With this, it's hidden in code, and the hwmon stuff gets
used if the conditions for "nouveau depends on hwmon" are met, by
chance, but it's not enforced.

BR,
Jani.


-- 
Jani Nikula, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1 linux-next] drm/nouveau: don't opencode IS_REACHABLE()
@ 2016-11-14 10:56   ` Jani Nikula
  0 siblings, 0 replies; 3+ messages in thread
From: Jani Nikula @ 2016-11-14 10:56 UTC (permalink / raw)
  To: Ben Skeggs; +Cc: fabf, linux-kernel, dri-devel

On Sat, 12 Nov 2016, Fabian Frederick <fabf@skynet.be> wrote:
> -#if defined(CONFIG_HWMON) || (defined(MODULE) && defined(CONFIG_HWMON_MODULE))
> +#if IS_REACHABLE(CONFIG_HWMON)

The changes seem to make sense per se, but I'd be interested in hearing
the rationale for not expressing this dependency in terms of Kconfig to
begin with. With this, it's hidden in code, and the hwmon stuff gets
used if the conditions for "nouveau depends on hwmon" are met, by
chance, but it's not enforced.

BR,
Jani.


-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-14 10:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-12  8:48 [PATCH 1/1 linux-next] drm/nouveau: don't opencode IS_REACHABLE() Fabian Frederick
2016-11-14 10:56 ` Jani Nikula
2016-11-14 10:56   ` Jani Nikula

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.