2016-06-16 13:49:20

by Arnd Bergmann

[permalink] [raw]
Subject: [PATCH 0/8] net: fix old-style declarations

"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 <[email protected]>
Cc: Karsten Keil <[email protected]>
Cc: Claudiu Manoil <[email protected]>
Cc: Thomas Sailer <[email protected]>
Cc: Stanislav Yakovlev <[email protected]>
Cc: Steffen Klassert <[email protected]>
Cc: Herbert Xu <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: "J. Bruce Fields" <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]


2016-06-16 13:52:13

by Arnd Bergmann

[permalink] [raw]
Subject: [PATCH 3/8] wireless: ipw2200: fix old-style declaration

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 <[email protected]>
---
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


2016-06-16 13:51:52

by Arnd Bergmann

[permalink] [raw]
Subject: [PATCH 2/8] wireless: brcmsmac: fix old-style declaration

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 <[email protected]>
---
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


2016-06-29 15:56:44

by Kalle Valo

[permalink] [raw]
Subject: Re: [1/8] wireless: airo: rename 'register' variable

Arnd Bergmann <[email protected]> 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 <[email protected]>

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/


2016-06-24 17:46:55

by Stanislav Yakovlev

[permalink] [raw]
Subject: Re: [PATCH 3/8] wireless: ipw2200: fix old-style declaration

On 16 June 2016 at 17:52, Arnd Bergmann <[email protected]> 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 <[email protected]>
> ---
> drivers/net/wireless/intel/ipw2x00/ipw2200.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>

Acked-by: Stanislav Yakovlev <[email protected]>

Stanislav.

2016-06-16 13:51:15

by Arnd Bergmann

[permalink] [raw]
Subject: [PATCH 1/8] wireless: airo: rename 'register' variable

'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 <[email protected]>
---
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