[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201124162210.40f4d607@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Tue, 24 Nov 2020 16:22:10 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: jmaloy@...hat.com
Cc: netdev@...r.kernel.org, davem@...emloft.net,
tipc-discussion@...ts.sourceforge.net,
tung.q.nguyen@...tech.com.au, hoang.h.le@...tech.com.au,
tuong.t.lien@...tech.com.au, maloy@...jonn.com, xinl@...hat.com,
ying.xue@...driver.com, parthasarathy.bhuvaragan@...il.com
Subject: Re: [net-next 2/3] tipc: make node number calculation reproducible
On Tue, 24 Nov 2020 12:28:33 -0500 jmaloy@...hat.com wrote:
> +static inline u32 hash128to32(char *bytes)
> +{
> + u32 res, *tmp = (u32 *)bytes;
> +
> + res = ntohl(tmp[0] ^ tmp[1] ^ tmp[2] ^ tmp[3]);
> + if (likely(res))
> + return res;
> + res = tmp[0] | tmp[1] | tmp[2] | tmp[3];
> + return !res ? 0 : ntohl(18140715);
> +}
This needs to use correct types otherwise sparse gets upset:
net/tipc/addr.c: note: in included file (through ../net/tipc/addr.h):
net/tipc/core.h:218:15: warning: cast to restricted __be32
net/tipc/core.h:218:15: warning: cast to restricted __be32
net/tipc/core.h:218:15: warning: cast to restricted __be32
net/tipc/core.h:218:15: warning: cast to restricted __be32
net/tipc/core.h:218:15: warning: cast to restricted __be32
net/tipc/core.h:218:15: warning: cast to restricted __be32
net/tipc/core.h:222:27: warning: cast to restricted __be32
net/tipc/core.h:222:27: warning: cast to restricted __be32
net/tipc/core.h:222:27: warning: cast to restricted __be32
net/tipc/core.h:222:27: warning: cast to restricted __be32
net/tipc/core.h:222:27: warning: cast to restricted __be32
net/tipc/core.h:222:27: warning: cast to restricted __be32
Powered by blists - more mailing lists