All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Fleming <matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
To: Rasmus Villemoes
	<linux-qQsb+v5E8BnlAoU/VqSP6n9LOBIZ5rWg@public.gmane.org>
Cc: linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Peter Jones <pjones-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
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-qQsb+v5E8BnlAoU/VqSP6n9LOBIZ5rWg@public.gmane.org>

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-qQsb+v5E8BnlAoU/VqSP6n9LOBIZ5rWg@public.gmane.org>
> ---
>  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
> 

WARNING: multiple messages have this Message-ID (diff)
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
> 

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

Thread overview: 4+ 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-20 10:30 ` Rasmus Villemoes
     [not found] ` <1448015417-16712-1-git-send-email-linux-qQsb+v5E8BnlAoU/VqSP6n9LOBIZ5rWg@public.gmane.org>
2015-11-26 10:27   ` Matt Fleming [this message]
2015-11-26 10:27     ` Matt Fleming

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-mf/unelci9gs6ibeejttw/xrex20p6io@public.gmane.org \
    --cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-qQsb+v5E8BnlAoU/VqSP6n9LOBIZ5rWg@public.gmane.org \
    --cc=pjones-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.