diff mbox

media: dvbdev: fix building on ia64

Message ID 1980bfa67f19d628df30b9b5b76bca37c2a76dde.1520414065.git.mchehab@s-opensource.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mauro Carvalho Chehab March 7, 2018, 9:14 a.m. UTC
Not sure why, but, on ia64, with Linaro's gcc 7.3 compiler,
using #ifdef (CONFIG_I2C) is not OK.

So, replace it by IS_ENABLED(CONFIG_I2C), in order to fix the
builds there.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 drivers/media/dvb-core/dvbdev.c | 2 +-
 include/media/dvbdev.h          | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Fabio Estevam March 7, 2018, 9:47 a.m. UTC | #1
Hi Mauro,

On Wed, Mar 7, 2018 at 6:14 AM, Mauro Carvalho Chehab
<mchehab@s-opensource.com> wrote:
> Not sure why, but, on ia64, with Linaro's gcc 7.3 compiler,
> using #ifdef (CONFIG_I2C) is not OK.

Looking at the kbuild report the failure happens when CONFIG_I2C=m.

IS_ENABLED() macro takes care of both built-in and module as it will expand to:

#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)

and that's the reason why IS_ENABLE() fixes the build problem.

Regards,

Fabio Estevam
Mauro Carvalho Chehab March 7, 2018, 10:16 a.m. UTC | #2
Em Wed, 7 Mar 2018 06:47:14 -0300
Fabio Estevam <festevam@gmail.com> escreveu:

> Hi Mauro,
> 
> On Wed, Mar 7, 2018 at 6:14 AM, Mauro Carvalho Chehab
> <mchehab@s-opensource.com> wrote:
> > Not sure why, but, on ia64, with Linaro's gcc 7.3 compiler,
> > using #ifdef (CONFIG_I2C) is not OK.  
> 
> Looking at the kbuild report the failure happens when CONFIG_I2C=m.
> 
> IS_ENABLED() macro takes care of both built-in and module as it will expand to:
> 
> #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)

Ah, true! Yeah, I forgot that for tri-state vars, it should test for
_MODULE variant.

> 
> and that's the reason why IS_ENABLE() fixes the build problem.

Thanks for reminding me.

Regards,
Mauro
diff mbox

Patch

diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c
index a840133feacb..cf747d753a79 100644
--- a/drivers/media/dvb-core/dvbdev.c
+++ b/drivers/media/dvb-core/dvbdev.c
@@ -942,7 +942,7 @@  int dvb_usercopy(struct file *file,
 	return err;
 }
 
-#ifdef CONFIG_I2C
+#if IS_ENABLED(CONFIG_I2C)
 struct i2c_client *dvb_module_probe(const char *module_name,
 				    const char *name,
 				    struct i2c_adapter *adap,
diff --git a/include/media/dvbdev.h b/include/media/dvbdev.h
index 2d2897508590..ee91516ad074 100644
--- a/include/media/dvbdev.h
+++ b/include/media/dvbdev.h
@@ -358,7 +358,7 @@  long dvb_generic_ioctl(struct file *file,
 int dvb_usercopy(struct file *file, unsigned int cmd, unsigned long arg,
 		 int (*func)(struct file *file, unsigned int cmd, void *arg));
 
-#ifdef CONFIG_I2C
+#if IS_ENABLED(CONFIG_I2C)
 
 struct i2c_adapter;
 struct i2c_client;