Skip to content

Commit

Permalink
HID: hid-lg4ff: Casting (void *) value returned by kmalloc is useless
Browse files Browse the repository at this point in the history
Casting (void *) value returned by kmalloc is useless
as mentioned in Documentation/CodingStyle, Chap 14.

The semantic patch that makes this change is available
in scripts/coccinelle/api/alloc/drop_kmalloc_cast.cocci.

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Thomas Meyer authored and Jiri Kosina committed Nov 11, 2011
1 parent 30307c6 commit 8383c6b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hid/hid-lg4ff.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ int lg4ff_init(struct hid_device *hid)
}

/* Add the device to device_list */
entry = (struct lg4ff_device_entry *)kzalloc(sizeof(struct lg4ff_device_entry), GFP_KERNEL);
entry = kzalloc(sizeof(struct lg4ff_device_entry), GFP_KERNEL);
if (!entry) {
hid_err(hid, "Cannot add device, insufficient memory.\n");
return -ENOMEM;
Expand Down

0 comments on commit 8383c6b

Please sign in to comment.