staging: wlan-ng: Replace data type declaration with variable of same type in prism2sta.c
authorSergio Paracuellos <sergio.paracuellos@gmail.com>
Mon, 10 Oct 2016 14:02:22 +0000 (16:02 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Oct 2016 08:26:24 +0000 (10:26 +0200)
sizeof(*var) instead of sizeof(struct XXX) is preferred.
Fix them in prism2sta.c file.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wlan-ng/prism2sta.c

index b3ae2bb9ae42d37f03a6204ede21fad9384d0731..351f08d6a5d94553cc7f62afd0df7c9d8e0800a6 100644 (file)
@@ -1102,8 +1102,7 @@ static void prism2sta_inf_hostscanresults(struct wlandevice *wlandev,
 
        kfree(hw->scanresults);
 
-       hw->scanresults = kmemdup(inf, sizeof(struct hfa384x_inf_frame),
-                                 GFP_ATOMIC);
+       hw->scanresults = kmemdup(inf, sizeof(*inf), GFP_ATOMIC);
 
        if (nbss == 0)
                nbss = -1;
@@ -1888,8 +1887,8 @@ static struct wlandevice *create_wlan(void)
        struct hfa384x *hw = NULL;
 
        /* Alloc our structures */
-       wlandev = kzalloc(sizeof(struct wlandevice), GFP_KERNEL);
-       hw = kzalloc(sizeof(struct hfa384x), GFP_KERNEL);
+       wlandev = kzalloc(sizeof(*wlandev), GFP_KERNEL);
+       hw = kzalloc(sizeof(*hw), GFP_KERNEL);
 
        if (!wlandev || !hw) {
                kfree(wlandev);