Skip to content

Commit 400c6bb

Browse files
cristiccJiri Kosina
authored andcommitted
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 <cristian.ciocaltea@collabora.com> Reviewed-by: Benjamin Tissoires <bentiss@kernel.org> Tested-by: Benjamin Tissoires <bentiss@kernel.org> Signed-off-by: Jiri Kosina <jkosina@suse.com>
1 parent d9812f0 commit 400c6bb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/hid/hid-playstation.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,9 +1531,9 @@ static void dualsense_remove(struct ps_device *ps_dev)
15311531
static int dualsense_reset_leds(struct dualsense *ds)
15321532
{
15331533
struct dualsense_output_report report;
1534-
u8 *buf;
1534+
struct dualsense_output_report_bt *buf;
15351535

1536-
buf = kzalloc(sizeof(struct dualsense_output_report_bt), GFP_KERNEL);
1536+
buf = kzalloc(sizeof(*buf), GFP_KERNEL);
15371537
if (!buf)
15381538
return -ENOMEM;
15391539

0 commit comments

Comments
 (0)