Skip to content

Commit

Permalink
brcmsmac: Use kstrdup to simplify code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christophe Jaillet authored and Kalle Valo committed Jul 21, 2015
1 parent 251086f commit 7766120
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7766120

Please sign in to comment.