netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Eric Dumazet <eric.dumazet@gmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Cc: David Ahern <dsahern@kernel.org>, netdev <netdev@vger.kernel.org>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [PATCH net] ipv4: remove sparse error in ip_neigh_gw4()
Date: Wed, 26 Jan 2022 19:36:50 -0700	[thread overview]
Message-ID: <640acb21-e5ed-49cb-ecce-34200f5af543@gmail.com> (raw)
In-Reply-To: <20220127013404.1279313-1-eric.dumazet@gmail.com>

On 1/26/22 6:34 PM, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
> 
> ./include/net/route.h:373:48: warning: incorrect type in argument 2 (different base types)
> ./include/net/route.h:373:48:    expected unsigned int [usertype] key
> ./include/net/route.h:373:48:    got restricted __be32 [usertype] daddr
> 
> Fixes: 5c9f7c1dfc2e ("ipv4: Add helpers for neigh lookup for nexthop")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: David Ahern <dsahern@gmail.com>
> ---
>  include/net/route.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/net/route.h b/include/net/route.h
> index 4c858dcf1aa8cd1988746e55eb698ad4425fd77b..25404fc2b48374c69081b8c72c2ea1dbbc09ed7f 100644
> --- a/include/net/route.h
> +++ b/include/net/route.h
> @@ -370,7 +370,7 @@ static inline struct neighbour *ip_neigh_gw4(struct net_device *dev,
>  {
>  	struct neighbour *neigh;
>  
> -	neigh = __ipv4_neigh_lookup_noref(dev, daddr);
> +	neigh = __ipv4_neigh_lookup_noref(dev, (__force u32)daddr);
>  	if (unlikely(!neigh))
>  		neigh = __neigh_create(&arp_tbl, &daddr, dev, false);
>  

I think __ipv4_neigh_lookup_noref can be changed to __be32 and remove
the (__force u32) from a couple of callers, but more like net-next material.

Reviewed-by: David Ahern <dsahern@kernel.org>

  reply	other threads:[~2022-01-27  2:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-27  1:34 [PATCH net] ipv4: remove sparse error in ip_neigh_gw4() Eric Dumazet
2022-01-27  2:36 ` David Ahern [this message]
2022-01-27 17:10 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=640acb21-e5ed-49cb-ecce-34200f5af543@gmail.com \
    --to=dsahern@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).