提交 77661208 编写于 作者: C Christophe Jaillet 提交者: Kalle Valo

brcmsmac: Use kstrdup to simplify code

Replace a kmalloc+strcpy by an equivalent kstrdup in order to improve
readability.
Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: NArend van Spriel <arend@broadcom.com>
Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
上级 251086f5
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册