public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Scott Branden <scott.branden@broadcom.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 2/2] bus: arm-ccn: Simplify code
Date: Mon, 28 Aug 2017 20:57:31 +0000	[thread overview]
Message-ID: <9478cd8b-1620-a30d-9f52-1d6f5779bd55@broadcom.com> (raw)
In-Reply-To: <20170827100706.13292-1-christophe.jaillet@wanadoo.fr>

Change looks good.


On 17-08-27 03:07 AM, Christophe JAILLET wrote:
> Use 'devm_kasprintf()' to simplify the code.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Scott Branden <scott.branden@broadcom.com>
> ---
>   drivers/bus/arm-ccn.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/bus/arm-ccn.c b/drivers/bus/arm-ccn.c
> index c0e851a0a3d7..9b6fac98e992 100644
> --- a/drivers/bus/arm-ccn.c
> +++ b/drivers/bus/arm-ccn.c
> @@ -1268,14 +1268,12 @@ static int arm_ccn_pmu_init(struct arm_ccn *ccn)
>   	if (ccn->dt.id = 0) {
>   		name = "ccn";
>   	} else {
> -		int len = snprintf(NULL, 0, "ccn_%d", ccn->dt.id);
> -
> -		name = devm_kzalloc(ccn->dev, len + 1, GFP_KERNEL);
> +		name = devm_kasprintf(ccn->dev, GFP_KERNEL, "ccn_%d",
> +				      ccn->dt.id);
>   		if (!name) {
>   			err = -ENOMEM;
>   			goto error_choose_name;
>   		}
> -		snprintf(name, len + 1, "ccn_%d", ccn->dt.id);
>   	}
>   
>   	/* Perf driver registration */


  reply	other threads:[~2017-08-28 20:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-27 10:07 [PATCH 2/2] bus: arm-ccn: Simplify code Christophe JAILLET
2017-08-28 20:57 ` Scott Branden [this message]
2017-08-29  8:50 ` Pawel Moll

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=9478cd8b-1620-a30d-9f52-1d6f5779bd55@broadcom.com \
    --to=scott.branden@broadcom.com \
    --cc=kernel-janitors@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