netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arend van Spriel <arend@broadcom.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	<kvalo@codeaurora.org>, <brudley@broadcom.com>,
	<frankyl@broadcom.com>, <meuleman@broadcom.com>
Cc: <linux-wireless@vger.kernel.org>,
	<brcm80211-dev-list@broadcom.com>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH v2] brcmsmac: Use kstrdup to simplify code
Date: Thu, 9 Jul 2015 20:36:40 +0200	[thread overview]
Message-ID: <559EBF38.70107@broadcom.com> (raw)
In-Reply-To: <1436386966-16148-1-git-send-email-christophe.jaillet@wanadoo.fr>

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;
>

  reply	other threads:[~2015-07-09 18:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-08 19:32 [PATCH] mac80211: Use kstrdup to simplify code Christophe JAILLET
2015-07-08 19:53 ` Emmanuel Grumbach
     [not found] ` <1436383927-14010-1-git-send-email-christophe.jaillet-39ZsbGIQGT5GWvitb5QawA@public.gmane.org>
2015-07-08 20:22   ` [PATCH v2] brcmsmac: " Christophe JAILLET
2015-07-09 18:36     ` Arend van Spriel [this message]
     [not found]     ` <1436386966-16148-1-git-send-email-christophe.jaillet-39ZsbGIQGT5GWvitb5QawA@public.gmane.org>
2015-07-21 14:59       ` [v2] " Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=559EBF38.70107@broadcom.com \
    --to=arend@broadcom.com \
    --cc=brcm80211-dev-list@broadcom.com \
    --cc=brudley@broadcom.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=frankyl@broadcom.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=meuleman@broadcom.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).