]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: b53: Fix sparse warnings in b53_mmap.c
authorFlorian Fainelli <f.fainelli@gmail.com>
Mon, 2 Apr 2018 23:17:01 +0000 (16:17 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 Apr 2018 15:15:27 +0000 (11:15 -0400)
commitecc05ca3a9f7e9126767ac8a28e885d04c089558
tree1c332e26df66bf8e24fea9a2f1dcf7f17c0d74e6
parenta30a18e59168d92c8718d0dae4abcb73e75cf4c7
net: dsa: b53: Fix sparse warnings in b53_mmap.c

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: 89fb23a74505 ("net: dsa: b53: Add support for Broadcom RoboSwitch")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/b53/b53_mmap.c