Skip to content

Commit 2ce507f

Browse files
committed
efivarfs: Drop 'duplicates' bool parameter on efivar_init()
The 'duplicates' bool argument is always true when efivar_init() is called from its only caller so let's just drop it instead. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
1 parent 9ca01c7 commit 2ce507f

3 files changed

Lines changed: 4 additions & 6 deletions

File tree

fs/efivarfs/internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ struct efivar_entry {
3838

3939
int efivar_init(int (*func)(efi_char16_t *, efi_guid_t, unsigned long, void *,
4040
struct list_head *),
41-
void *data, bool duplicates, struct list_head *head);
41+
void *data, struct list_head *head);
4242

4343
int efivar_entry_add(struct efivar_entry *entry, struct list_head *head);
4444
void __efivar_entry_add(struct efivar_entry *entry, struct list_head *head);

fs/efivarfs/super.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ static int efivarfs_fill_super(struct super_block *sb, struct fs_context *fc)
343343
if (err)
344344
return err;
345345

346-
return efivar_init(efivarfs_callback, sb, true, &sfi->efivarfs_list);
346+
return efivar_init(efivarfs_callback, sb, &sfi->efivarfs_list);
347347
}
348348

349349
static int efivarfs_get_tree(struct fs_context *fc)

fs/efivarfs/vars.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,6 @@ static void dup_variable_bug(efi_char16_t *str16, efi_guid_t *vendor_guid,
361361
* efivar_init - build the initial list of EFI variables
362362
* @func: callback function to invoke for every variable
363363
* @data: function-specific data to pass to @func
364-
* @duplicates: error if we encounter duplicates on @head?
365364
* @head: initialised head of variable list
366365
*
367366
* Get every EFI variable from the firmware and invoke @func. @func
@@ -371,7 +370,7 @@ static void dup_variable_bug(efi_char16_t *str16, efi_guid_t *vendor_guid,
371370
*/
372371
int efivar_init(int (*func)(efi_char16_t *, efi_guid_t, unsigned long, void *,
373372
struct list_head *),
374-
void *data, bool duplicates, struct list_head *head)
373+
void *data, struct list_head *head)
375374
{
376375
unsigned long variable_name_size = 512;
377376
efi_char16_t *variable_name;
@@ -414,8 +413,7 @@ int efivar_init(int (*func)(efi_char16_t *, efi_guid_t, unsigned long, void *,
414413
* we'll ever see a different variable name,
415414
* and may end up looping here forever.
416415
*/
417-
if (duplicates &&
418-
variable_is_present(variable_name, &vendor_guid,
416+
if (variable_is_present(variable_name, &vendor_guid,
419417
head)) {
420418
dup_variable_bug(variable_name, &vendor_guid,
421419
variable_name_size);

0 commit comments

Comments
 (0)