sh: cast away __iomem to remove sparse warning
PATCH 1/1 sh: cast away __iomem to remove sparse warning
LKP reported a sparse warning in arch/sh/kernel/crash_dump.c during a kdump patchset reviewing:
https://lore.kernel.org/all/[email protected]/T/#u
../arch/sh/kernel/crash_dump.c:23:36: sparse: warning: incorrect type in argument 1 (different address spaces)../arch/sh/kernel/crash_dump.c:23:36: sparse: expected void const *addr../arch/sh/kernel/crash_dump.c:23:36: sparse: got void [noderef] __iomem *
This warning happened when __iomem pointer is passed into fucntion which doesn't expect it. Casting away the __iomem can fix it.
--- arch/sh/kernel/crash_dump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sh/kernel/crash_dump.c +1 -1
@@ -20,7 +20,7 @@ ssize_t copy_oldmem_page(struct iov_iter *iter, unsigned long pfn,return 0 ; vaddr =ioremap (pfn <<PAGE_SHIFT ,PAGE_SIZE ); - csize =copy_to_iter (vaddr + offset, csize, iter); + csize =copy_to_iter ((const void __force *)vaddr + offset, csize, iter);iounmap (vaddr);return csize;
Signature · 1 line
2.34.1
Hi,
Quoted 10 lines · Baoquan He
LKP reported a sparse warning in
arch/sh/kernel/crash_dump.cduring a kdump patchset reviewing:
https://lore.kernel.org/all/[email protected]/T/#u
../arch/sh/kernel/crash_dump.c:23:36: sparse: warning: incorrect type in argument 1 (different address spaces)../arch/sh/kernel/crash_dump.c:23:36: sparse: expected void const *addr../arch/sh/kernel/crash_dump.c:23:36: sparse: got void [noderef]__iomem*This warning happened when
__iomempointer is passed into fucntion which doesn't expect it. Casting away the__iomemcan fix it.
This warning was reported by lkp during one patchset posted and reviewing. Since it's not related to the patchset, I just sent it separately so that later code change on arch/sh/kernel/crash_dump.c won't trigger the lkp warning again.
[PATCH v5 RESEND 0/3] Convert vmcore to use an iov_iter
https://lore.kernel.org/all/[email protected]/T/#u
Now the above patchset has been merged into linus's tree, please consider taking this patch.
Thanks
Baoquan
Quoted 23 lines
Reported-by kernel test robot <[email protected]>Signed-off-by Baoquan He <[email protected]>--- arch/sh/kernel/crash_dump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/sh/kernel/crash_dump.c +1
-1@@ -20,7 +20,7 @@ ssize_t copy_oldmem_page(struct iov_iter *iter, unsigned long pfn,return 0 ; vaddr =ioremap (pfn <<PAGE_SHIFT ,PAGE_SIZE ); - csize =copy_to_iter (vaddr + offset, csize, iter); + csize =copy_to_iter ((const void __force *)vaddr + offset, csize, iter);iounmap (vaddr);return csize;Signature · 1 line
2.34.1
Rob Landley
Tested-byQuoted 19 lines · Baoquan He
Hi,
Quoted 10 lines · Baoquan He
LKP reported a sparse warning in
arch/sh/kernel/crash_dump.cduring a kdump patchset reviewing:
https://lore.kernel.org/all/[email protected]/T/#u
../arch/sh/kernel/crash_dump.c:23:36: sparse: warning: incorrect type in argument 1 (different address spaces)../arch/sh/kernel/crash_dump.c:23:36: sparse: expected void const *addr../arch/sh/kernel/crash_dump.c:23:36: sparse: got void [noderef]__iomem*This warning happened when
__iomempointer is passed into fucntion which doesn't expect it. Casting away the__iomemcan fix it.This warning was reported by lkp during one patchset posted and reviewing. Since it's not related to the patchset, I just sent it separately so that later code change on
arch/sh/kernel/crash_dump.cwon't trigger the lkp warning again.
Quoted 12 lines
[PATCH v5 RESEND 0/3] Convert vmcore to use an
iov_iter
https://lore.kernel.org/all/[email protected]/T/#uNow the above patchset has been merged into linus's tree, please consider taking this patch.
Thanks
BaoquanQuoted 3 lines
Reported-by kernel test robot <[email protected]>Signed-off-by Baoquan He <[email protected]>
Rob
Quoted 27 lines · Rob Landley
Quoted 24 lines · Baoquan He
Hi,
Quoted 10 lines · Baoquan He
LKP reported a sparse warning in
arch/sh/kernel/crash_dump.cduring a kdump patchset reviewing:
https://lore.kernel.org/all/[email protected]/T/#u
../arch/sh/kernel/crash_dump.c:23:36: sparse: warning: incorrect type in argument 1 (different address spaces)../arch/sh/kernel/crash_dump.c:23:36: sparse: expected void const *addr../arch/sh/kernel/crash_dump.c:23:36: sparse: got void [noderef]__iomem*This warning happened when
__iomempointer is passed into fucntion which doesn't expect it. Casting away the__iomemcan fix it.This warning was reported by lkp during one patchset posted and reviewing. Since it's not related to the patchset, I just sent it separately so that later code change on
arch/sh/kernel/crash_dump.cwon't trigger the lkp warning again.[PATCH v5 RESEND 0/3] Convert vmcore to use an
iov_iter
https://lore.kernel.org/all/[email protected]/T/#uNow the above patchset has been merged into linus's tree, please consider taking this patch.
......
Quoted 1 line
Tested-by Rob Landley <[email protected]>
Thanks for testing, Rob.
I guess SuperH arch has been in status of no maintenance, however some generic code change may involve correspondant ARCH change so that we have to touch arch/sh/.
Hi Andrew,
To avoid annoying warning when modifying crash_dump code, could you pick this one?
Thanks
Baoquan
John Paul Adrian Glaubitz
maintainerHi!
Quoted 3 lines · Baoquan He
I guess SuperH arch has been in status of no maintenance, however some generic code change may involve correspondant ARCH change so that we have to touch
arch/sh/.
It is actually actively maintained by Rich Felker but he is often slow to respond at the moment. I have already offered Rich my help and maybe we can work something out that I can help him with the maintenance.
Adrian
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Quoted 10 lines · John Paul Adrian Glaubitz
Hi!
Quoted 3 lines · Baoquan He
I guess SuperH arch has been in status of no maintenance, however some generic code change may involve correspondant ARCH change so that we have to touch
arch/sh/.It is actually actively maintained by Rich Felker but he is often slow to respond at the moment. I have already offered Rich my help and maybe we can work something out that I can help him with the maintenance.
Thanks, Adrian.
Maybe you can start with being a reviewer by adding yourself into MAINTAINERS file like below. You need post below change as patch and got Rich's ACK. Then people will add you to CC when sending patches related to sh code. Or add yourself as maintainer directly if you have done a lot of work on maintaining, surely need get other sh maintainers' ACK too. Personal suggeestion.
MAINTAINERS +1 -0
@@ -19119,6 +19119,7 @@ F: drivers/watchdog/sunplus_wdt.c SUPERH M: Yoshinori Sato <[email protected]> M: Rich Felker <[email protected]> +R: John Paul Adrian Glaubitz <[email protected]> L: [email protected] S: Maintained Q: http://patchwork.kernel.org/project/linux-sh/list/