* [PATCH] [media] b2c2: use IS_REACHABLE() instead of open-coding it
@ 2016-11-24 16:25 Arnd Bergmann
0 siblings, 0 replies; only message in thread
From: Arnd Bergmann @ 2016-11-24 16:25 UTC (permalink / raw)
To: Mauro Carvalho Chehab; +Cc: Arnd Bergmann, linux-media, linux-kernel
The FE_SUPPORTED() macro is basically the same as IS_REACHABLE, except
that it causes a warning with gcc-7:
common/b2c2/flexcop-fe-tuner.c:30:1: error: this use of "defined" may not be portable [-Werror=expansion-to-defined]
common/b2c2/flexcop-fe-tuner.c:30:1: error: this use of "defined" may not be portable [-Werror=expansion-to-defined]
common/b2c2/flexcop-fe-tuner.c:30:1: error: this use of "defined" may not be portable [-Werror=expansion-to-defined]
Using IS_REACHABLE() to define it avoids the warning.
Fixes: 3785bc170f79 ("[media] b2c2: break it into common/pci/usb directories")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/media/common/b2c2/flexcop-fe-tuner.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/media/common/b2c2/flexcop-fe-tuner.c b/drivers/media/common/b2c2/flexcop-fe-tuner.c
index f5956402fc69..5f10151ecec9 100644
--- a/drivers/media/common/b2c2/flexcop-fe-tuner.c
+++ b/drivers/media/common/b2c2/flexcop-fe-tuner.c
@@ -24,8 +24,7 @@
/* Can we use the specified front-end? Remember that if we are compiled
* into the kernel we can't call code that's in modules. */
-#define FE_SUPPORTED(fe) (defined(CONFIG_DVB_##fe) || \
- (defined(CONFIG_DVB_##fe##_MODULE) && defined(MODULE)))
+#define FE_SUPPORTED(fe) IS_REACHABLE(CONFIG_DVB_ ## fe)
#if FE_SUPPORTED(BCM3510) || (FE_SUPPORTED(CX24120) && FE_SUPPORTED(ISL6421))
static int flexcop_fe_request_firmware(struct dvb_frontend *fe,
--
2.9.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-11-24 16:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-24 16:25 [PATCH] [media] b2c2: use IS_REACHABLE() instead of open-coding it Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®