linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sh: kdump: add some attribute to function
@ 2020-12-10  6:49 Yejune Deng
  2021-01-18 19:59 ` John Paul Adrian Glaubitz
  0 siblings, 1 reply; 2+ messages in thread
From: Yejune Deng @ 2020-12-10  6:49 UTC (permalink / raw)
  To: ysato, dalias; +Cc: yejune.deng, linux-sh, linux-kernel

add '__iomem' for ioremap() and '__user' for copy_to_user().

Signed-off-by: Yejune Deng <yejune.deng@gmail.com>
---
 arch/sh/kernel/crash_dump.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/sh/kernel/crash_dump.c b/arch/sh/kernel/crash_dump.c
index a908612..5b41b59 100644
--- a/arch/sh/kernel/crash_dump.c
+++ b/arch/sh/kernel/crash_dump.c
@@ -26,7 +26,7 @@
 ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
                                size_t csize, unsigned long offset, int userbuf)
 {
-	void  *vaddr;
+	void  __iomem *vaddr;
 
 	if (!csize)
 		return 0;
@@ -34,7 +34,7 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
 	vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE);
 
 	if (userbuf) {
-		if (copy_to_user(buf, (vaddr + offset), csize)) {
+		if (copy_to_user((void __user *)buf, (vaddr + offset), csize)) {
 			iounmap(vaddr);
 			return -EFAULT;
 		}
-- 
1.9.1


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

* Re: [PATCH] sh: kdump: add some attribute to function
  2020-12-10  6:49 [PATCH] sh: kdump: add some attribute to function Yejune Deng
@ 2021-01-18 19:59 ` John Paul Adrian Glaubitz
  0 siblings, 0 replies; 2+ messages in thread
From: John Paul Adrian Glaubitz @ 2021-01-18 19:59 UTC (permalink / raw)
  To: Yejune Deng, ysato, dalias; +Cc: linux-sh, linux-kernel

On 12/10/20 7:49 AM, Yejune Deng wrote:
> add '__iomem' for ioremap() and '__user' for copy_to_user().
> 
> Signed-off-by: Yejune Deng <yejune.deng@gmail.com>
> ---
>  arch/sh/kernel/crash_dump.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/sh/kernel/crash_dump.c b/arch/sh/kernel/crash_dump.c
> index a908612..5b41b59 100644
> --- a/arch/sh/kernel/crash_dump.c
> +++ b/arch/sh/kernel/crash_dump.c
> @@ -26,7 +26,7 @@
>  ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
>                                 size_t csize, unsigned long offset, int userbuf)
>  {
> -	void  *vaddr;
> +	void  __iomem *vaddr;
>  
>  	if (!csize)
>  		return 0;
> @@ -34,7 +34,7 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
>  	vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE);
>  
>  	if (userbuf) {
> -		if (copy_to_user(buf, (vaddr + offset), csize)) {
> +		if (copy_to_user((void __user *)buf, (vaddr + offset), csize)) {
>  			iounmap(vaddr);
>  			return -EFAULT;
>  		}

Successfully boot-tested on my SH-7785LCR. No regressions.

Tested-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@debian.org
`. `'   Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913


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

end of thread, other threads:[~2021-01-18 20:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-10  6:49 [PATCH] sh: kdump: add some attribute to function Yejune Deng
2021-01-18 19:59 ` John Paul Adrian Glaubitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).