public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH linux-next] ia64: Replace IS_ERR() with IS_ERR_VALUE()
@ 2022-10-20 11:30 yexingchen116
  2022-10-20 18:56 ` Sergei Trofimovich
  0 siblings, 1 reply; 2+ messages in thread
From: yexingchen116 @ 2022-10-20 11:30 UTC (permalink / raw)
  To: akpm; +Cc: slyich, linux-ia64, linux-kernel, ye xingchen

From: ye xingchen <ye.xingchen@zte.com.cn>

Avoid type casts that are needed for IS_ERR() and use
IS_ERR_VALUE() instead.

Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
---
 arch/ia64/kernel/sys_ia64.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/ia64/kernel/sys_ia64.c b/arch/ia64/kernel/sys_ia64.c
index 215bf3f8cb20..f6a502e8f02c 100644
--- a/arch/ia64/kernel/sys_ia64.c
+++ b/arch/ia64/kernel/sys_ia64.c
@@ -140,7 +140,7 @@ asmlinkage unsigned long
 sys_mmap2 (unsigned long addr, unsigned long len, int prot, int flags, int fd, long pgoff)
 {
 	addr = ksys_mmap_pgoff(addr, len, prot, flags, fd, pgoff);
-	if (!IS_ERR((void *) addr))
+	if (!IS_ERR_VALUE(addr))
 		force_successful_syscall_return();
 	return addr;
 }
@@ -152,7 +152,7 @@ sys_mmap (unsigned long addr, unsigned long len, int prot, int flags, int fd, lo
 		return -EINVAL;
 
 	addr = ksys_mmap_pgoff(addr, len, prot, flags, fd, off >> PAGE_SHIFT);
-	if (!IS_ERR((void *) addr))
+	if (!IS_ERR_VALUE(addr))
 		force_successful_syscall_return();
 	return addr;
 }
@@ -162,7 +162,7 @@ ia64_mremap (unsigned long addr, unsigned long old_len, unsigned long new_len, u
 	     unsigned long new_addr)
 {
 	addr = sys_mremap(addr, old_len, new_len, flags, new_addr);
-	if (!IS_ERR((void *) addr))
+	if (!IS_ERR_VALUE(addr))
 		force_successful_syscall_return();
 	return addr;
 }
-- 
2.25.1


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

* Re: [PATCH linux-next] ia64: Replace IS_ERR() with IS_ERR_VALUE()
  2022-10-20 11:30 [PATCH linux-next] ia64: Replace IS_ERR() with IS_ERR_VALUE() yexingchen116
@ 2022-10-20 18:56 ` Sergei Trofimovich
  0 siblings, 0 replies; 2+ messages in thread
From: Sergei Trofimovich @ 2022-10-20 18:56 UTC (permalink / raw)
  To: yexingchen116; +Cc: akpm, linux-ia64, linux-kernel, ye xingchen

On Thu, 20 Oct 2022 11:30:04 +0000
yexingchen116@gmail.com wrote:

> From: ye xingchen <ye.xingchen@zte.com.cn>
> 
> Avoid type casts that are needed for IS_ERR() and use
> IS_ERR_VALUE() instead.

Looks good to me!

Signed-off-by: Sergei Trofimovich <slyich@gmail.com>

> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
> ---
>  arch/ia64/kernel/sys_ia64.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/ia64/kernel/sys_ia64.c b/arch/ia64/kernel/sys_ia64.c
> index 215bf3f8cb20..f6a502e8f02c 100644
> --- a/arch/ia64/kernel/sys_ia64.c
> +++ b/arch/ia64/kernel/sys_ia64.c
> @@ -140,7 +140,7 @@ asmlinkage unsigned long
>  sys_mmap2 (unsigned long addr, unsigned long len, int prot, int flags, int fd, long pgoff)
>  {
>  	addr = ksys_mmap_pgoff(addr, len, prot, flags, fd, pgoff);
> -	if (!IS_ERR((void *) addr))
> +	if (!IS_ERR_VALUE(addr))
>  		force_successful_syscall_return();
>  	return addr;
>  }
> @@ -152,7 +152,7 @@ sys_mmap (unsigned long addr, unsigned long len, int prot, int flags, int fd, lo
>  		return -EINVAL;
>  
>  	addr = ksys_mmap_pgoff(addr, len, prot, flags, fd, off >> PAGE_SHIFT);
> -	if (!IS_ERR((void *) addr))
> +	if (!IS_ERR_VALUE(addr))
>  		force_successful_syscall_return();
>  	return addr;
>  }
> @@ -162,7 +162,7 @@ ia64_mremap (unsigned long addr, unsigned long old_len, unsigned long new_len, u
>  	     unsigned long new_addr)
>  {
>  	addr = sys_mremap(addr, old_len, new_len, flags, new_addr);
> -	if (!IS_ERR((void *) addr))
> +	if (!IS_ERR_VALUE(addr))
>  		force_successful_syscall_return();
>  	return addr;
>  }
> -- 
> 2.25.1
> 


-- 

  Sergei

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

end of thread, other threads:[~2022-10-20 18:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-20 11:30 [PATCH linux-next] ia64: Replace IS_ERR() with IS_ERR_VALUE() yexingchen116
2022-10-20 18:56 ` Sergei Trofimovich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox