diff mbox

[6/8] net: gianfar: fix old-style declaration

Message ID 20160616135245.3198419-6-arnd@arndb.de
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Arnd Bergmann June 16, 2016, 1:52 p.m. UTC
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(-)

Comments

Sergei Shtylyov June 16, 2016, 6:02 p.m. UTC | #1
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
Joe Perches June 16, 2016, 6:11 p.m. UTC | #2
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.
David Miller June 17, 2016, 5:06 a.m. UTC | #3
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.
diff mbox

Patch

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));