Re: [PATCH net] net: dsa: b53: Fix sparse warnings in b53_mmap.c

From: David Miller
Date: Wed Apr 04 2018 - 11:16:14 EST


From: Florian Fainelli <f.fainelli@xxxxxxxxx>
Date: Mon, 2 Apr 2018 16:17:01 -0700

> sparse complains about the following warnings:
>
> drivers/net/dsa/b53/b53_mmap.c:33:31: warning: incorrect type in
> initializer (different address spaces)
> drivers/net/dsa/b53/b53_mmap.c:33:31: expected unsigned char
> [noderef] [usertype] <asn:2>*regs
> drivers/net/dsa/b53/b53_mmap.c:33:31: got void *priv
>
> and indeed, while what we are doing is functional, we are dereferencing
> a void * pointer into a void __iomem * which is not great. Just use the
> defined b53_mmap_priv structure which holds our register base and use
> that.
>
> Fixes: 967dd82ffc52 ("net: dsa: b53: Add support for Broadcom RoboSwitch")
> Signed-off-by: Florian Fainelli <f.fainelli@xxxxxxxxx>

Applied.