* [PATCH] staging: gpib: switch to kmalloc(sizeof(*status))
@ 2025-05-16 15:25 Andreas Kleinbichler
0 siblings, 0 replies; only message in thread
From: Andreas Kleinbichler @ 2025-05-16 15:25 UTC (permalink / raw)
To: Dave Penkler, Greg Kroah-Hartman, linux-staging, linux-kernel
Fix checkpatch warning:
Prefer kmalloc(sizeof(*status)...) over
kmalloc(sizeof(struct gpib_status_byte)...)
Signed-off-by: Andreas Kleinbichler <andi.kleinbichler@gmail.com>
---
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2025-05-16 15:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-16 15:25 [PATCH] staging: gpib: switch to kmalloc(sizeof(*status)) Andreas Kleinbichler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox