scsi: qedf: use vzalloc() instead of vmalloc()/memset(0)
Subsystems (2)
PATCH 1/1 scsi: qedf: use vzalloc() instead of vmalloc()/memset(0)
Use vzalloc() instead of vmalloc() and memset(0) to simpify the code.
Signed-off-by Yang Yingliang <[email protected]>
--- drivers/scsi/qedf/qedf_dbg.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/scsi/qedf/qedf_dbg.c +1 -2
@@ -106,11 +106,10 @@ qedf_dbg_info(struct qedf_dbg_ctx *qedf, const char *func, u32 line,int qedf_alloc_grc_dump_buf (u8 **buf,uint32_t len) { - *buf =vmalloc (len); + *buf =vzalloc (len);if (!(*buf))return -ENOMEM ; -memset (*buf,0 , len);return 0 ; }
Signature · 1 line
2.25.1
Quoted 16 lines · Yang Yingliang
Use
vzalloc()instead ofvmalloc()and memset(0) to simpify the code.Signed-off-by Yang Yingliang <[email protected]>--- drivers/scsi/qedf/qedf_dbg.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/scsi/qedf/qedf_dbg.c +0
-0@@ -106,11 +106,10 @@ qedf_dbg_info(struct qedf_dbg_ctx *qedf, const char *func, u32 line,int qedf_alloc_grc_dump_buf (u8 **buf,uint32_t len)
drivers/scsi/qedf/qedf_dbg.c qedf_dbg_info(struct qedf_dbg_ctx *qedf, const char *func, u32 line, · line 115
Quoted 10 lines
drivers/scsi/qedf/qedf_dbg.c +1
-2{ - *buf =vmalloc (len); + *buf =vzalloc (len);if (!(*buf))return -ENOMEM ; -memset (*buf,0 , len);return 0 ; }
Looks Good.
Reviewed-by Himanshu Madhani <[email protected]>
Signature · 1 line
Himanshu Madhani Oracle Linux Engineering
Martin K. Petersen
AppliedYang,
Quoted 1 line
Use
vzalloc()instead ofvmalloc()and memset(0) to simpify the code.
Applied to 5.14/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Martin K. Petersen
AppliedQuoted 2 lines · Yang Yingliang
Use
vzalloc()instead ofvmalloc()and memset(0) to simpify the code.
Applied to 5.14/scsi-queue, thanks!
[1/1] scsi: qedf: use vzalloc() instead of vmalloc()/memset(0)
https://git.kernel.org/mkp/scsi/c/2a38d2a8b4a6
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering