[PATCH] staging: gpib: switch to kmalloc(sizeof(*status))

From: Andreas Kleinbichler
Date: Fri May 16 2025 - 11:25:56 EST


Fix checkpatch warning:

Prefer kmalloc(sizeof(*status)...) over
kmalloc(sizeof(struct gpib_status_byte)...)

Signed-off-by: Andreas Kleinbichler <andi.kleinbichler@xxxxxxxxx>
---
drivers/staging/gpib/common/gpib_os.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c
index d87025aadccc..0678829ad14f 100644
--- a/drivers/staging/gpib/common/gpib_os.c
+++ b/drivers/staging/gpib/common/gpib_os.c
@@ -198,7 +198,7 @@ int push_status_byte(struct gpib_board *board, struct gpib_status_queue *device,
return retval;
}

- status = kmalloc(sizeof(struct gpib_status_byte), GFP_KERNEL);
+ status = kmalloc(sizeof(*status), GFP_KERNEL);
if (!status)
return -ENOMEM;

--
2.43.0