Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Rasmus Villemoes and committed by
Matt Fleming
7f83773c 8005c49d

+1 -4
+1 -4
drivers/firmware/efi/esrt.c
··· 167 167 static int esre_create_sysfs_entry(void *esre, int entry_num) 168 168 { 169 169 struct esre_entry *entry; 170 - char name[20]; 171 170 172 171 entry = kzalloc(sizeof(*entry), GFP_KERNEL); 173 172 if (!entry) 174 173 return -ENOMEM; 175 - 176 - sprintf(name, "entry%d", entry_num); 177 174 178 175 entry->kobj.kset = esrt_kset; 179 176 ··· 179 182 180 183 entry->esre.esre1 = esre; 181 184 rc = kobject_init_and_add(&entry->kobj, &esre1_ktype, NULL, 182 - "%s", name); 185 + "entry%d", entry_num); 183 186 if (rc) { 184 187 kfree(entry); 185 188 return rc;