All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sh: cast away __iomem to remove sparse warning
@ 2022-05-07  1:34 Baoquan He
  2022-05-30 12:09 ` Baoquan He
  0 siblings, 1 reply; 6+ messages in thread
From: Baoquan He @ 2022-05-07  1:34 UTC (permalink / raw)
  To: ysato, dalias; +Cc: linux-sh, bhe, linux-kernel, kernel test robot

LKP reported a sparse warning in arch/sh/kernel/crash_dump.c during
a kdump patchset reviewing:
https://lore.kernel.org/all/202204082128.JKXXDGpa-lkp@intel.com/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.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Baoquan He <bhe@redhat.com>
---
 arch/sh/kernel/crash_dump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/sh/kernel/crash_dump.c b/arch/sh/kernel/crash_dump.c
index 19ce6a950aac..52d1d54eb6b1 100644
--- a/arch/sh/kernel/crash_dump.c
+++ b/arch/sh/kernel/crash_dump.c
@@ -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;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] sh: cast away __iomem to remove sparse warning
  2022-05-07  1:34 [PATCH] sh: cast away __iomem to remove sparse warning Baoquan He
@ 2022-05-30 12:09 ` Baoquan He
  2022-06-07 22:56   ` Rob Landley
  0 siblings, 1 reply; 6+ messages in thread
From: Baoquan He @ 2022-05-30 12:09 UTC (permalink / raw)
  To: ysato, dalias; +Cc: linux-sh, linux-kernel, kernel test robot

Hi,

On 05/07/22 at 09:34am, Baoquan He wrote:
> LKP reported a sparse warning in arch/sh/kernel/crash_dump.c during
> a kdump patchset reviewing:
> https://lore.kernel.org/all/202204082128.JKXXDGpa-lkp@intel.com/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.

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/20220408090636.560886-2-bhe@redhat.com/T/#u

Now the above patchset has been merged into linus's tree, please
consider taking this patch.

Thanks
Baoquan

> 
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Baoquan He <bhe@redhat.com>
> ---
>  arch/sh/kernel/crash_dump.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/sh/kernel/crash_dump.c b/arch/sh/kernel/crash_dump.c
> index 19ce6a950aac..52d1d54eb6b1 100644
> --- a/arch/sh/kernel/crash_dump.c
> +++ b/arch/sh/kernel/crash_dump.c
> @@ -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;
> -- 
> 2.34.1
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] sh: cast away __iomem to remove sparse warning
  2022-05-30 12:09 ` Baoquan He
@ 2022-06-07 22:56   ` Rob Landley
  2022-06-08  1:11     ` Baoquan He
  0 siblings, 1 reply; 6+ messages in thread
From: Rob Landley @ 2022-06-07 22:56 UTC (permalink / raw)
  To: Baoquan He, ysato, dalias; +Cc: linux-sh, linux-kernel, kernel test robot



On 5/30/22 07:09, Baoquan He wrote:
> Hi,
> 
> On 05/07/22 at 09:34am, Baoquan He wrote:
>> LKP reported a sparse warning in arch/sh/kernel/crash_dump.c during
>> a kdump patchset reviewing:
>> https://lore.kernel.org/all/202204082128.JKXXDGpa-lkp@intel.com/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.
> 
> 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/20220408090636.560886-2-bhe@redhat.com/T/#u
> 
> Now the above patchset has been merged into linus's tree, please
> consider taking this patch.
> 
> Thanks
> Baoquan
> 
>> 
>> Reported-by: kernel test robot <lkp@intel.com>
>> Signed-off-by: Baoquan He <bhe@redhat.com>

Tested-by: Rob Landley <rob@landley.net>

Rob

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] sh: cast away __iomem to remove sparse warning
  2022-06-07 22:56   ` Rob Landley
@ 2022-06-08  1:11     ` Baoquan He
  2022-06-08  7:05       ` John Paul Adrian Glaubitz
  0 siblings, 1 reply; 6+ messages in thread
From: Baoquan He @ 2022-06-08  1:11 UTC (permalink / raw)
  To: Rob Landley, akpm
  Cc: ysato, dalias, linux-sh, linux-kernel, kernel test robot

On 06/07/22 at 05:56pm, Rob Landley wrote:
> 
> 
> On 5/30/22 07:09, Baoquan He wrote:
> > Hi,
> > 
> > On 05/07/22 at 09:34am, Baoquan He wrote:
> >> LKP reported a sparse warning in arch/sh/kernel/crash_dump.c during
> >> a kdump patchset reviewing:
> >> https://lore.kernel.org/all/202204082128.JKXXDGpa-lkp@intel.com/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.
> > 
> > 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/20220408090636.560886-2-bhe@redhat.com/T/#u
> > 
> > Now the above patchset has been merged into linus's tree, please
> > consider taking this patch.
...... 
> Tested-by: Rob Landley <rob@landley.net>

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] sh: cast away __iomem to remove sparse warning
  2022-06-08  1:11     ` Baoquan He
@ 2022-06-08  7:05       ` John Paul Adrian Glaubitz
  2022-06-08  7:52         ` Baoquan He
  0 siblings, 1 reply; 6+ messages in thread
From: John Paul Adrian Glaubitz @ 2022-06-08  7:05 UTC (permalink / raw)
  To: Baoquan He, Rob Landley, akpm
  Cc: ysato, dalias, linux-sh, linux-kernel, kernel test robot

Hi!

On 6/8/22 03:11, Baoquan He wrote:
> 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

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] sh: cast away __iomem to remove sparse warning
  2022-06-08  7:05       ` John Paul Adrian Glaubitz
@ 2022-06-08  7:52         ` Baoquan He
  0 siblings, 0 replies; 6+ messages in thread
From: Baoquan He @ 2022-06-08  7:52 UTC (permalink / raw)
  To: John Paul Adrian Glaubitz
  Cc: Rob Landley, akpm, ysato, dalias, linux-sh, linux-kernel,
	kernel test robot

On 06/08/22 at 09:05am, John Paul Adrian Glaubitz wrote:
> Hi!
> 
> On 6/8/22 03:11, Baoquan He wrote:
> > 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.

diff --git a/MAINTAINERS b/MAINTAINERS
index a6d3bd9d2a8d..0e7ce3540eb7 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -19119,6 +19119,7 @@ F:	drivers/watchdog/sunplus_wdt.c
 SUPERH
 M:	Yoshinori Sato <ysato@users.sourceforge.jp>
 M:	Rich Felker <dalias@libc.org>
+R:	John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
 L:	linux-sh@vger.kernel.org
 S:	Maintained
 Q:	http://patchwork.kernel.org/project/linux-sh/list/


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-06-08  8:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-07  1:34 [PATCH] sh: cast away __iomem to remove sparse warning Baoquan He
2022-05-30 12:09 ` Baoquan He
2022-06-07 22:56   ` Rob Landley
2022-06-08  1:11     ` Baoquan He
2022-06-08  7:05       ` John Paul Adrian Glaubitz
2022-06-08  7:52         ` Baoquan He

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.