From: Cristian Ciocaltea Date: Tue, 24 Jun 2025 21:56:52 +0000 (+0300) Subject: HID: playstation: Prefer kzalloc(sizeof(*buf)...) X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=400c6bbc7b48a011c18c765cd1fbb396113e2f63;p=users%2Fhch%2Fmisc.git HID: playstation: Prefer kzalloc(sizeof(*buf)...) Use the shorter variant as suggested by checkpatch.pl: CHECK: Prefer kzalloc(sizeof(*buf)...) over kzalloc(sizeof(struct dualsense_output_report_bt)...) This also improves further maintainability. Signed-off-by: Cristian Ciocaltea Reviewed-by: Benjamin Tissoires Tested-by: Benjamin Tissoires Signed-off-by: Jiri Kosina --- diff --git a/drivers/hid/hid-playstation.c b/drivers/hid/hid-playstation.c index 37fc1a74517c..6e3132418f2e 100644 --- a/drivers/hid/hid-playstation.c +++ b/drivers/hid/hid-playstation.c @@ -1531,9 +1531,9 @@ static void dualsense_remove(struct ps_device *ps_dev) static int dualsense_reset_leds(struct dualsense *ds) { struct dualsense_output_report report; - u8 *buf; + struct dualsense_output_report_bt *buf; - buf = kzalloc(sizeof(struct dualsense_output_report_bt), GFP_KERNEL); + buf = kzalloc(sizeof(*buf), GFP_KERNEL); if (!buf) return -ENOMEM;