Skip to content

Commit

Permalink
efi/esrt: Don't preformat name
Browse files Browse the repository at this point in the history
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>
Cc: Peter Jones <pjones@redhat.com>
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
  • Loading branch information
Rasmus Villemoes authored and Matt Fleming committed Dec 14, 2015
1 parent 8005c49 commit 7f83773
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/firmware/efi/esrt.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,22 +167,19 @@ 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) {
int rc = 0;

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

0 comments on commit 7f83773

Please sign in to comment.