Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: Fix warnings caused by MAX_SKB_FRAGS change.

After commit a715dea3c8e9ef2771c534e05ee1d36f65987e64 ("net: Always
allocate at least 16 skb frags regardless of page size"), the value
of MAX_SKB_FRAGS can now take on either an "unsigned long" or an
"int" value.

This causes warnings like:

net/packet/af_packet.c: In function ‘tpacket_fill_skb’:
net/packet/af_packet.c:948: warning: format ‘%lu’ expects type ‘long unsigned int’, but argument 2 has type ‘int’

Fix by forcing the constant to be unsigned long, otherwise we have
a situation where the type of a system wide constant is variable.

Signed-off-by: David S. Miller <davem@davemloft.net>

+1 -1
+1 -1
include/linux/skbuff.h
··· 126 126 * GRO uses frags we allocate at least 16 regardless of page size. 127 127 */ 128 128 #if (65536/PAGE_SIZE + 2) < 16 129 - #define MAX_SKB_FRAGS 16 129 + #define MAX_SKB_FRAGS 16UL 130 130 #else 131 131 #define MAX_SKB_FRAGS (65536/PAGE_SIZE + 2) 132 132 #endif