On Tue, 24 Nov 2020 12:28:33 -0500 jma...@redhat.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

Reply via email to