zsmalloc: replace IS_ERR() with IS_ERR_VALUE()

Message ID 20221104023818.1728-1-wangdeming@inspur.com
State New
Headers
Series zsmalloc: replace IS_ERR() with IS_ERR_VALUE() |

Commit Message

Deming Wang Nov. 4, 2022, 2:38 a.m. UTC
  Avoid typecasts that are needed for IS_ERR() and use IS_ERR_VALUE()
instead.

Signed-off-by: Deming Wang <wangdeming@inspur.com>
---
 mm/zsmalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Sergey Senozhatsky Nov. 4, 2022, 3:11 a.m. UTC | #1
On (22/11/03 22:38), Deming Wang wrote:
> Avoid typecasts that are needed for IS_ERR() and use IS_ERR_VALUE()
> instead.
> 
> Signed-off-by: Deming Wang <wangdeming@inspur.com>

Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
  

Patch

diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index a40c548520d3..1322f3615067 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -379,7 +379,7 @@  static int zs_zpool_malloc(void *pool, size_t size, gfp_t gfp,
 {
 	*handle = zs_malloc(pool, size, gfp);
 
-	if (IS_ERR((void *)(*handle)))
+	if (IS_ERR_VALUE(*handle))
 		return PTR_ERR((void *)*handle);
 	return 0;
 }