From: Thomas Meyer Date: Tue, 8 Nov 2011 19:14:14 +0000 (+0100) Subject: HID: hid-lg4ff: Casting (void *) value returned by kmalloc is useless X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8383c6bf9356cfd7093f7afbf16d2b8b4e1c2772;p=linux-beck.git HID: hid-lg4ff: Casting (void *) value returned by kmalloc is useless 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 Signed-off-by: Jiri Kosina --- diff --git a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c index 103f30d93f76..6ecc9e220440 100644 --- a/drivers/hid/hid-lg4ff.c +++ b/drivers/hid/hid-lg4ff.c @@ -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;