drivers/net/wireless/hostap: Drop memory allocation cast
authorJulia Lawall <julia@diku.dk>
Tue, 11 May 2010 18:25:56 +0000 (20:25 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 12 May 2010 20:39:07 +0000 (16:39 -0400)
Drop cast on the result of kmalloc and similar functions.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
type T;
@@

- (T *)
  (\(kmalloc\|kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\|
   kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\)(...))
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/hostap/hostap_80211_rx.c
drivers/net/wireless/hostap/hostap_ioctl.c

index 3816df96a663e0f544dcf6a53694d8bcf1c33895..fa592cb6bf9a8f1560fc9f30e8f43d13b3dbdddd 100644 (file)
@@ -354,8 +354,7 @@ static struct hostap_bss_info *__hostap_add_bss(local_info_t *local, u8 *bssid,
                list_del(&bss->list);
                local->num_bss_info--;
        } else {
-               bss = (struct hostap_bss_info *)
-                       kmalloc(sizeof(*bss), GFP_ATOMIC);
+               bss = kmalloc(sizeof(*bss), GFP_ATOMIC);
                if (bss == NULL)
                        return NULL;
        }
index 9419cebca8a582f8d9dab12bc442a67409ddebea..f12a79786fbd868a557af1d1c16f74eb6a7b9c1e 100644 (file)
@@ -3038,8 +3038,7 @@ static int prism2_ioctl_priv_download(local_info_t *local, struct iw_point *p)
            p->length > 1024 || !p->pointer)
                return -EINVAL;
 
-       param = (struct prism2_download_param *)
-               kmalloc(p->length, GFP_KERNEL);
+       param = kmalloc(p->length, GFP_KERNEL);
        if (param == NULL)
                return -ENOMEM;