All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] flow_dissector: do not rely on implicit casts
@ 2018-05-07 10:06 Paolo Abeni
  2018-05-07 13:54 ` Jon Maloy
  2018-05-08  4:03 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Paolo Abeni @ 2018-05-07 10:06 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller

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>
---
 include/net/tipc.h        | 4 ++--
 net/core/flow_dissector.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/net/tipc.h b/include/net/tipc.h
index 07670ec022a7..f0e7e6bc1bef 100644
--- a/include/net/tipc.h
+++ b/include/net/tipc.h
@@ -44,11 +44,11 @@ struct tipc_basic_hdr {
 	__be32 w[4];
 };
 
-static inline u32 tipc_hdr_rps_key(struct tipc_basic_hdr *hdr)
+static inline __be32 tipc_hdr_rps_key(struct tipc_basic_hdr *hdr)
 {
 	u32 w0 = ntohl(hdr->w[0]);
 	bool keepalive_msg = (w0 & KEEPALIVE_MSG_MASK) == KEEPALIVE_MSG_MASK;
-	int key;
+	__be32 key;
 
 	/* Return source node identity as key */
 	if (likely(!keepalive_msg))
diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index 030d4ca177fb..4fc1e84d77ec 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -1316,7 +1316,7 @@ u32 skb_get_poff(const struct sk_buff *skb)
 {
 	struct flow_keys_basic keys;
 
-	if (!skb_flow_dissect_flow_keys_basic(skb, &keys, 0, 0, 0, 0, 0))
+	if (!skb_flow_dissect_flow_keys_basic(skb, &keys, NULL, 0, 0, 0, 0))
 		return 0;
 
 	return __skb_get_poff(skb, skb->data, &keys, skb_headlen(skb));
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH net-next] flow_dissector: do not rely on implicit casts
  2018-05-07 10:06 [PATCH net-next] flow_dissector: do not rely on implicit casts Paolo Abeni
@ 2018-05-07 13:54 ` Jon Maloy
  2018-05-08  4:03 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Jon Maloy @ 2018-05-07 13:54 UTC (permalink / raw)
  To: Paolo Abeni, netdev; +Cc: David S. Miller

Acked-by: Jon Maloy <jon.maloy@ericsson.com>


> -----Original Message-----
> From: netdev-owner@vger.kernel.org [mailto:netdev-
> owner@vger.kernel.org] On Behalf Of Paolo Abeni
> Sent: Monday, May 07, 2018 06:06
> To: netdev@vger.kernel.org
> Cc: David S. Miller <davem@davemloft.net>
> Subject: [PATCH net-next] 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>
> ---
>  include/net/tipc.h        | 4 ++--
>  net/core/flow_dissector.c | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/include/net/tipc.h b/include/net/tipc.h index
> 07670ec022a7..f0e7e6bc1bef 100644
> --- a/include/net/tipc.h
> +++ b/include/net/tipc.h
> @@ -44,11 +44,11 @@ struct tipc_basic_hdr {
>  	__be32 w[4];
>  };
> 
> -static inline u32 tipc_hdr_rps_key(struct tipc_basic_hdr *hdr)
> +static inline __be32 tipc_hdr_rps_key(struct tipc_basic_hdr *hdr)
>  {
>  	u32 w0 = ntohl(hdr->w[0]);
>  	bool keepalive_msg = (w0 & KEEPALIVE_MSG_MASK) ==
> KEEPALIVE_MSG_MASK;
> -	int key;
> +	__be32 key;
> 
>  	/* Return source node identity as key */
>  	if (likely(!keepalive_msg))
> diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c index
> 030d4ca177fb..4fc1e84d77ec 100644
> --- a/net/core/flow_dissector.c
> +++ b/net/core/flow_dissector.c
> @@ -1316,7 +1316,7 @@ u32 skb_get_poff(const struct sk_buff *skb)  {
>  	struct flow_keys_basic keys;
> 
> -	if (!skb_flow_dissect_flow_keys_basic(skb, &keys, 0, 0, 0, 0, 0))
> +	if (!skb_flow_dissect_flow_keys_basic(skb, &keys, NULL, 0, 0, 0, 0))
>  		return 0;
> 
>  	return __skb_get_poff(skb, skb->data, &keys, skb_headlen(skb));
> --
> 2.14.3

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] flow_dissector: do not rely on implicit casts
  2018-05-07 10:06 [PATCH net-next] flow_dissector: do not rely on implicit casts Paolo Abeni
  2018-05-07 13:54 ` Jon Maloy
@ 2018-05-08  4:03 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2018-05-08  4:03 UTC (permalink / raw)
  To: pabeni; +Cc: netdev

From: Paolo Abeni <pabeni@redhat.com>
Date: Mon,  7 May 2018 12:06:03 +0200

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

Applied, thank you.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-08  4:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-07 10:06 [PATCH net-next] flow_dissector: do not rely on implicit casts Paolo Abeni
2018-05-07 13:54 ` Jon Maloy
2018-05-08  4:03 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.