linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: Use kstrdup to simplify code
@ 2015-07-08 19:32 Christophe JAILLET
  2015-07-08 19:53 ` Emmanuel Grumbach
  2015-07-08 20:22 ` [PATCH v2] brcmsmac: " Christophe JAILLET
  0 siblings, 2 replies; 5+ messages in thread
From: Christophe JAILLET @ 2015-07-08 19:32 UTC (permalink / raw)
  To: kvalo, brudley, arend, frankyl, meuleman
  Cc: linux-wireless, brcm80211-dev-list, netdev, linux-kernel,
	kernel-janitors, Christophe JAILLET

Replace a kmalloc+strcpy by an equivalent kstrdup in order to improve
readability.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
index 4813506..8a6c077 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
@@ -1476,9 +1476,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;
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-07-21 14:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-08 19:32 [PATCH] mac80211: Use kstrdup to simplify code Christophe JAILLET
2015-07-08 19:53 ` Emmanuel Grumbach
2015-07-08 20:22 ` [PATCH v2] brcmsmac: " Christophe JAILLET
2015-07-09 18:36   ` Arend van Spriel
2015-07-21 14:59   ` [v2] " Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).