[PATCH v2 1/2] scsi: ipr: Use vmalloc_array to simplify code

Qianfeng Rong
2025-08-05T02:26:54Z

Use vmalloc_array() instead of vmalloc() to simplify the functions
ipr_alloc_dump().

Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
---
drivers/scsi/ipr.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index d06b79f03538..4fb5654472d8 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -4281,11 +4281,11 @@ static int ipr_alloc_dump(struct ipr_ioa_cfg *ioa_cfg)
}

if (ioa_cfg->sis64)
- ioa_data = vmalloc(array_size(IPR_FMT3_MAX_NUM_DUMP_PAGES,
- sizeof(__be32 *)));
+ ioa_data = vmalloc_array(IPR_FMT3_MAX_NUM_DUMP_PAGES,
+ sizeof(__be32 *));
else
- ioa_data = vmalloc(array_size(IPR_FMT2_MAX_NUM_DUMP_PAGES,
- sizeof(__be32 *)));
+ ioa_data = vmalloc_array(IPR_FMT2_MAX_NUM_DUMP_PAGES,
+ sizeof(__be32 *));

if (!ioa_data) {
ipr_err("Dump memory allocation failed\n");
--
2.34.1