lkml.org 
[lkml]   [2011]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH] HID: hid-lg4ff: Casting (void *) value returned by kmalloc is useless
    From
    Date
    From: Thomas Meyer <thomas@m3y3r.de>

    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.

    More information about semantic patching is available at
    http://coccinelle.lip6.fr/

    Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
    ---

    diff -u -p a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c
    --- a/drivers/hid/hid-lg4ff.c 2011-11-07 19:37:44.816570939 +0100
    +++ b/drivers/hid/hid-lg4ff.c 2011-11-08 09:03:29.394045138 +0100
    @@ -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;



    \
     
     \ /
      Last update: 2011-11-08 20:19    [W:7.049 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site