Browse Source

brcmsmac: Use kstrdup to simplify code

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>
Christophe Jaillet 10 years ago
parent
commit
77661208a8
1 changed files with 1 additions and 3 deletions
  1. 1 3
      drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c

+ 1 - 3
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c

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