Commit c5d21c4b authored by Roland Dreier's avatar Roland Dreier Committed by David S. Miller

net: Reorder initialization in ip_route_output to fix gcc warning

If I build with W=1, for every file that includes <net/route.h>, I get the warning

    include/net/route.h: In function 'ip_route_output':
    include/net/route.h:135:3: warning: initialized field overwritten [-Woverride-init]
    include/net/route.h:135:3: warning: (near initialization for 'fl4') [-Woverride-init]

(This is with "gcc (Debian 4.6.3-1) 4.6.3")

A fix seems pretty trivial: move the initialization of .flowi4_tos
earlier.  As far as I can tell, this has no effect on code generation.
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 83a27052
...@@ -130,9 +130,9 @@ static inline struct rtable *ip_route_output(struct net *net, __be32 daddr, ...@@ -130,9 +130,9 @@ static inline struct rtable *ip_route_output(struct net *net, __be32 daddr,
{ {
struct flowi4 fl4 = { struct flowi4 fl4 = {
.flowi4_oif = oif, .flowi4_oif = oif,
.flowi4_tos = tos,
.daddr = daddr, .daddr = daddr,
.saddr = saddr, .saddr = saddr,
.flowi4_tos = tos,
}; };
return ip_route_output_key(net, &fl4); return ip_route_output_key(net, &fl4);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment