public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Matt Fleming <matt@codeblueprint.co.uk>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Peter Jones <pjones@redhat.com>
Subject: Re: [PATCH] efi/esrt: don't preformat name
Date: Thu, 26 Nov 2015 10:27:08 +0000	[thread overview]
Message-ID: <20151126102708.GE2765@codeblueprint.co.uk> (raw)
In-Reply-To: <1448015417-16712-1-git-send-email-linux@rasmusvillemoes.dk>

On Fri, 20 Nov, at 11:30:17AM, Rasmus Villemoes wrote:
> kobject_init_and_add takes a format string+args, so there's no reason
> to do this formatting in advance.
> 
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> ---
>  drivers/firmware/efi/esrt.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
 
Looks good to me. Thanks applied!

> diff --git a/drivers/firmware/efi/esrt.c b/drivers/firmware/efi/esrt.c
> index 22c5285f7705..75feb3f5829b 100644
> --- a/drivers/firmware/efi/esrt.c
> +++ b/drivers/firmware/efi/esrt.c
> @@ -167,14 +167,11 @@ static struct kset *esrt_kset;
>  static int esre_create_sysfs_entry(void *esre, int entry_num)
>  {
>  	struct esre_entry *entry;
> -	char name[20];
>  
>  	entry = kzalloc(sizeof(*entry), GFP_KERNEL);
>  	if (!entry)
>  		return -ENOMEM;
>  
> -	sprintf(name, "entry%d", entry_num);
> -
>  	entry->kobj.kset = esrt_kset;
>  
>  	if (esrt->fw_resource_version == 1) {
> @@ -182,7 +179,7 @@ static int esre_create_sysfs_entry(void *esre, int entry_num)
>  
>  		entry->esre.esre1 = esre;
>  		rc = kobject_init_and_add(&entry->kobj, &esre1_ktype, NULL,
> -					  "%s", name);
> +					  "entry%d", entry_num);
>  		if (rc) {
>  			kfree(entry);
>  			return rc;
> -- 
> 2.6.1
> 

      reply	other threads:[~2015-11-26 10:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-20 10:30 [PATCH] efi/esrt: don't preformat name Rasmus Villemoes
2015-11-26 10:27 ` Matt Fleming [this message]

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=20151126102708.GE2765@codeblueprint.co.uk \
    --to=matt@codeblueprint.co.uk \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=pjones@redhat.com \
    /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