* [PATCH v2] brcmsmac: Use kstrdup to simplify code
@ 2015-07-08 20:22 ` Christophe JAILLET
0 siblings, 0 replies; 12+ messages in thread
From: Christophe JAILLET @ 2015-07-08 20:22 UTC (permalink / raw)
To: kvalo-sgV2jX0FEOL9JmXXK+q4OQ, brudley-dY08KVG/lbpWk0Htik3J/w,
arend-dY08KVG/lbpWk0Htik3J/w, frankyl-dY08KVG/lbpWk0Htik3J/w,
meuleman-dY08KVG/lbpWk0Htik3J/w
Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
brcm80211-dev-list-dY08KVG/lbpWk0Htik3J/w,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
kernel-janitors-u79uwXL29TY76Z2rM5mHXA, Christophe JAILLET
Replace a kmalloc+strcpy by an equivalent kstrdup in order to improve
readability.
Signed-off-by: Christophe JAILLET <christophe.jaillet-39ZsbGIQGT5GWvitb5QawA@public.gmane.org>
---
v2: fix the subject
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
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2] brcmsmac: Use kstrdup to simplify code
@ 2015-07-08 20:22 ` Christophe JAILLET
0 siblings, 0 replies; 12+ messages in thread
From: Christophe JAILLET @ 2015-07-08 20:22 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>
---
v2: fix the subject
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] 12+ messages in thread
* Re: [PATCH v2] brcmsmac: Use kstrdup to simplify code
2015-07-08 20:22 ` Christophe JAILLET
@ 2015-07-09 18:36 ` Arend van Spriel
-1 siblings, 0 replies; 12+ messages in thread
From: Arend van Spriel @ 2015-07-09 18:36 UTC (permalink / raw)
To: Christophe JAILLET, kvalo, brudley, frankyl, meuleman
Cc: linux-wireless, brcm80211-dev-list, netdev, linux-kernel,
kernel-janitors
On 07/08/2015 10:22 PM, Christophe JAILLET wrote:
> Replace a kmalloc+strcpy by an equivalent kstrdup in order to improve
> readability.
Not sure if readability is really the issue here. At most it is a small
reduction of driver code by using kstrdup(). Anyway, the patch looks fine so
Acked-by: Arend van Spriel <arend@broadcom.com>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> v2: fix the subject
>
> 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;
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2] brcmsmac: Use kstrdup to simplify code
@ 2015-07-09 18:36 ` Arend van Spriel
0 siblings, 0 replies; 12+ messages in thread
From: Arend van Spriel @ 2015-07-09 18:36 UTC (permalink / raw)
To: Christophe JAILLET, kvalo, brudley, frankyl, meuleman
Cc: linux-wireless, brcm80211-dev-list, netdev, linux-kernel,
kernel-janitors
On 07/08/2015 10:22 PM, Christophe JAILLET wrote:
> Replace a kmalloc+strcpy by an equivalent kstrdup in order to improve
> readability.
Not sure if readability is really the issue here. At most it is a small
reduction of driver code by using kstrdup(). Anyway, the patch looks fine so
Acked-by: Arend van Spriel <arend@broadcom.com>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> v2: fix the subject
>
> 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;
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [v2] brcmsmac: Use kstrdup to simplify code
2015-07-08 20:22 ` Christophe JAILLET
(?)
@ 2015-07-21 14:59 ` Kalle Valo
-1 siblings, 0 replies; 12+ messages in thread
From: Kalle Valo @ 2015-07-21 14:59 UTC (permalink / raw)
To: Christophe Jaillet
Cc: brudley, arend, frankyl, meuleman, linux-wireless,
brcm80211-dev-list, netdev, linux-kernel, kernel-janitors
> 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>
Thanks, applied to wireless-drivers-next.git.
Kalle Valo
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [v2] brcmsmac: Use kstrdup to simplify code
@ 2015-07-21 14:59 ` Kalle Valo
0 siblings, 0 replies; 12+ messages in thread
From: Kalle Valo @ 2015-07-21 14:59 UTC (permalink / raw)
To: Christophe Jaillet
Cc: brudley-dY08KVG/lbpWk0Htik3J/w, arend-dY08KVG/lbpWk0Htik3J/w,
frankyl-dY08KVG/lbpWk0Htik3J/w, meuleman-dY08KVG/lbpWk0Htik3J/w,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
brcm80211-dev-list-dY08KVG/lbpWk0Htik3J/w,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
kernel-janitors-u79uwXL29TY76Z2rM5mHXA, Christophe JAILLET
> Replace a kmalloc+strcpy by an equivalent kstrdup in order to improve
> readability.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet-39ZsbGIQGT5GWvitb5QawA@public.gmane.org>
> Acked-by: Arend van Spriel <arend-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
Thanks, applied to wireless-drivers-next.git.
Kalle Valo
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [v2] brcmsmac: Use kstrdup to simplify code
@ 2015-07-21 14:59 ` Kalle Valo
0 siblings, 0 replies; 12+ messages in thread
From: Kalle Valo @ 2015-07-21 14:59 UTC (permalink / raw)
To: Christophe Jaillet
Cc: brudley, arend, frankyl, meuleman, 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>
> Acked-by: Arend van Spriel <arend@broadcom.com>
Thanks, applied to wireless-drivers-next.git.
Kalle Valo
^ permalink raw reply [flat|nested] 12+ messages in thread