* [PATCH 01/15] 3c59x: use IS_ENABLED() instead of checking for built-in or module
2016-09-12 14:03 [PATCH 00/15] drivers: net: use IS_ENABLED() instead of checking for built-in or module Javier Martinez Canillas
@ 2016-09-12 14:03 ` Javier Martinez Canillas
2016-09-12 14:03 ` [PATCH 02/15] starfire: " Javier Martinez Canillas
` (14 subsequent siblings)
15 siblings, 0 replies; 23+ messages in thread
From: Javier Martinez Canillas @ 2016-09-12 14:03 UTC (permalink / raw)
To: linux-kernel; +Cc: Javier Martinez Canillas, netdev, Steffen Klassert
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/net/ethernet/3com/3c59x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/3com/3c59x.c b/drivers/net/ethernet/3com/3c59x.c
index 25c55ab05c7d..9133e7926da5 100644
--- a/drivers/net/ethernet/3com/3c59x.c
+++ b/drivers/net/ethernet/3com/3c59x.c
@@ -3089,7 +3089,7 @@ static void set_rx_mode(struct net_device *dev)
iowrite16(new_mode, ioaddr + EL3_CMD);
}
-#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
+#if IS_ENABLED(CONFIG_VLAN_8021Q)
/* Setup the card so that it can receive frames with an 802.1q VLAN tag.
Note that this must be done after each RxReset due to some backwards
compatibility logic in the Cyclone and Tornado ASICs */
--
2.7.4
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH 02/15] starfire: use IS_ENABLED() instead of checking for built-in or module
2016-09-12 14:03 [PATCH 00/15] drivers: net: use IS_ENABLED() instead of checking for built-in or module Javier Martinez Canillas
2016-09-12 14:03 ` [PATCH 01/15] 3c59x: " Javier Martinez Canillas
@ 2016-09-12 14:03 ` Javier Martinez Canillas
2016-09-12 14:03 ` [PATCH 03/15] ethernet: amd: " Javier Martinez Canillas
` (13 subsequent siblings)
15 siblings, 0 replies; 23+ messages in thread
From: Javier Martinez Canillas @ 2016-09-12 14:03 UTC (permalink / raw)
To: linux-kernel
Cc: Javier Martinez Canillas, netdev, Ion Badulescu, David S. Miller,
Florian Westphal, Antonio Quartulli, Mugunthan V N
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/net/ethernet/adaptec/starfire.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/adaptec/starfire.c b/drivers/net/ethernet/adaptec/starfire.c
index 1d1069641d81..8af2c88d5b33 100644
--- a/drivers/net/ethernet/adaptec/starfire.c
+++ b/drivers/net/ethernet/adaptec/starfire.c
@@ -66,7 +66,7 @@
*/
#define ZEROCOPY
-#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
+#if IS_ENABLED(CONFIG_VLAN_8021Q)
#define VLAN_SUPPORT
#endif
--
2.7.4
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH 03/15] ethernet: amd: use IS_ENABLED() instead of checking for built-in or module
2016-09-12 14:03 [PATCH 00/15] drivers: net: use IS_ENABLED() instead of checking for built-in or module Javier Martinez Canillas
2016-09-12 14:03 ` [PATCH 01/15] 3c59x: " Javier Martinez Canillas
2016-09-12 14:03 ` [PATCH 02/15] starfire: " Javier Martinez Canillas
@ 2016-09-12 14:03 ` Javier Martinez Canillas
2016-09-12 14:11 ` Geert Uytterhoeven
2016-09-12 14:03 ` [PATCH 04/15] bnx2: " Javier Martinez Canillas
` (12 subsequent siblings)
15 siblings, 1 reply; 23+ messages in thread
From: Javier Martinez Canillas @ 2016-09-12 14:03 UTC (permalink / raw)
To: linux-kernel
Cc: Javier Martinez Canillas, netdev, David S. Miller,
Florian Westphal, Antonio Quartulli, Geert Uytterhoeven,
Mugunthan V N
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/net/ethernet/amd/7990.c | 6 +++---
drivers/net/ethernet/amd/amd8111e.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/amd/7990.c b/drivers/net/ethernet/amd/7990.c
index dcf2a1f3643d..dc57f2759f44 100644
--- a/drivers/net/ethernet/amd/7990.c
+++ b/drivers/net/ethernet/amd/7990.c
@@ -45,14 +45,14 @@
#define WRITERDP(lp, x) out_be16(lp->base + LANCE_RDP, (x))
#define READRDP(lp) in_be16(lp->base + LANCE_RDP)
-#if defined(CONFIG_HPLANCE) || defined(CONFIG_HPLANCE_MODULE)
+#if IS_ENABLED(CONFIG_HPLANCE)
#include "hplance.h"
#undef WRITERAP
#undef WRITERDP
#undef READRDP
-#if defined(CONFIG_MVME147_NET) || defined(CONFIG_MVME147_NET_MODULE)
+#if IS_ENABLED(CONFIG_MVME147_NET)
/* Lossage Factor Nine, Mr Sulu. */
#define WRITERAP(lp, x) (lp->writerap(lp, x))
@@ -86,7 +86,7 @@ static inline __u16 READRDP(struct lance_private *lp)
}
#endif
-#endif /* CONFIG_HPLANCE || CONFIG_HPLANCE_MODULE */
+#endif /* IS_ENABLED(CONFIG_HPLANCE) */
/* debugging output macros, various flavours */
/* #define TEST_HITS */
diff --git a/drivers/net/ethernet/amd/amd8111e.c b/drivers/net/ethernet/amd/amd8111e.c
index 94960055fa1f..f92cc97151ec 100644
--- a/drivers/net/ethernet/amd/amd8111e.c
+++ b/drivers/net/ethernet/amd/amd8111e.c
@@ -89,7 +89,7 @@ Revision History:
#include <asm/byteorder.h>
#include <asm/uaccess.h>
-#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
+#if IS_ENABLED(CONFIG_VLAN_8021Q)
#define AMD8111E_VLAN_TAG_USED 1
#else
#define AMD8111E_VLAN_TAG_USED 0
--
2.7.4
^ permalink raw reply related [flat|nested] 23+ messages in thread
* Re: [PATCH 03/15] ethernet: amd: use IS_ENABLED() instead of checking for built-in or module
2016-09-12 14:03 ` [PATCH 03/15] ethernet: amd: " Javier Martinez Canillas
@ 2016-09-12 14:11 ` Geert Uytterhoeven
0 siblings, 0 replies; 23+ messages in thread
From: Geert Uytterhoeven @ 2016-09-12 14:11 UTC (permalink / raw)
To: Javier Martinez Canillas
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
David S. Miller, Florian Westphal, Antonio Quartulli,
Mugunthan V N
On Mon, Sep 12, 2016 at 4:03 PM, Javier Martinez Canillas
<javier@osg.samsung.com> 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>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 04/15] bnx2: use IS_ENABLED() instead of checking for built-in or module
2016-09-12 14:03 [PATCH 00/15] drivers: net: use IS_ENABLED() instead of checking for built-in or module Javier Martinez Canillas
` (2 preceding siblings ...)
2016-09-12 14:03 ` [PATCH 03/15] ethernet: amd: " Javier Martinez Canillas
@ 2016-09-12 14:03 ` Javier Martinez Canillas
2016-09-12 14:03 ` [PATCH 05/15] sundance: " Javier Martinez Canillas
` (11 subsequent siblings)
15 siblings, 0 replies; 23+ messages in thread
From: Javier Martinez Canillas @ 2016-09-12 14:03 UTC (permalink / raw)
To: linux-kernel
Cc: Javier Martinez Canillas, Dept-HSGLinuxNICDev, Sony Chacko,
netdev
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/net/ethernet/broadcom/bnx2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2.c b/drivers/net/ethernet/broadcom/bnx2.c
index 8fc3f3c137f8..ecd357dbb1d4 100644
--- a/drivers/net/ethernet/broadcom/bnx2.c
+++ b/drivers/net/ethernet/broadcom/bnx2.c
@@ -50,7 +50,7 @@
#include <linux/log2.h>
#include <linux/aer.h>
-#if defined(CONFIG_CNIC) || defined(CONFIG_CNIC_MODULE)
+#if IS_ENABLED(CONFIG_CNIC)
#define BCM_CNIC 1
#include "cnic_if.h"
#endif
--
2.7.4
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH 05/15] sundance: use IS_ENABLED() instead of checking for built-in or module
2016-09-12 14:03 [PATCH 00/15] drivers: net: use IS_ENABLED() instead of checking for built-in or module Javier Martinez Canillas
` (3 preceding siblings ...)
2016-09-12 14:03 ` [PATCH 04/15] bnx2: " Javier Martinez Canillas
@ 2016-09-12 14:03 ` Javier Martinez Canillas
2016-09-12 14:03 ` [PATCH 06/15] net/fsl_pq_mdio: " Javier Martinez Canillas
` (10 subsequent siblings)
15 siblings, 0 replies; 23+ messages in thread
From: Javier Martinez Canillas @ 2016-09-12 14:03 UTC (permalink / raw)
To: linux-kernel; +Cc: Javier Martinez Canillas, Denis Kirjanov, netdev
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/net/ethernet/dlink/sundance.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/dlink/sundance.c b/drivers/net/ethernet/dlink/sundance.c
index 58c6338a839e..79d80090eac8 100644
--- a/drivers/net/ethernet/dlink/sundance.c
+++ b/drivers/net/ethernet/dlink/sundance.c
@@ -867,7 +867,7 @@ static int netdev_open(struct net_device *dev)
/* Initialize other registers. */
__set_mac_addr(dev);
-#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
+#if IS_ENABLED(CONFIG_VLAN_8021Q)
iowrite16(dev->mtu + 18, ioaddr + MaxFrameSize);
#else
iowrite16(dev->mtu + 14, ioaddr + MaxFrameSize);
--
2.7.4
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH 06/15] net/fsl_pq_mdio: use IS_ENABLED() instead of checking for built-in or module
2016-09-12 14:03 [PATCH 00/15] drivers: net: use IS_ENABLED() instead of checking for built-in or module Javier Martinez Canillas
` (4 preceding siblings ...)
2016-09-12 14:03 ` [PATCH 05/15] sundance: " Javier Martinez Canillas
@ 2016-09-12 14:03 ` Javier Martinez Canillas
2016-09-12 14:03 ` [PATCH 07/15] i825xx: " Javier Martinez Canillas
` (9 subsequent siblings)
15 siblings, 0 replies; 23+ messages in thread
From: Javier Martinez Canillas @ 2016-09-12 14:03 UTC (permalink / raw)
To: linux-kernel
Cc: Javier Martinez Canillas, Zhao Qiang, Arnd Bergmann, netdev,
Gerlando Falauto, David S. Miller, Florian Fainelli, Andrew Lunn
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/net/ethernet/freescale/fsl_pq_mdio.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fsl_pq_mdio.c b/drivers/net/ethernet/freescale/fsl_pq_mdio.c
index f3c63dce1e30..446c7b374ff5 100644
--- a/drivers/net/ethernet/freescale/fsl_pq_mdio.c
+++ b/drivers/net/ethernet/freescale/fsl_pq_mdio.c
@@ -195,7 +195,7 @@ static int fsl_pq_mdio_reset(struct mii_bus *bus)
return 0;
}
-#if defined(CONFIG_GIANFAR) || defined(CONFIG_GIANFAR_MODULE)
+#if IS_ENABLED(CONFIG_GIANFAR)
/*
* Return the TBIPA address, starting from the address
* of the mapped GFAR MDIO registers (struct gfar)
@@ -228,7 +228,7 @@ static uint32_t __iomem *get_etsec_tbipa(void __iomem *p)
}
#endif
-#if defined(CONFIG_UCC_GETH) || defined(CONFIG_UCC_GETH_MODULE)
+#if IS_ENABLED(CONFIG_UCC_GETH)
/*
* Return the TBIPAR address for a QE MDIO node, starting from the address
* of the mapped MII registers (struct fsl_pq_mii)
@@ -306,7 +306,7 @@ static void ucc_configure(phys_addr_t start, phys_addr_t end)
#endif
static const struct of_device_id fsl_pq_mdio_match[] = {
-#if defined(CONFIG_GIANFAR) || defined(CONFIG_GIANFAR_MODULE)
+#if IS_ENABLED(CONFIG_GIANFAR)
{
.compatible = "fsl,gianfar-tbi",
.data = &(struct fsl_pq_mdio_data) {
@@ -344,7 +344,7 @@ static const struct of_device_id fsl_pq_mdio_match[] = {
},
},
#endif
-#if defined(CONFIG_UCC_GETH) || defined(CONFIG_UCC_GETH_MODULE)
+#if IS_ENABLED(CONFIG_UCC_GETH)
{
.compatible = "fsl,ucc-mdio",
.data = &(struct fsl_pq_mdio_data) {
--
2.7.4
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH 07/15] i825xx: use IS_ENABLED() instead of checking for built-in or module
2016-09-12 14:03 [PATCH 00/15] drivers: net: use IS_ENABLED() instead of checking for built-in or module Javier Martinez Canillas
` (5 preceding siblings ...)
2016-09-12 14:03 ` [PATCH 06/15] net/fsl_pq_mdio: " Javier Martinez Canillas
@ 2016-09-12 14:03 ` Javier Martinez Canillas
2016-09-12 14:03 ` [PATCH 08/15] ixgbe: " Javier Martinez Canillas
` (8 subsequent siblings)
15 siblings, 0 replies; 23+ messages in thread
From: Javier Martinez Canillas @ 2016-09-12 14:03 UTC (permalink / raw)
To: linux-kernel
Cc: Javier Martinez Canillas, Felipe Balbi, netdev, David S. Miller,
Florian Westphal, Antonio Quartulli, Mugunthan V N
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/net/ethernet/i825xx/82596.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/i825xx/82596.c b/drivers/net/ethernet/i825xx/82596.c
index befb4ac3e2b0..ce235b776793 100644
--- a/drivers/net/ethernet/i825xx/82596.c
+++ b/drivers/net/ethernet/i825xx/82596.c
@@ -89,10 +89,10 @@ static char version[] __initdata =
#define DEB(x,y) if (i596_debug & (x)) y
-#if defined(CONFIG_MVME16x_NET) || defined(CONFIG_MVME16x_NET_MODULE)
+#if IS_ENABLED(CONFIG_MVME16x_NET)
#define ENABLE_MVME16x_NET
#endif
-#if defined(CONFIG_BVME6000_NET) || defined(CONFIG_BVME6000_NET_MODULE)
+#if IS_ENABLED(CONFIG_BVME6000_NET)
#define ENABLE_BVME6000_NET
#endif
--
2.7.4
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH 08/15] ixgbe: use IS_ENABLED() instead of checking for built-in or module
2016-09-12 14:03 [PATCH 00/15] drivers: net: use IS_ENABLED() instead of checking for built-in or module Javier Martinez Canillas
` (6 preceding siblings ...)
2016-09-12 14:03 ` [PATCH 07/15] i825xx: " Javier Martinez Canillas
@ 2016-09-12 14:03 ` Javier Martinez Canillas
2016-09-12 15:36 ` Greg
2016-09-12 14:03 ` [PATCH 09/15] net: mvneta: " Javier Martinez Canillas
` (7 subsequent siblings)
15 siblings, 1 reply; 23+ messages in thread
From: Javier Martinez Canillas @ 2016-09-12 14:03 UTC (permalink / raw)
To: linux-kernel
Cc: Javier Martinez Canillas, netdev, intel-wired-lan, Jeff Kirsher
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/net/ethernet/intel/ixgbe/ixgbe.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
index 33c025055011..b06e32d0d22a 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
@@ -45,10 +45,10 @@
#include "ixgbe_type.h"
#include "ixgbe_common.h"
#include "ixgbe_dcb.h"
-#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
+#if IS_ENABLED(CONFIG_FCOE)
#define IXGBE_FCOE
#include "ixgbe_fcoe.h"
-#endif /* CONFIG_FCOE or CONFIG_FCOE_MODULE */
+#endif /* IS_ENABLED(CONFIG_FCOE) */
#ifdef CONFIG_IXGBE_DCA
#include <linux/dca.h>
#endif
--
2.7.4
^ permalink raw reply related [flat|nested] 23+ messages in thread
* Re: [PATCH 08/15] ixgbe: use IS_ENABLED() instead of checking for built-in or module
2016-09-12 14:03 ` [PATCH 08/15] ixgbe: " Javier Martinez Canillas
@ 2016-09-12 15:36 ` Greg
0 siblings, 0 replies; 23+ messages in thread
From: Greg @ 2016-09-12 15:36 UTC (permalink / raw)
To: Javier Martinez Canillas
Cc: linux-kernel, netdev, intel-wired-lan, Jeff Kirsher
On Mon, 2016-09-12 at 10:03 -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/net/ethernet/intel/ixgbe/ixgbe.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
> index 33c025055011..b06e32d0d22a 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
> @@ -45,10 +45,10 @@
> #include "ixgbe_type.h"
> #include "ixgbe_common.h"
> #include "ixgbe_dcb.h"
> -#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
> +#if IS_ENABLED(CONFIG_FCOE)
I was wondering what happens if CONFIG_FCOE_MODULE is defined but not
CONFIG_FCOE but then couldn't even find CONFIG_FCOE_MODULE in any
Kconfigs anywhere in the current tree.
Looks good to me.
* Reviewed-by: Greg Rose <grose@lightfleet.com>
> #define IXGBE_FCOE
> #include "ixgbe_fcoe.h"
> -#endif /* CONFIG_FCOE or CONFIG_FCOE_MODULE */
> +#endif /* IS_ENABLED(CONFIG_FCOE) */
> #ifdef CONFIG_IXGBE_DCA
> #include <linux/dca.h>
> #endif
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 09/15] net: mvneta: use IS_ENABLED() instead of checking for built-in or module
2016-09-12 14:03 [PATCH 00/15] drivers: net: use IS_ENABLED() instead of checking for built-in or module Javier Martinez Canillas
` (7 preceding siblings ...)
2016-09-12 14:03 ` [PATCH 08/15] ixgbe: " Javier Martinez Canillas
@ 2016-09-12 14:03 ` Javier Martinez Canillas
2016-09-12 14:06 ` Gregory CLEMENT
2016-09-12 14:03 ` [PATCH 10/15] natsemi: " Javier Martinez Canillas
` (6 subsequent siblings)
15 siblings, 1 reply; 23+ messages in thread
From: Javier Martinez Canillas @ 2016-09-12 14:03 UTC (permalink / raw)
To: linux-kernel
Cc: Javier Martinez Canillas, Gregory CLEMENT, netdev, Marcin Wojtas,
David S. Miller
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/net/ethernet/marvell/mvneta_bm.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/marvell/mvneta_bm.h b/drivers/net/ethernet/marvell/mvneta_bm.h
index e74fd44a92f7..a32de432800c 100644
--- a/drivers/net/ethernet/marvell/mvneta_bm.h
+++ b/drivers/net/ethernet/marvell/mvneta_bm.h
@@ -133,7 +133,7 @@ struct mvneta_bm_pool {
void *mvneta_frag_alloc(unsigned int frag_size);
void mvneta_frag_free(unsigned int frag_size, void *data);
-#if defined(CONFIG_MVNETA_BM) || defined(CONFIG_MVNETA_BM_MODULE)
+#if IS_ENABLED(CONFIG_MVNETA_BM)
void mvneta_bm_pool_destroy(struct mvneta_bm *priv,
struct mvneta_bm_pool *bm_pool, u8 port_map);
void mvneta_bm_bufs_free(struct mvneta_bm *priv, struct mvneta_bm_pool *bm_pool,
--
2.7.4
^ permalink raw reply related [flat|nested] 23+ messages in thread
* Re: [PATCH 09/15] net: mvneta: use IS_ENABLED() instead of checking for built-in or module
2016-09-12 14:03 ` [PATCH 09/15] net: mvneta: " Javier Martinez Canillas
@ 2016-09-12 14:06 ` Gregory CLEMENT
0 siblings, 0 replies; 23+ messages in thread
From: Gregory CLEMENT @ 2016-09-12 14:06 UTC (permalink / raw)
To: Javier Martinez Canillas
Cc: linux-kernel, netdev, Marcin Wojtas, David S. Miller
Hi Javier,
On lun., sept. 12 2016, Javier Martinez Canillas <javier@osg.samsung.com> 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>
Acked-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Thanks,
Gregory
> ---
>
> drivers/net/ethernet/marvell/mvneta_bm.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/marvell/mvneta_bm.h b/drivers/net/ethernet/marvell/mvneta_bm.h
> index e74fd44a92f7..a32de432800c 100644
> --- a/drivers/net/ethernet/marvell/mvneta_bm.h
> +++ b/drivers/net/ethernet/marvell/mvneta_bm.h
> @@ -133,7 +133,7 @@ struct mvneta_bm_pool {
> void *mvneta_frag_alloc(unsigned int frag_size);
> void mvneta_frag_free(unsigned int frag_size, void *data);
>
> -#if defined(CONFIG_MVNETA_BM) || defined(CONFIG_MVNETA_BM_MODULE)
> +#if IS_ENABLED(CONFIG_MVNETA_BM)
> void mvneta_bm_pool_destroy(struct mvneta_bm *priv,
> struct mvneta_bm_pool *bm_pool, u8 port_map);
> void mvneta_bm_bufs_free(struct mvneta_bm *priv, struct mvneta_bm_pool *bm_pool,
> --
> 2.7.4
>
--
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 10/15] natsemi: use IS_ENABLED() instead of checking for built-in or module
2016-09-12 14:03 [PATCH 00/15] drivers: net: use IS_ENABLED() instead of checking for built-in or module Javier Martinez Canillas
` (8 preceding siblings ...)
2016-09-12 14:03 ` [PATCH 09/15] net: mvneta: " Javier Martinez Canillas
@ 2016-09-12 14:03 ` Javier Martinez Canillas
2016-09-12 14:03 ` [PATCH 11/15] sfc: " Javier Martinez Canillas
` (5 subsequent siblings)
15 siblings, 0 replies; 23+ messages in thread
From: Javier Martinez Canillas @ 2016-09-12 14:03 UTC (permalink / raw)
To: linux-kernel; +Cc: Javier Martinez Canillas, netdev
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/net/ethernet/natsemi/ns83820.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/natsemi/ns83820.c b/drivers/net/ethernet/natsemi/ns83820.c
index eb807b0dc72a..569ade6cf85c 100644
--- a/drivers/net/ethernet/natsemi/ns83820.c
+++ b/drivers/net/ethernet/natsemi/ns83820.c
@@ -134,7 +134,7 @@ static int lnksts = 0; /* CFG_LNKSTS bit polarity */
/* tunables */
#define RX_BUF_SIZE 1500 /* 8192 */
-#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
+#if IS_ENABLED(CONFIG_VLAN_8021Q)
#define NS83820_VLAN_ACCEL_SUPPORT
#endif
--
2.7.4
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH 11/15] sfc: use IS_ENABLED() instead of checking for built-in or module
2016-09-12 14:03 [PATCH 00/15] drivers: net: use IS_ENABLED() instead of checking for built-in or module Javier Martinez Canillas
` (9 preceding siblings ...)
2016-09-12 14:03 ` [PATCH 10/15] natsemi: " Javier Martinez Canillas
@ 2016-09-12 14:03 ` Javier Martinez Canillas
2016-09-12 14:31 ` Bert Kenward
2016-09-12 14:03 ` [PATCH 12/15] sis900: " Javier Martinez Canillas
` (4 subsequent siblings)
15 siblings, 1 reply; 23+ messages in thread
From: Javier Martinez Canillas @ 2016-09-12 14:03 UTC (permalink / raw)
To: linux-kernel
Cc: Javier Martinez Canillas, netdev, Edward Cree, Bert Kenward,
Solarflare linux maintainers
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/net/ethernet/sfc/falcon_boards.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/sfc/falcon_boards.c b/drivers/net/ethernet/sfc/falcon_boards.c
index 1736f4b806af..f6883b2b5da3 100644
--- a/drivers/net/ethernet/sfc/falcon_boards.c
+++ b/drivers/net/ethernet/sfc/falcon_boards.c
@@ -64,7 +64,7 @@
#define LM87_ALARM_TEMP_INT 0x10
#define LM87_ALARM_TEMP_EXT1 0x20
-#if defined(CONFIG_SENSORS_LM87) || defined(CONFIG_SENSORS_LM87_MODULE)
+#if IS_ENABLED(CONFIG_SENSORS_LM87)
static int efx_poke_lm87(struct i2c_client *client, const u8 *reg_values)
{
@@ -455,7 +455,7 @@ static int sfe4001_init(struct efx_nic *efx)
struct falcon_board *board = falcon_board(efx);
int rc;
-#if defined(CONFIG_SENSORS_LM90) || defined(CONFIG_SENSORS_LM90_MODULE)
+#if IS_ENABLED(CONFIG_SENSORS_LM90)
board->hwmon_client =
i2c_new_device(&board->i2c_adap, &sfe4001_hwmon_info);
#else
--
2.7.4
^ permalink raw reply related [flat|nested] 23+ messages in thread
* Re: [PATCH 11/15] sfc: use IS_ENABLED() instead of checking for built-in or module
2016-09-12 14:03 ` [PATCH 11/15] sfc: " Javier Martinez Canillas
@ 2016-09-12 14:31 ` Bert Kenward
0 siblings, 0 replies; 23+ messages in thread
From: Bert Kenward @ 2016-09-12 14:31 UTC (permalink / raw)
To: Javier Martinez Canillas, linux-kernel
Cc: netdev, Edward Cree, Solarflare linux maintainers
On 12/09/16 15:03, 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>
Acked-by: Bert Kenward <bkenward@solarflare.com>
Thanks,
Bert.
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 12/15] sis900: use IS_ENABLED() instead of checking for built-in or module
2016-09-12 14:03 [PATCH 00/15] drivers: net: use IS_ENABLED() instead of checking for built-in or module Javier Martinez Canillas
` (10 preceding siblings ...)
2016-09-12 14:03 ` [PATCH 11/15] sfc: " Javier Martinez Canillas
@ 2016-09-12 14:03 ` Javier Martinez Canillas
2016-09-12 17:10 ` Daniele Venzano
2016-09-12 14:03 ` [PATCH 13/15] stmmac: " Javier Martinez Canillas
` (3 subsequent siblings)
15 siblings, 1 reply; 23+ messages in thread
From: Javier Martinez Canillas @ 2016-09-12 14:03 UTC (permalink / raw)
To: linux-kernel; +Cc: Javier Martinez Canillas, netdev, Daniele Venzano
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/net/ethernet/sis/sis900.c | 4 ++--
drivers/net/ethernet/sis/sis900.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/sis/sis900.c b/drivers/net/ethernet/sis/sis900.c
index 95001ee408ab..6f85276376e8 100644
--- a/drivers/net/ethernet/sis/sis900.c
+++ b/drivers/net/ethernet/sis/sis900.c
@@ -1426,7 +1426,7 @@ static void sis900_set_mode(struct sis900_private *sp, int speed, int duplex)
rx_flags |= RxATX;
}
-#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
+#if IS_ENABLED(CONFIG_VLAN_8021Q)
/* Can accept Jumbo packet */
rx_flags |= RxAJAB;
#endif
@@ -1750,7 +1750,7 @@ static int sis900_rx(struct net_device *net_dev)
data_size = rx_status & DSIZE;
rx_size = data_size - CRC_SIZE;
-#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
+#if IS_ENABLED(CONFIG_VLAN_8021Q)
/* ``TOOLONG'' flag means jumbo packet received. */
if ((rx_status & TOOLONG) && data_size <= MAX_FRAME_SIZE)
rx_status &= (~ ((unsigned int)TOOLONG));
diff --git a/drivers/net/ethernet/sis/sis900.h b/drivers/net/ethernet/sis/sis900.h
index 7d430d322931..f0da3dc52c01 100644
--- a/drivers/net/ethernet/sis/sis900.h
+++ b/drivers/net/ethernet/sis/sis900.h
@@ -310,7 +310,7 @@ enum sis630_revision_id {
#define CRC_SIZE 4
#define MAC_HEADER_SIZE 14
-#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
+#if IS_ENABLED(CONFIG_VLAN_8021Q)
#define MAX_FRAME_SIZE (1518 + 4)
#else
#define MAX_FRAME_SIZE 1518
--
2.7.4
^ permalink raw reply related [flat|nested] 23+ messages in thread
* Re: [PATCH 12/15] sis900: use IS_ENABLED() instead of checking for built-in or module
2016-09-12 14:03 ` [PATCH 12/15] sis900: " Javier Martinez Canillas
@ 2016-09-12 17:10 ` Daniele Venzano
0 siblings, 0 replies; 23+ messages in thread
From: Daniele Venzano @ 2016-09-12 17:10 UTC (permalink / raw)
To: Javier Martinez Canillas, linux-kernel; +Cc: netdev
On 12 September 2016 16:03:43 CEST, Javier Martinez Canillas <javier@osg.samsung.com> 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>
Acked-by: Daniele Venzano <venza@brownhat.org>
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 13/15] stmmac: use IS_ENABLED() instead of checking for built-in or module
2016-09-12 14:03 [PATCH 00/15] drivers: net: use IS_ENABLED() instead of checking for built-in or module Javier Martinez Canillas
` (11 preceding siblings ...)
2016-09-12 14:03 ` [PATCH 12/15] sis900: " Javier Martinez Canillas
@ 2016-09-12 14:03 ` Javier Martinez Canillas
2016-09-12 16:47 ` Alexandre Torgue
2016-09-12 14:03 ` [PATCH 14/15] hamradio: " Javier Martinez Canillas
` (2 subsequent siblings)
15 siblings, 1 reply; 23+ messages in thread
From: Javier Martinez Canillas @ 2016-09-12 14:03 UTC (permalink / raw)
To: linux-kernel
Cc: Javier Martinez Canillas, netdev, Alexandre Torgue,
Giuseppe Cavallaro
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/net/ethernet/stmicro/stmmac/common.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/stmicro/stmmac/common.h
index 2533b91f1421..d3292c4a6eda 100644
--- a/drivers/net/ethernet/stmicro/stmmac/common.h
+++ b/drivers/net/ethernet/stmicro/stmmac/common.h
@@ -30,7 +30,7 @@
#include <linux/stmmac.h>
#include <linux/phy.h>
#include <linux/module.h>
-#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
+#if IS_ENABLED(CONFIG_VLAN_8021Q)
#define STMMAC_VLAN_TAG_USED
#include <linux/if_vlan.h>
#endif
--
2.7.4
^ permalink raw reply related [flat|nested] 23+ messages in thread
* Re: [PATCH 13/15] stmmac: use IS_ENABLED() instead of checking for built-in or module
2016-09-12 14:03 ` [PATCH 13/15] stmmac: " Javier Martinez Canillas
@ 2016-09-12 16:47 ` Alexandre Torgue
0 siblings, 0 replies; 23+ messages in thread
From: Alexandre Torgue @ 2016-09-12 16:47 UTC (permalink / raw)
To: Javier Martinez Canillas, linux-kernel; +Cc: netdev, Giuseppe Cavallaro
Hi Javier,
On 09/12/2016 04:03 PM, 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/net/ethernet/stmicro/stmmac/common.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/stmicro/stmmac/common.h
> index 2533b91f1421..d3292c4a6eda 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/common.h
> +++ b/drivers/net/ethernet/stmicro/stmmac/common.h
> @@ -30,7 +30,7 @@
> #include <linux/stmmac.h>
> #include <linux/phy.h>
> #include <linux/module.h>
> -#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
> +#if IS_ENABLED(CONFIG_VLAN_8021Q)
> #define STMMAC_VLAN_TAG_USED
> #include <linux/if_vlan.h>
> #endif
>
Reviewed-by: Alexandre TORGUE <alexandre.torgue@st.com>
Thanks,
Alex
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 14/15] hamradio: use IS_ENABLED() instead of checking for built-in or module
2016-09-12 14:03 [PATCH 00/15] drivers: net: use IS_ENABLED() instead of checking for built-in or module Javier Martinez Canillas
` (12 preceding siblings ...)
2016-09-12 14:03 ` [PATCH 13/15] stmmac: " Javier Martinez Canillas
@ 2016-09-12 14:03 ` Javier Martinez Canillas
2016-09-12 14:03 ` [PATCH 15/15] iwlegacy: " Javier Martinez Canillas
2016-09-13 3:28 ` [PATCH 00/15] drivers: net: " David Miller
15 siblings, 0 replies; 23+ messages in thread
From: Javier Martinez Canillas @ 2016-09-12 14:03 UTC (permalink / raw)
To: linux-kernel; +Cc: Javier Martinez Canillas, netdev
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/net/hamradio/bpqether.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c
index d95a50ae996d..622ab3ab9e93 100644
--- a/drivers/net/hamradio/bpqether.c
+++ b/drivers/net/hamradio/bpqether.c
@@ -484,7 +484,7 @@ static void bpq_setup(struct net_device *dev)
dev->flags = 0;
dev->features = NETIF_F_LLTX; /* Allow recursion */
-#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
+#if IS_ENABLED(CONFIG_AX25)
dev->header_ops = &ax25_header_ops;
#endif
--
2.7.4
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH 15/15] iwlegacy: use IS_ENABLED() instead of checking for built-in or module
2016-09-12 14:03 [PATCH 00/15] drivers: net: use IS_ENABLED() instead of checking for built-in or module Javier Martinez Canillas
` (13 preceding siblings ...)
2016-09-12 14:03 ` [PATCH 14/15] hamradio: " Javier Martinez Canillas
@ 2016-09-12 14:03 ` Javier Martinez Canillas
2016-09-13 3:28 ` [PATCH 00/15] drivers: net: " David Miller
15 siblings, 0 replies; 23+ messages in thread
From: Javier Martinez Canillas @ 2016-09-12 14:03 UTC (permalink / raw)
To: linux-kernel
Cc: Javier Martinez Canillas, linux-wireless, netdev, Kalle Valo,
Stanislaw Gruszka
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/net/wireless/intel/iwlegacy/common.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlegacy/common.h b/drivers/net/wireless/intel/iwlegacy/common.h
index 726ede391cb9..3bba521d2cd9 100644
--- a/drivers/net/wireless/intel/iwlegacy/common.h
+++ b/drivers/net/wireless/intel/iwlegacy/common.h
@@ -1320,7 +1320,7 @@ struct il_priv {
u64 timestamp;
union {
-#if defined(CONFIG_IWL3945) || defined(CONFIG_IWL3945_MODULE)
+#if IS_ENABLED(CONFIG_IWL3945)
struct {
void *shared_virt;
dma_addr_t shared_phys;
@@ -1351,7 +1351,7 @@ struct il_priv {
} _3945;
#endif
-#if defined(CONFIG_IWL4965) || defined(CONFIG_IWL4965_MODULE)
+#if IS_ENABLED(CONFIG_IWL4965)
struct {
struct il_rx_phy_res last_phy_res;
bool last_phy_res_valid;
--
2.7.4
^ permalink raw reply related [flat|nested] 23+ messages in thread
* Re: [PATCH 00/15] drivers: net: use IS_ENABLED() instead of checking for built-in or module
2016-09-12 14:03 [PATCH 00/15] drivers: net: use IS_ENABLED() instead of checking for built-in or module Javier Martinez Canillas
` (14 preceding siblings ...)
2016-09-12 14:03 ` [PATCH 15/15] iwlegacy: " Javier Martinez Canillas
@ 2016-09-13 3:28 ` David Miller
15 siblings, 0 replies; 23+ messages in thread
From: David Miller @ 2016-09-13 3:28 UTC (permalink / raw)
To: javier
Cc: linux-kernel, arnd, sony.chacko, peppe.cavallaro,
linux-net-drivers, fw, bkenward, geert, ecree, kvalo, mw, a,
intel-wired-lan, f.fainelli, felipe.balbi, gregory.clement,
Dept-HSGLinuxNICDev, jeffrey.t.kirsher, mugunthanvnm, andrew,
klassert, sgruszka, kda, qiang.zhao, netdev, gerlando.falauto,
linux-wireless, ionut, venza, alexandre.torgue
From: Javier Martinez Canillas <javier@osg.samsung.com>
Date: Mon, 12 Sep 2016 10:03:31 -0400
> This trivial series is similar to [0] for net/ that you already merged, but
> for drivers/net. The patches replaces the open coding to check for a Kconfig
> symbol being built-in or module, with IS_ENABLED() macro that does the same.
Series applied, thanks.
^ permalink raw reply [flat|nested] 23+ messages in thread