[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201112151320.e0153ace2f2eb5b59eabbdcb@linux-foundation.org>
Date: Thu, 12 Nov 2020 15:13:20 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Nathan Chancellor <natechancellor@...il.com>
Cc: mcroce@...ux.microsoft.com, arnd@...db.de, keescook@...omium.org,
linux-kernel@...r.kernel.org, linux@...ck-us.net,
pasha.tatashin@...een.com, pmladek@...e.com, rppt@...nel.org,
tyhicks@...ux.microsoft.com, ndesaulniers@...gle.com,
clang-built-linux@...glegroups.com
Subject: Re: [PATCH] reboot: Fix variable assignments in type_store
On Wed, 11 Nov 2020 20:50:23 -0700 Nathan Chancellor <natechancellor@...il.com> wrote:
> Clang warns:
>
> kernel/reboot.c:707:17: warning: implicit conversion from enumeration
> type 'enum reboot_type' to different enumeration type 'enum reboot_mode'
> [-Wenum-conversion]
> reboot_mode = BOOT_TRIPLE;
> ~ ^~~~~~~~~~~
>
> ...
>
> --- a/kernel/reboot.c
> +++ b/kernel/reboot.c
> @@ -704,19 +704,19 @@ static ssize_t type_store(struct kobject *kobj, struct kobj_attribute *attr,
> return -EPERM;
>
> if (!strncmp(buf, BOOT_TRIPLE_STR, strlen(BOOT_TRIPLE_STR)))
> - reboot_mode = BOOT_TRIPLE;
> + reboot_type = BOOT_TRIPLE;
> else if (!strncmp(buf, BOOT_KBD_STR, strlen(BOOT_KBD_STR)))
> - reboot_mode = BOOT_KBD;
> + reboot_type = BOOT_KBD;
> else if (!strncmp(buf, BOOT_BIOS_STR, strlen(BOOT_BIOS_STR)))
> - reboot_mode = BOOT_BIOS;
> + reboot_type = BOOT_BIOS;
> else if (!strncmp(buf, BOOT_ACPI_STR, strlen(BOOT_ACPI_STR)))
> - reboot_mode = BOOT_ACPI;
> + reboot_type = BOOT_ACPI;
> else if (!strncmp(buf, BOOT_EFI_STR, strlen(BOOT_EFI_STR)))
> - reboot_mode = BOOT_EFI;
> + reboot_type = BOOT_EFI;
> else if (!strncmp(buf, BOOT_CF9_FORCE_STR, strlen(BOOT_CF9_FORCE_STR)))
> - reboot_mode = BOOT_CF9_FORCE;
> + reboot_type = BOOT_CF9_FORCE;
> else if (!strncmp(buf, BOOT_CF9_SAFE_STR, strlen(BOOT_CF9_SAFE_STR)))
> - reboot_mode = BOOT_CF9_SAFE;
> + reboot_type = BOOT_CF9_SAFE;
> else
> return -EINVAL;
This is a fairly dramatic change to the original patch, but it eyeballs
OK.
Matteo, could you please comment? And preferably retest?
Powered by blists - more mailing lists