Skip to content

Commit

Permalink
ip_vti: fix sparse warnings for VTI_ISVTI
Browse files Browse the repository at this point in the history
This patch fixes the following sparse warnings:

net/ipv4/ip_tunnel.c:245:53: warning: restricted __be16 degrades to integer
net/ipv4/ip_vti.c:321:19: warning: incorrect type in assignment (different base types)
net/ipv4/ip_vti.c:321:19:    expected restricted __be16 [addressable] [assigned] [usertype] i_flags
net/ipv4/ip_vti.c:321:19:    got int
net/ipv4/ip_vti.c:447:24: warning: incorrect type in assignment (different base types)
net/ipv4/ip_vti.c:447:24:    expected restricted __be16 [usertype] i_flags
net/ipv4/ip_vti.c:447:24:    got int

Since VTI_ISVTI is always used with ip_tunnel_parm->i_flags (which is __be16),
we can __force cast VTI_ISVTI to __be16 in header file.

Signed-off-by: Dmitry Popov <ixaphire@qrator.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Dmitry Popov authored and David S. Miller committed Jun 11, 2014
1 parent 2f87208 commit efd0f11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/uapi/linux/if_tunnel.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ enum {
#define IFLA_GRE_MAX (__IFLA_GRE_MAX - 1)

/* VTI-mode i_flags */
#define VTI_ISVTI 0x0001
#define VTI_ISVTI ((__force __be16)0x0001)

enum {
IFLA_VTI_UNSPEC,
Expand Down

0 comments on commit efd0f11

Please sign in to comment.