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

flow_dissector: do not rely on implicit casts

This change fixes a couple of type mismatch reported by the sparse
tool, explicitly using the requested type for the offending arguments.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Acked-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Paolo Abeni and committed by
David S. Miller
d869dea6 72a338bc

+3 -3
+2 -2
include/net/tipc.h
··· 44 44 __be32 w[4]; 45 45 }; 46 46 47 - static inline u32 tipc_hdr_rps_key(struct tipc_basic_hdr *hdr) 47 + static inline __be32 tipc_hdr_rps_key(struct tipc_basic_hdr *hdr) 48 48 { 49 49 u32 w0 = ntohl(hdr->w[0]); 50 50 bool keepalive_msg = (w0 & KEEPALIVE_MSG_MASK) == KEEPALIVE_MSG_MASK; 51 - int key; 51 + __be32 key; 52 52 53 53 /* Return source node identity as key */ 54 54 if (likely(!keepalive_msg))
+1 -1
net/core/flow_dissector.c
··· 1316 1316 { 1317 1317 struct flow_keys_basic keys; 1318 1318 1319 - if (!skb_flow_dissect_flow_keys_basic(skb, &keys, 0, 0, 0, 0, 0)) 1319 + if (!skb_flow_dissect_flow_keys_basic(skb, &keys, NULL, 0, 0, 0, 0)) 1320 1320 return 0; 1321 1321 1322 1322 return __skb_get_poff(skb, skb->data, &keys, skb_headlen(skb));