brcmsmac: Use kstrdup to simplify code
authorChristophe Jaillet <christophe.jaillet@wanadoo.fr>
Wed, 8 Jul 2015 20:22:46 +0000 (22:22 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 21 Jul 2015 14:59:26 +0000 (17:59 +0300)
Replace a kmalloc+strcpy by an equivalent kstrdup in order to improve
readability.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c

index ab775a5d5b331f975c6b4dadb300a0744556d9b1..d2c5747e3ac9233731d70d8ff391fc8791beaebb 100644 (file)
@@ -1472,9 +1472,7 @@ struct brcms_timer *brcms_init_timer(struct brcms_info *wl,
        wl->timers = t;
 
 #ifdef DEBUG
-       t->name = kmalloc(strlen(name) + 1, GFP_ATOMIC);
-       if (t->name)
-               strcpy(t->name, name);
+       t->name = kstrdup(name, GFP_ATOMIC);
 #endif
 
        return t;