HID: hid-lg4ff: Casting (void *) value returned by kmalloc is useless
authorThomas Meyer <thomas@m3y3r.de>
Tue, 8 Nov 2011 19:14:14 +0000 (20:14 +0100)
committerJiri Kosina <jkosina@suse.cz>
Fri, 11 Nov 2011 14:09:29 +0000 (15:09 +0100)
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>
drivers/hid/hid-lg4ff.c

index 103f30d93f76adb154518f5656bba6bbd98e24e5..6ecc9e2204409c1451e90086a4edd7f0639cdb01 100644 (file)
@@ -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;