arch/loongarch/kernel/env.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
From: Peng Fan <peng.fan@nxp.com>
Convert open-coded if/else with set_bit/clear_bit to the assign_bit API.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
arch/loongarch/kernel/env.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/loongarch/kernel/env.c b/arch/loongarch/kernel/env.c
index 652456768b55..c529a14deb18 100644
--- a/arch/loongarch/kernel/env.c
+++ b/arch/loongarch/kernel/env.c
@@ -25,10 +25,7 @@ void __init init_environ(void)
int efi_boot = fw_arg0;
char *cmdline = early_memremap_ro(fw_arg1, COMMAND_LINE_SIZE);
- if (efi_boot)
- set_bit(EFI_BOOT, &efi.flags);
- else
- clear_bit(EFI_BOOT, &efi.flags);
+ assign_bit(EFI_BOOT, &efi.flags, efi_boot);
strscpy(boot_command_line, cmdline, COMMAND_LINE_SIZE);
strscpy(init_command_line, cmdline, COMMAND_LINE_SIZE);
--
2.51.0
Applied, thanks. Huacai On Sun, Sep 20, 2026 at 10:29 AM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote: > > From: Peng Fan <peng.fan@nxp.com> > > Convert open-coded if/else with set_bit/clear_bit to the assign_bit API. > > Signed-off-by: Peng Fan <peng.fan@nxp.com> > --- > arch/loongarch/kernel/env.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/arch/loongarch/kernel/env.c b/arch/loongarch/kernel/env.c > index 652456768b55..c529a14deb18 100644 > --- a/arch/loongarch/kernel/env.c > +++ b/arch/loongarch/kernel/env.c > @@ -25,10 +25,7 @@ void __init init_environ(void) > int efi_boot = fw_arg0; > char *cmdline = early_memremap_ro(fw_arg1, COMMAND_LINE_SIZE); > > - if (efi_boot) > - set_bit(EFI_BOOT, &efi.flags); > - else > - clear_bit(EFI_BOOT, &efi.flags); > + assign_bit(EFI_BOOT, &efi.flags, efi_boot); > > strscpy(boot_command_line, cmdline, COMMAND_LINE_SIZE); > strscpy(init_command_line, cmdline, COMMAND_LINE_SIZE); > -- > 2.51.0 >
© 2016 - 2026 Red Hat, Inc.