OSDN Git Service

pinctrl: loongson2: Fix some const correctness
authorLinus Walleij <linus.walleij@linaro.org>
Fri, 25 Nov 2022 10:34:35 +0000 (11:34 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 25 Nov 2022 10:41:01 +0000 (11:41 +0100)
commit7ebfe10ec36b80637fe746dc2371ff1d9ce71efa
tree5235c633cd556a1e3af1bf47f921caaf0b36ca51
parent5ead93289815a075d43c415e35c8beafafb801c9
pinctrl: loongson2: Fix some const correctness

The kernel robot using sparse is complaining like this:

drivers/pinctrl/pinctrl-loongson2.c:212:21: sparse:
 sparse: incorrect type in argument 1 (different address spaces) @@
 expected void const volatile [noderef] __iomem *addr @@
 got void *[noderef] __iomem reg @@
(...)

I think the problem is simply that the register base is defined
as void * __iomem instead of void __iomem * and this is because
of the way const correctness works with pointer infix order.

Fix it up. I think.

Reported-by: kernel test robot <lkp@intel.com>
Cc: zhanghongchen <zhanghongchen@loongson.cn>
Cc: Yinbo Zhu <zhuyinbo@loongson.cn>
Fixes: f73f88acbc18 ("pinctrl: pinctrl-loongson2: add pinctrl driver support")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-loongson2.c