* [PATCH 0/8] net: fix old-style declarations
@ 2016-06-16 13:50 Arnd Bergmann
2016-06-16 13:52 ` [PATCH 1/8] wireless: airo: rename 'register' variable Arnd Bergmann
` (2 more replies)
0 siblings, 3 replies; 18+ messages in thread
From: Arnd Bergmann @ 2016-06-16 13:50 UTC (permalink / raw)
To: netdev
Cc: Arnd Bergmann, Armin Schindler, Karsten Keil, Claudiu Manoil,
Thomas Sailer, Stanislav Yakovlev, Steffen Klassert, Herbert Xu,
David S. Miller, Trond Myklebust, Anna Schumaker,
J. Bruce Fields, linux-kernel, linux-hams, linux-wireless,
brcm80211-dev-list, linux-nfs
"make W=1" enables -Wold-style-declaration, which is generally useful
to warn about pre-C89 code in the kernel, but it also warns about
some harmless variations (sometimes many of them from a single
file).
This fixes up the 8 instances I found in the networking code, there
is another series of 12 patches for the rest of the kernel.
Arnd Bergmann (8):
wireless: airo: rename 'register' variable
wireless: brcmsmac: fix old-style declaration
wireless: ipw2200: fix old-style declaration
hamradio: baycom: fix old-style declaration
isdn: eicon: fix old-style declarations
net: gianfar: fix old-style declaration
net: xfrm: fix old-style declaration
sunrpc: fix old-style declaration
drivers/isdn/hardware/eicon/divasmain.c | 12 ++++++------
drivers/isdn/hardware/eicon/platform.h | 6 +++---
drivers/net/ethernet/freescale/gianfar.c | 2 +-
drivers/net/hamradio/baycom_par.c | 6 +++---
drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c | 4 ++--
drivers/net/wireless/cisco/airo.c | 4 ++--
drivers/net/wireless/intel/ipw2x00/ipw2200.c | 2 +-
net/ipv4/xfrm4_policy.c | 8 ++++----
net/ipv6/xfrm6_policy.c | 4 ++--
net/sunrpc/clnt.c | 2 +-
10 files changed, 25 insertions(+), 25 deletions(-)
--
2.9.0
Cc: Armin Schindler <mac@melware.de>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: Claudiu Manoil <claudiu.manoil@freescale.com>
Cc: Thomas Sailer <t.sailer@alumni.ethz.ch>
Cc: Stanislav Yakovlev <stas.yakovlev@gmail.com>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: Anna Schumaker <anna.schumaker@netapp.com>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-hams@vger.kernel.org
Cc: linux-wireless@vger.kernel.org
Cc: brcm80211-dev-list@broadcom.com
Cc: linux-nfs@vger.kernel.org
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 1/8] wireless: airo: rename 'register' variable
2016-06-16 13:50 [PATCH 0/8] net: fix old-style declarations Arnd Bergmann
@ 2016-06-16 13:52 ` Arnd Bergmann
2016-06-16 13:52 ` [PATCH 2/8] wireless: brcmsmac: fix old-style declaration Arnd Bergmann
` (5 more replies)
2016-06-16 13:57 ` [PATCH 8/8] sunrpc: fix old-style declaration Arnd Bergmann
2016-06-16 13:59 ` [PATCH 7/8] net: xfrm: " Arnd Bergmann
2 siblings, 6 replies; 18+ messages in thread
From: Arnd Bergmann @ 2016-06-16 13:52 UTC (permalink / raw)
To: netdev
Cc: Arnd Bergmann, Kalle Valo, Ondrej Zary, Johannes Berg,
linux-wireless, linux-kernel
'register' is a keyword in C and cannot be used in place of a
variable name, as shown by this -Wextra warning:
drivers/net/wireless/cisco/airo.c:1105:29: error: 'register' is not at beginning of declaration [-Werror=old-style-declaration]
This replaces the 'register' keyword with a 'reg' identifier in
the declaration, which matches the definition and has the intended
meaning.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/net/wireless/cisco/airo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/cisco/airo.c b/drivers/net/wireless/cisco/airo.c
index b6c9d5feef1f..6bdb6f6bdfe8 100644
--- a/drivers/net/wireless/cisco/airo.c
+++ b/drivers/net/wireless/cisco/airo.c
@@ -1102,8 +1102,8 @@ static const char version[] = "airo.c 0.6 (Ben Reed & Javier Achirica)";
struct airo_info;
static int get_dec_u16( char *buffer, int *start, int limit );
-static void OUT4500( struct airo_info *, u16 register, u16 value );
-static unsigned short IN4500( struct airo_info *, u16 register );
+static void OUT4500( struct airo_info *, u16 reg, u16 value );
+static unsigned short IN4500( struct airo_info *, u16 reg );
static u16 setup_card(struct airo_info*, u8 *mac, int lock);
static int enable_MAC(struct airo_info *ai, int lock);
static void disable_MAC(struct airo_info *ai, int lock);
--
2.9.0
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 2/8] wireless: brcmsmac: fix old-style declaration
2016-06-16 13:52 ` [PATCH 1/8] wireless: airo: rename 'register' variable Arnd Bergmann
@ 2016-06-16 13:52 ` Arnd Bergmann
2016-06-16 13:52 ` [PATCH 3/8] wireless: ipw2200: " Arnd Bergmann
` (4 subsequent siblings)
5 siblings, 0 replies; 18+ messages in thread
From: Arnd Bergmann @ 2016-06-16 13:52 UTC (permalink / raw)
To: netdev
Cc: Arnd Bergmann, Brett Rudley, Arend van Spriel,
Franky (Zhenhui) Lin, Hante Meuleman, Kalle Valo, Johannes Berg,
David S. Miller, linux-wireless, brcm80211-dev-list,
linux-kernel
Modern C standards expect the 'static' keyword to come first in a
declaration, and we get a warning for this with "make W=1":
drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c:3353:1: error: 'static' is not at beginning of declaration [-Werror=old-style-declaration]
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c
index e16ee60639f5..c2a938b59044 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c
@@ -3349,8 +3349,8 @@ static void brcms_b_coreinit(struct brcms_c_info *wlc)
dma_rxfill(wlc_hw->di[RX_FIFO]);
}
-void
-static brcms_b_init(struct brcms_hardware *wlc_hw, u16 chanspec) {
+static void brcms_b_init(struct brcms_hardware *wlc_hw, u16 chanspec)
+{
u32 macintmask;
bool fastclk;
struct brcms_c_info *wlc = wlc_hw->wlc;
--
2.9.0
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 3/8] wireless: ipw2200: fix old-style declaration
2016-06-16 13:52 ` [PATCH 1/8] wireless: airo: rename 'register' variable Arnd Bergmann
2016-06-16 13:52 ` [PATCH 2/8] wireless: brcmsmac: fix old-style declaration Arnd Bergmann
@ 2016-06-16 13:52 ` Arnd Bergmann
2016-06-24 17:46 ` Stanislav Yakovlev
2016-06-16 13:52 ` [PATCH 4/8] hamradio: baycom: " Arnd Bergmann
` (3 subsequent siblings)
5 siblings, 1 reply; 18+ messages in thread
From: Arnd Bergmann @ 2016-06-16 13:52 UTC (permalink / raw)
To: netdev
Cc: Arnd Bergmann, Stanislav Yakovlev, Kalle Valo, David S. Miller,
Johannes Berg, linux-wireless, linux-kernel
Modern C standards expect the 'inline' keyword to come before the return
type in a declaration, and we get a warning for this with "make W=1":
drivers/net/wireless/intel/ipw2x00/ipw2200.c:4096:1: error: 'inline' is not at beginning of declaration [-Werror=old-style-declaration]
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/net/wireless/intel/ipw2x00/ipw2200.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2200.c b/drivers/net/wireless/intel/ipw2x00/ipw2200.c
index 5adb7cefb2fe..bfd68612a535 100644
--- a/drivers/net/wireless/intel/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/intel/ipw2x00/ipw2200.c
@@ -4093,7 +4093,7 @@ static const char *ipw_get_status_code(u16 status)
return "Unknown status value.";
}
-static void inline average_init(struct average *avg)
+static inline void average_init(struct average *avg)
{
memset(avg, 0, sizeof(*avg));
}
--
2.9.0
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 4/8] hamradio: baycom: fix old-style declaration
2016-06-16 13:52 ` [PATCH 1/8] wireless: airo: rename 'register' variable Arnd Bergmann
2016-06-16 13:52 ` [PATCH 2/8] wireless: brcmsmac: fix old-style declaration Arnd Bergmann
2016-06-16 13:52 ` [PATCH 3/8] wireless: ipw2200: " Arnd Bergmann
@ 2016-06-16 13:52 ` Arnd Bergmann
2016-06-17 5:06 ` David Miller
2016-06-16 13:52 ` [PATCH 5/8] isdn: eicon: fix old-style declarations Arnd Bergmann
` (2 subsequent siblings)
5 siblings, 1 reply; 18+ messages in thread
From: Arnd Bergmann @ 2016-06-16 13:52 UTC (permalink / raw)
To: netdev, Thomas Sailer; +Cc: Arnd Bergmann, linux-hams, linux-kernel
Modern C standards expect the '__inline__' keyword to come before the return
type in a declaration, and we get a warning for this with "make W=1":
drivers/net/hamradio/baycom_par.c:159:1: error: '__inline__' is not at beginning of declaration [-Werror=old-style-declaration]
For consistency with other drivers, I'm changing '__inline__' to 'inline'
at the same time.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/net/hamradio/baycom_par.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/hamradio/baycom_par.c b/drivers/net/hamradio/baycom_par.c
index acb636963e90..072cddce9264 100644
--- a/drivers/net/hamradio/baycom_par.c
+++ b/drivers/net/hamradio/baycom_par.c
@@ -156,7 +156,7 @@ struct baycom_state {
/* --------------------------------------------------------------------- */
-static void __inline__ baycom_int_freq(struct baycom_state *bc)
+static inline void baycom_int_freq(struct baycom_state *bc)
{
#ifdef BAYCOM_DEBUG
unsigned long cur_jiffies = jiffies;
@@ -192,7 +192,7 @@ static void __inline__ baycom_int_freq(struct baycom_state *bc)
/* --------------------------------------------------------------------- */
-static __inline__ void par96_tx(struct net_device *dev, struct baycom_state *bc)
+static inline void par96_tx(struct net_device *dev, struct baycom_state *bc)
{
int i;
unsigned int data = hdlcdrv_getbits(&bc->hdrv);
@@ -216,7 +216,7 @@ static __inline__ void par96_tx(struct net_device *dev, struct baycom_state *bc)
/* --------------------------------------------------------------------- */
-static __inline__ void par96_rx(struct net_device *dev, struct baycom_state *bc)
+static inline void par96_rx(struct net_device *dev, struct baycom_state *bc)
{
int i;
unsigned int data, mask, mask2, descx;
--
2.9.0
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 5/8] isdn: eicon: fix old-style declarations
2016-06-16 13:52 ` [PATCH 1/8] wireless: airo: rename 'register' variable Arnd Bergmann
` (2 preceding siblings ...)
2016-06-16 13:52 ` [PATCH 4/8] hamradio: baycom: " Arnd Bergmann
@ 2016-06-16 13:52 ` Arnd Bergmann
2016-06-17 5:06 ` David Miller
2016-06-16 13:52 ` [PATCH 6/8] net: gianfar: fix old-style declaration Arnd Bergmann
2016-06-29 15:56 ` Kalle Valo
5 siblings, 1 reply; 18+ messages in thread
From: Arnd Bergmann @ 2016-06-16 13:52 UTC (permalink / raw)
To: netdev, Karsten Keil; +Cc: Arnd Bergmann, Armin Schindler, linux-kernel
Modern C standards expect the '__inline__' keyword to come before the return
type in a declaration, and we get many warnings for this with "make W=1"
because the eicon driver has this in a header file:
eicon/divasmain.c:448:1: error: '__inline__' is not at beginning of declaration [-Werror=old-style-declaration]
eicon/divasmain.c:453:1: error: '__inline__' is not at beginning of declaration [-Werror=old-style-declaration]
eicon/divasmain.c:458:1: error: '__inline__' is not at beginning of declaration [-Werror=old-style-declaration]
eicon/divasmain.c:463:1: error: '__inline__' is not at beginning of declaration [-Werror=old-style-declaration]
eicon/divasmain.c:468:1: error: '__inline__' is not at beginning of declaration [-Werror=old-style-declaration]
eicon/divasmain.c:473:1: error: '__inline__' is not at beginning of declaration [-Werror=old-style-declaration]
eicon/platform.h:274:1: error: '__inline__' is not at beginning of declaration [-Werror=old-style-declaration]
eicon/platform.h:280:1: error: '__inline__' is not at beginning of declaration [-Werror=old-style-declaration]
A similar warning gets printed for the diva_os_register_io_port()
declaration, because 'register' is interpreted as a keyword instead
of a variable name:
In file included from eicon/diva_didd.c:21:0:
eicon/platform.h:206:1: error: 'register' is not at beginning of declaration [-Werror=old-style-declaration]
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/isdn/hardware/eicon/divasmain.c | 12 ++++++------
drivers/isdn/hardware/eicon/platform.h | 6 +++---
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/isdn/hardware/eicon/divasmain.c b/drivers/isdn/hardware/eicon/divasmain.c
index a2e0ed6c9a4d..32f34511c416 100644
--- a/drivers/isdn/hardware/eicon/divasmain.c
+++ b/drivers/isdn/hardware/eicon/divasmain.c
@@ -445,32 +445,32 @@ void divasa_unmap_pci_bar(void __iomem *bar)
/*********************************************************
** I/O port access
*********************************************************/
-byte __inline__ inpp(void __iomem *addr)
+inline byte inpp(void __iomem *addr)
{
return (inb((unsigned long) addr));
}
-word __inline__ inppw(void __iomem *addr)
+inline word inppw(void __iomem *addr)
{
return (inw((unsigned long) addr));
}
-void __inline__ inppw_buffer(void __iomem *addr, void *P, int length)
+inline void inppw_buffer(void __iomem *addr, void *P, int length)
{
insw((unsigned long) addr, (word *) P, length >> 1);
}
-void __inline__ outppw_buffer(void __iomem *addr, void *P, int length)
+inline void outppw_buffer(void __iomem *addr, void *P, int length)
{
outsw((unsigned long) addr, (word *) P, length >> 1);
}
-void __inline__ outppw(void __iomem *addr, word w)
+inline void outppw(void __iomem *addr, word w)
{
outw(w, (unsigned long) addr);
}
-void __inline__ outpp(void __iomem *addr, word p)
+inline void outpp(void __iomem *addr, word p)
{
outb(p, (unsigned long) addr);
}
diff --git a/drivers/isdn/hardware/eicon/platform.h b/drivers/isdn/hardware/eicon/platform.h
index b2edb7590dda..62e2073c3690 100644
--- a/drivers/isdn/hardware/eicon/platform.h
+++ b/drivers/isdn/hardware/eicon/platform.h
@@ -203,7 +203,7 @@ void PCIread(byte bus, byte func, int offset, void *data, int length, void *pci_
/*
** I/O Port utilities
*/
-int diva_os_register_io_port(void *adapter, int register, unsigned long port,
+int diva_os_register_io_port(void *adapter, int reg, unsigned long port,
unsigned long length, const char *name, int id);
/*
** I/O port access abstraction
@@ -271,13 +271,13 @@ void diva_os_get_time(dword *sec, dword *usec);
** atomic operation, fake because we use threads
*/
typedef int diva_os_atomic_t;
-static diva_os_atomic_t __inline__
+static inline diva_os_atomic_t
diva_os_atomic_increment(diva_os_atomic_t *pv)
{
*pv += 1;
return (*pv);
}
-static diva_os_atomic_t __inline__
+static inline diva_os_atomic_t
diva_os_atomic_decrement(diva_os_atomic_t *pv)
{
*pv -= 1;
--
2.9.0
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 6/8] net: gianfar: fix old-style declaration
2016-06-16 13:52 ` [PATCH 1/8] wireless: airo: rename 'register' variable Arnd Bergmann
` (3 preceding siblings ...)
2016-06-16 13:52 ` [PATCH 5/8] isdn: eicon: fix old-style declarations Arnd Bergmann
@ 2016-06-16 13:52 ` Arnd Bergmann
2016-06-16 18:02 ` Sergei Shtylyov
2016-06-17 5:06 ` David Miller
2016-06-29 15:56 ` Kalle Valo
5 siblings, 2 replies; 18+ messages in thread
From: Arnd Bergmann @ 2016-06-16 13:52 UTC (permalink / raw)
To: netdev; +Cc: Arnd Bergmann, David S. Miller, Yangbo Lu, linux-kernel
Modern C standards expect the '__inline__' keyword to come before the return
type in a declaration, and we get a warning for this with "make W=1":
drivers/net/ethernet/freescale/gianfar.c:2278:1: error: 'inline' is not at beginning of declaration [-Werror=old-style-declaration]
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/net/ethernet/freescale/gianfar.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index 2e6785b6e8be..d20935dc8399 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -2275,7 +2275,7 @@ static inline void gfar_tx_checksum(struct sk_buff *skb, struct txfcb *fcb,
fcb->flags = flags;
}
-void inline gfar_tx_vlan(struct sk_buff *skb, struct txfcb *fcb)
+static inline void gfar_tx_vlan(struct sk_buff *skb, struct txfcb *fcb)
{
fcb->flags |= TXFCB_VLN;
fcb->vlctl = cpu_to_be16(skb_vlan_tag_get(skb));
--
2.9.0
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 8/8] sunrpc: fix old-style declaration
2016-06-16 13:50 [PATCH 0/8] net: fix old-style declarations Arnd Bergmann
2016-06-16 13:52 ` [PATCH 1/8] wireless: airo: rename 'register' variable Arnd Bergmann
@ 2016-06-16 13:57 ` Arnd Bergmann
2016-06-16 13:59 ` [PATCH 7/8] net: xfrm: " Arnd Bergmann
2 siblings, 0 replies; 18+ messages in thread
From: Arnd Bergmann @ 2016-06-16 13:57 UTC (permalink / raw)
To: netdev
Cc: Arnd Bergmann, J. Bruce Fields, Jeff Layton, Trond Myklebust,
Anna Schumaker, David S. Miller, linux-nfs, linux-kernel
Modern C standards expect the 'static' keyword to come before the return
type in a declaration, and we get a warning for this with "make W=1":
net/sunrpc/clnt.c:2580:1: error: 'static' is not at beginning of declaration [-Werror=old-style-declaration]
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
net/sunrpc/clnt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 2808d550d273..cb49898a5a58 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -2577,7 +2577,7 @@ static void rpc_cb_add_xprt_release(void *calldata)
kfree(data);
}
-const static struct rpc_call_ops rpc_cb_add_xprt_call_ops = {
+static const struct rpc_call_ops rpc_cb_add_xprt_call_ops = {
.rpc_call_done = rpc_cb_add_xprt_done,
.rpc_release = rpc_cb_add_xprt_release,
};
--
2.9.0
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 7/8] net: xfrm: fix old-style declaration
2016-06-16 13:50 [PATCH 0/8] net: fix old-style declarations Arnd Bergmann
2016-06-16 13:52 ` [PATCH 1/8] wireless: airo: rename 'register' variable Arnd Bergmann
2016-06-16 13:57 ` [PATCH 8/8] sunrpc: fix old-style declaration Arnd Bergmann
@ 2016-06-16 13:59 ` Arnd Bergmann
2016-06-17 5:06 ` David Miller
2 siblings, 1 reply; 18+ messages in thread
From: Arnd Bergmann @ 2016-06-16 13:59 UTC (permalink / raw)
To: netdev, Steffen Klassert, Herbert Xu, David S. Miller,
Alexey Kuznetsov, James Morris, Hideaki YOSHIFUJI,
Patrick McHardy, David Ahern, linux-kernel
Modern C standards expect the '__inline__' keyword to come before the return
type in a declaration, and we get a couple of warnings for this with "make W=1"
in the xfrm{4,6}_policy.c files:
net/ipv6/xfrm6_policy.c:369:1: error: 'inline' is not at beginning of declaration [-Werror=old-style-declaration]
static int inline xfrm6_net_sysctl_init(struct net *net)
net/ipv6/xfrm6_policy.c:374:1: error: 'inline' is not at beginning of declaration [-Werror=old-style-declaration]
static void inline xfrm6_net_sysctl_exit(struct net *net)
net/ipv4/xfrm4_policy.c:339:1: error: 'inline' is not at beginning of declaration [-Werror=old-style-declaration]
static int inline xfrm4_net_sysctl_init(struct net *net)
net/ipv4/xfrm4_policy.c:344:1: error: 'inline' is not at beginning of declaration [-Werror=old-style-declaration]
static void inline xfrm4_net_sysctl_exit(struct net *net)
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
net/ipv4/xfrm4_policy.c | 8 ++++----
net/ipv6/xfrm6_policy.c | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c
index 7b0edb37a115..b644a23c3db0 100644
--- a/net/ipv4/xfrm4_policy.c
+++ b/net/ipv4/xfrm4_policy.c
@@ -295,7 +295,7 @@ static struct ctl_table xfrm4_policy_table[] = {
{ }
};
-static int __net_init xfrm4_net_sysctl_init(struct net *net)
+static __net_init int xfrm4_net_sysctl_init(struct net *net)
{
struct ctl_table *table;
struct ctl_table_header *hdr;
@@ -323,7 +323,7 @@ err_alloc:
return -ENOMEM;
}
-static void __net_exit xfrm4_net_sysctl_exit(struct net *net)
+static __net_exit void xfrm4_net_sysctl_exit(struct net *net)
{
struct ctl_table *table;
@@ -336,12 +336,12 @@ static void __net_exit xfrm4_net_sysctl_exit(struct net *net)
kfree(table);
}
#else /* CONFIG_SYSCTL */
-static int inline xfrm4_net_sysctl_init(struct net *net)
+static inline int xfrm4_net_sysctl_init(struct net *net)
{
return 0;
}
-static void inline xfrm4_net_sysctl_exit(struct net *net)
+static inline void xfrm4_net_sysctl_exit(struct net *net)
{
}
#endif
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c
index c074771a10f7..6cc97003e4a9 100644
--- a/net/ipv6/xfrm6_policy.c
+++ b/net/ipv6/xfrm6_policy.c
@@ -366,12 +366,12 @@ static void __net_exit xfrm6_net_sysctl_exit(struct net *net)
kfree(table);
}
#else /* CONFIG_SYSCTL */
-static int inline xfrm6_net_sysctl_init(struct net *net)
+static inline int xfrm6_net_sysctl_init(struct net *net)
{
return 0;
}
-static void inline xfrm6_net_sysctl_exit(struct net *net)
+static inline void xfrm6_net_sysctl_exit(struct net *net)
{
}
#endif
--
2.9.0
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH 6/8] net: gianfar: fix old-style declaration
2016-06-16 13:52 ` [PATCH 6/8] net: gianfar: fix old-style declaration Arnd Bergmann
@ 2016-06-16 18:02 ` Sergei Shtylyov
2016-06-16 18:11 ` Joe Perches
2016-06-17 5:06 ` David Miller
1 sibling, 1 reply; 18+ messages in thread
From: Sergei Shtylyov @ 2016-06-16 18:02 UTC (permalink / raw)
To: Arnd Bergmann, netdev; +Cc: David S. Miller, Yangbo Lu, linux-kernel
Hello.
On 06/16/2016 04:52 PM, Arnd Bergmann wrote:
> Modern C standards expect the '__inline__' keyword to come before the return
> type in a declaration, and we get a warning for this with "make W=1":
>
> drivers/net/ethernet/freescale/gianfar.c:2278:1: error: 'inline' is not at beginning of declaration [-Werror=old-style-declaration]
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/net/ethernet/freescale/gianfar.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
> index 2e6785b6e8be..d20935dc8399 100644
> --- a/drivers/net/ethernet/freescale/gianfar.c
> +++ b/drivers/net/ethernet/freescale/gianfar.c
> @@ -2275,7 +2275,7 @@ static inline void gfar_tx_checksum(struct sk_buff *skb, struct txfcb *fcb,
> fcb->flags = flags;
> }
>
> -void inline gfar_tx_vlan(struct sk_buff *skb, struct txfcb *fcb)
> +static inline void gfar_tx_vlan(struct sk_buff *skb, struct txfcb *fcb)
You don't mention making it *static*. Though the function can be *static*
indeed... the current policy also forbids *inline* in the *.c files, leaving
the judgement to gcc.
MBR, Sergei
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 6/8] net: gianfar: fix old-style declaration
2016-06-16 18:02 ` Sergei Shtylyov
@ 2016-06-16 18:11 ` Joe Perches
0 siblings, 0 replies; 18+ messages in thread
From: Joe Perches @ 2016-06-16 18:11 UTC (permalink / raw)
To: Sergei Shtylyov, Arnd Bergmann, netdev
Cc: David S. Miller, Yangbo Lu, linux-kernel
On Thu, 2016-06-16 at 21:02 +0300, Sergei Shtylyov wrote:
> On 06/16/2016 04:52 PM, Arnd Bergmann wrote:
> > Modern C standards expect the '__inline__' keyword to come before the return
> > type in a declaration, and we get a warning for this with "make W=1":
[]
> > diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
[]
> > @@ -2275,7 +2275,7 @@ static inline void gfar_tx_checksum(struct sk_buff *skb, struct txfcb *fcb,
> > fcb->flags = flags;
> > }
> >
> > -void inline gfar_tx_vlan(struct sk_buff *skb, struct txfcb *fcb)
> > +static inline void gfar_tx_vlan(struct sk_buff *skb, struct txfcb *fcb)
> You don't mention making it *static*. Though the function can be *static*
> indeed... the current policy also forbids *inline* in the *.c files, leaving
> the judgement to gcc.
While mostly true, (__always_inline vs inline vs nothing),
there are many inline uses in this file that could be removed
in a separate patch rather than removing just this one.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 5/8] isdn: eicon: fix old-style declarations
2016-06-16 13:52 ` [PATCH 5/8] isdn: eicon: fix old-style declarations Arnd Bergmann
@ 2016-06-17 5:06 ` David Miller
0 siblings, 0 replies; 18+ messages in thread
From: David Miller @ 2016-06-17 5:06 UTC (permalink / raw)
To: arnd; +Cc: netdev, isdn, mac, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
Date: Thu, 16 Jun 2016 15:52:12 +0200
> Modern C standards expect the '__inline__' keyword to come before the return
> type in a declaration, and we get many warnings for this with "make W=1"
> because the eicon driver has this in a header file:
>
> eicon/divasmain.c:448:1: error: '__inline__' is not at beginning of declaration [-Werror=old-style-declaration]
> eicon/divasmain.c:453:1: error: '__inline__' is not at beginning of declaration [-Werror=old-style-declaration]
> eicon/divasmain.c:458:1: error: '__inline__' is not at beginning of declaration [-Werror=old-style-declaration]
> eicon/divasmain.c:463:1: error: '__inline__' is not at beginning of declaration [-Werror=old-style-declaration]
> eicon/divasmain.c:468:1: error: '__inline__' is not at beginning of declaration [-Werror=old-style-declaration]
> eicon/divasmain.c:473:1: error: '__inline__' is not at beginning of declaration [-Werror=old-style-declaration]
> eicon/platform.h:274:1: error: '__inline__' is not at beginning of declaration [-Werror=old-style-declaration]
> eicon/platform.h:280:1: error: '__inline__' is not at beginning of declaration [-Werror=old-style-declaration]
>
> A similar warning gets printed for the diva_os_register_io_port()
> declaration, because 'register' is interpreted as a keyword instead
> of a variable name:
>
> In file included from eicon/diva_didd.c:21:0:
> eicon/platform.h:206:1: error: 'register' is not at beginning of declaration [-Werror=old-style-declaration]
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Applied.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 6/8] net: gianfar: fix old-style declaration
2016-06-16 13:52 ` [PATCH 6/8] net: gianfar: fix old-style declaration Arnd Bergmann
2016-06-16 18:02 ` Sergei Shtylyov
@ 2016-06-17 5:06 ` David Miller
1 sibling, 0 replies; 18+ messages in thread
From: David Miller @ 2016-06-17 5:06 UTC (permalink / raw)
To: arnd; +Cc: netdev, yangbo.lu, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
Date: Thu, 16 Jun 2016 15:52:13 +0200
> Modern C standards expect the '__inline__' keyword to come before the return
> type in a declaration, and we get a warning for this with "make W=1":
>
> drivers/net/ethernet/freescale/gianfar.c:2278:1: error: 'inline' is not at beginning of declaration [-Werror=old-style-declaration]
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Applied.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 4/8] hamradio: baycom: fix old-style declaration
2016-06-16 13:52 ` [PATCH 4/8] hamradio: baycom: " Arnd Bergmann
@ 2016-06-17 5:06 ` David Miller
0 siblings, 0 replies; 18+ messages in thread
From: David Miller @ 2016-06-17 5:06 UTC (permalink / raw)
To: arnd; +Cc: netdev, t.sailer, linux-hams, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
Date: Thu, 16 Jun 2016 15:52:11 +0200
> Modern C standards expect the '__inline__' keyword to come before the return
> type in a declaration, and we get a warning for this with "make W=1":
>
> drivers/net/hamradio/baycom_par.c:159:1: error: '__inline__' is not at beginning of declaration [-Werror=old-style-declaration]
>
> For consistency with other drivers, I'm changing '__inline__' to 'inline'
> at the same time.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Applied.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 7/8] net: xfrm: fix old-style declaration
2016-06-16 13:59 ` [PATCH 7/8] net: xfrm: " Arnd Bergmann
@ 2016-06-17 5:06 ` David Miller
0 siblings, 0 replies; 18+ messages in thread
From: David Miller @ 2016-06-17 5:06 UTC (permalink / raw)
To: arnd
Cc: netdev, steffen.klassert, herbert, kuznet, jmorris, yoshfuji,
kaber, dsa, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
Date: Thu, 16 Jun 2016 15:59:25 +0200
> Modern C standards expect the '__inline__' keyword to come before the return
> type in a declaration, and we get a couple of warnings for this with "make W=1"
> in the xfrm{4,6}_policy.c files:
>
> net/ipv6/xfrm6_policy.c:369:1: error: 'inline' is not at beginning of declaration [-Werror=old-style-declaration]
> static int inline xfrm6_net_sysctl_init(struct net *net)
> net/ipv6/xfrm6_policy.c:374:1: error: 'inline' is not at beginning of declaration [-Werror=old-style-declaration]
> static void inline xfrm6_net_sysctl_exit(struct net *net)
> net/ipv4/xfrm4_policy.c:339:1: error: 'inline' is not at beginning of declaration [-Werror=old-style-declaration]
> static int inline xfrm4_net_sysctl_init(struct net *net)
> net/ipv4/xfrm4_policy.c:344:1: error: 'inline' is not at beginning of declaration [-Werror=old-style-declaration]
> static void inline xfrm4_net_sysctl_exit(struct net *net)
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Applied.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 3/8] wireless: ipw2200: fix old-style declaration
2016-06-16 13:52 ` [PATCH 3/8] wireless: ipw2200: " Arnd Bergmann
@ 2016-06-24 17:46 ` Stanislav Yakovlev
0 siblings, 0 replies; 18+ messages in thread
From: Stanislav Yakovlev @ 2016-06-24 17:46 UTC (permalink / raw)
To: Arnd Bergmann
Cc: netdev, Kalle Valo, David S. Miller, Johannes Berg, wireless,
linux-kernel
On 16 June 2016 at 17:52, Arnd Bergmann <arnd@arndb.de> wrote:
> Modern C standards expect the 'inline' keyword to come before the return
> type in a declaration, and we get a warning for this with "make W=1":
>
> drivers/net/wireless/intel/ipw2x00/ipw2200.c:4096:1: error: 'inline' is not at beginning of declaration [-Werror=old-style-declaration]
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/net/wireless/intel/ipw2x00/ipw2200.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Acked-by: Stanislav Yakovlev <stas.yakovlev@gmail.com>
Stanislav.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [1/8] wireless: airo: rename 'register' variable
@ 2016-06-29 15:56 ` Kalle Valo
0 siblings, 0 replies; 18+ messages in thread
From: Kalle Valo @ 2016-06-29 15:56 UTC (permalink / raw)
To: Arnd Bergmann
Cc: netdev, Arnd Bergmann, Ondrej Zary, Johannes Berg,
linux-wireless, linux-kernel
Arnd Bergmann <arnd@arndb.de> wrote:
> 'register' is a keyword in C and cannot be used in place of a
> variable name, as shown by this -Wextra warning:
>
> drivers/net/wireless/cisco/airo.c:1105:29: error: 'register' is not at beginning of declaration [-Werror=old-style-declaration]
>
> This replaces the 'register' keyword with a 'reg' identifier in
> the declaration, which matches the definition and has the intended
> meaning.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Thanks, 3 patches applied to wireless-drivers-next.git:
88e97c32068f wireless: airo: rename 'register' variable
2a063835ce7c wireless: brcmsmac: fix old-style declaration
6f07e0f12a57 wireless: ipw2200: fix old-style declaration
--
Sent by pwcli
https://patchwork.kernel.org/patch/9180951/
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [1/8] wireless: airo: rename 'register' variable
@ 2016-06-29 15:56 ` Kalle Valo
0 siblings, 0 replies; 18+ messages in thread
From: Kalle Valo @ 2016-06-29 15:56 UTC (permalink / raw)
To: Arnd Bergmann
Cc: netdev-u79uwXL29TY76Z2rM5mHXA, Arnd Bergmann, Ondrej Zary,
Johannes Berg, linux-wireless-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org> wrote:
> 'register' is a keyword in C and cannot be used in place of a
> variable name, as shown by this -Wextra warning:
>
> drivers/net/wireless/cisco/airo.c:1105:29: error: 'register' is not at beginning of declaration [-Werror=old-style-declaration]
>
> This replaces the 'register' keyword with a 'reg' identifier in
> the declaration, which matches the definition and has the intended
> meaning.
>
> Signed-off-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Thanks, 3 patches applied to wireless-drivers-next.git:
88e97c32068f wireless: airo: rename 'register' variable
2a063835ce7c wireless: brcmsmac: fix old-style declaration
6f07e0f12a57 wireless: ipw2200: fix old-style declaration
--
Sent by pwcli
https://patchwork.kernel.org/patch/9180951/
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2016-06-29 15:56 UTC | newest]
Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-16 13:50 [PATCH 0/8] net: fix old-style declarations Arnd Bergmann
2016-06-16 13:52 ` [PATCH 1/8] wireless: airo: rename 'register' variable Arnd Bergmann
2016-06-16 13:52 ` [PATCH 2/8] wireless: brcmsmac: fix old-style declaration Arnd Bergmann
2016-06-16 13:52 ` [PATCH 3/8] wireless: ipw2200: " Arnd Bergmann
2016-06-24 17:46 ` Stanislav Yakovlev
2016-06-16 13:52 ` [PATCH 4/8] hamradio: baycom: " Arnd Bergmann
2016-06-17 5:06 ` David Miller
2016-06-16 13:52 ` [PATCH 5/8] isdn: eicon: fix old-style declarations Arnd Bergmann
2016-06-17 5:06 ` David Miller
2016-06-16 13:52 ` [PATCH 6/8] net: gianfar: fix old-style declaration Arnd Bergmann
2016-06-16 18:02 ` Sergei Shtylyov
2016-06-16 18:11 ` Joe Perches
2016-06-17 5:06 ` David Miller
2016-06-29 15:56 ` [1/8] wireless: airo: rename 'register' variable Kalle Valo
2016-06-29 15:56 ` Kalle Valo
2016-06-16 13:57 ` [PATCH 8/8] sunrpc: fix old-style declaration Arnd Bergmann
2016-06-16 13:59 ` [PATCH 7/8] net: xfrm: " Arnd Bergmann
2016-06-17 5:06 ` David Miller
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.