linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: i801: use IS_ENABLED() instead of checking for built-in or module
@ 2016-07-21 16:11 Javier Martinez Canillas
  2016-07-22 10:00 ` Jean Delvare
  2016-07-26  6:49 ` Wolfram Sang
  0 siblings, 2 replies; 3+ messages in thread
From: Javier Martinez Canillas @ 2016-07-21 16:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: Javier Martinez Canillas, Jean Delvare, Wolfram Sang, linux-i2c

The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
built-in or as a module, use that macro instead of open coding the same.

Using the macro makes the code more readable by helping abstract away some
of the Kconfig built-in and module enable details.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
---

 drivers/i2c/busses/i2c-i801.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index 68cec6128ac0..5ef9b733d153 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -98,8 +98,7 @@
 #include <linux/platform_data/itco_wdt.h>
 #include <linux/pm_runtime.h>
 
-#if (defined CONFIG_I2C_MUX_GPIO || defined CONFIG_I2C_MUX_GPIO_MODULE) && \
-		defined CONFIG_DMI
+#if IS_ENABLED(CONFIG_I2C_MUX_GPIO) && defined CONFIG_DMI
 #include <linux/gpio.h>
 #include <linux/i2c-mux-gpio.h>
 #endif
@@ -255,8 +254,7 @@ struct i801_priv {
 	int len;
 	u8 *data;
 
-#if (defined CONFIG_I2C_MUX_GPIO || defined CONFIG_I2C_MUX_GPIO_MODULE) && \
-		defined CONFIG_DMI
+#if IS_ENABLED(CONFIG_I2C_MUX_GPIO) && defined CONFIG_DMI
 	const struct i801_mux_config *mux_drvdata;
 	struct platform_device *mux_pdev;
 #endif
@@ -1133,8 +1131,7 @@ static void __init input_apanel_init(void) {}
 static void i801_probe_optional_slaves(struct i801_priv *priv) {}
 #endif	/* CONFIG_X86 && CONFIG_DMI */
 
-#if (defined CONFIG_I2C_MUX_GPIO || defined CONFIG_I2C_MUX_GPIO_MODULE) && \
-		defined CONFIG_DMI
+#if IS_ENABLED(CONFIG_I2C_MUX_GPIO) && defined CONFIG_DMI
 static struct i801_mux_config i801_mux_config_asus_z8_d12 = {
 	.gpio_chip = "gpio_ich",
 	.values = { 0x02, 0x03 },
-- 
2.5.5

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

* Re: [PATCH] i2c: i801: use IS_ENABLED() instead of checking for built-in or module
  2016-07-21 16:11 [PATCH] i2c: i801: use IS_ENABLED() instead of checking for built-in or module Javier Martinez Canillas
@ 2016-07-22 10:00 ` Jean Delvare
  2016-07-26  6:49 ` Wolfram Sang
  1 sibling, 0 replies; 3+ messages in thread
From: Jean Delvare @ 2016-07-22 10:00 UTC (permalink / raw)
  To: Javier Martinez Canillas; +Cc: linux-kernel, Wolfram Sang, linux-i2c

On Thu, 21 Jul 2016 12:11:01 -0400, Javier Martinez Canillas wrote:
> The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
> built-in or as a module, use that macro instead of open coding the same.
> 
> Using the macro makes the code more readable by helping abstract away some
> of the Kconfig built-in and module enable details.
> 
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
> ---
> 
>  drivers/i2c/busses/i2c-i801.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
> index 68cec6128ac0..5ef9b733d153 100644
> --- a/drivers/i2c/busses/i2c-i801.c
> +++ b/drivers/i2c/busses/i2c-i801.c
> @@ -98,8 +98,7 @@
>  #include <linux/platform_data/itco_wdt.h>
>  #include <linux/pm_runtime.h>
>  
> -#if (defined CONFIG_I2C_MUX_GPIO || defined CONFIG_I2C_MUX_GPIO_MODULE) && \
> -		defined CONFIG_DMI
> +#if IS_ENABLED(CONFIG_I2C_MUX_GPIO) && defined CONFIG_DMI
>  #include <linux/gpio.h>
>  #include <linux/i2c-mux-gpio.h>
>  #endif
> @@ -255,8 +254,7 @@ struct i801_priv {
>  	int len;
>  	u8 *data;
>  
> -#if (defined CONFIG_I2C_MUX_GPIO || defined CONFIG_I2C_MUX_GPIO_MODULE) && \
> -		defined CONFIG_DMI
> +#if IS_ENABLED(CONFIG_I2C_MUX_GPIO) && defined CONFIG_DMI
>  	const struct i801_mux_config *mux_drvdata;
>  	struct platform_device *mux_pdev;
>  #endif
> @@ -1133,8 +1131,7 @@ static void __init input_apanel_init(void) {}
>  static void i801_probe_optional_slaves(struct i801_priv *priv) {}
>  #endif	/* CONFIG_X86 && CONFIG_DMI */
>  
> -#if (defined CONFIG_I2C_MUX_GPIO || defined CONFIG_I2C_MUX_GPIO_MODULE) && \
> -		defined CONFIG_DMI
> +#if IS_ENABLED(CONFIG_I2C_MUX_GPIO) && defined CONFIG_DMI
>  static struct i801_mux_config i801_mux_config_asus_z8_d12 = {
>  	.gpio_chip = "gpio_ich",
>  	.values = { 0x02, 0x03 },

Reviewed-by: Jean Delvare <jdelvare@suse.de>

-- 
Jean Delvare
SUSE L3 Support

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

* Re: [PATCH] i2c: i801: use IS_ENABLED() instead of checking for built-in or module
  2016-07-21 16:11 [PATCH] i2c: i801: use IS_ENABLED() instead of checking for built-in or module Javier Martinez Canillas
  2016-07-22 10:00 ` Jean Delvare
@ 2016-07-26  6:49 ` Wolfram Sang
  1 sibling, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2016-07-26  6:49 UTC (permalink / raw)
  To: Javier Martinez Canillas; +Cc: linux-kernel, Jean Delvare, linux-i2c

[-- Attachment #1: Type: text/plain, Size: 470 bytes --]

On Thu, Jul 21, 2016 at 12:11:01PM -0400, Javier Martinez Canillas wrote:
> The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
> built-in or as a module, use that macro instead of open coding the same.
> 
> Using the macro makes the code more readable by helping abstract away some
> of the Kconfig built-in and module enable details.
> 
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>

Applied to for-next, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2016-07-26  6:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-21 16:11 [PATCH] i2c: i801: use IS_ENABLED() instead of checking for built-in or module Javier Martinez Canillas
2016-07-22 10:00 ` Jean Delvare
2016-07-26  6:49 ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).