efi/esrt: Don't preformat name
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>
This commit is contained in:
parent
8005c49d9a
commit
7f83773ced
|
@ -167,14 +167,11 @@ static struct kset *esrt_kset;
|
||||||
static int esre_create_sysfs_entry(void *esre, int entry_num)
|
static int esre_create_sysfs_entry(void *esre, int entry_num)
|
||||||
{
|
{
|
||||||
struct esre_entry *entry;
|
struct esre_entry *entry;
|
||||||
char name[20];
|
|
||||||
|
|
||||||
entry = kzalloc(sizeof(*entry), GFP_KERNEL);
|
entry = kzalloc(sizeof(*entry), GFP_KERNEL);
|
||||||
if (!entry)
|
if (!entry)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
sprintf(name, "entry%d", entry_num);
|
|
||||||
|
|
||||||
entry->kobj.kset = esrt_kset;
|
entry->kobj.kset = esrt_kset;
|
||||||
|
|
||||||
if (esrt->fw_resource_version == 1) {
|
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;
|
entry->esre.esre1 = esre;
|
||||||
rc = kobject_init_and_add(&entry->kobj, &esre1_ktype, NULL,
|
rc = kobject_init_and_add(&entry->kobj, &esre1_ktype, NULL,
|
||||||
"%s", name);
|
"entry%d", entry_num);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
kfree(entry);
|
kfree(entry);
|
||||||
return rc;
|
return rc;
|
||||||
|
|
Loading…
Reference in New Issue