Re: [PATCH 2/3] efi/libstub: remove uneccessary cmdline_size init/check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 12 Oct 2024 at 00:52, Jonathan Marek <jonathan@xxxxxxxx> wrote:
>
> efi_convert_cmdline() always sets cmdline_size to at least 1 on success,
> so both the initialization to 0 and > 0 comparison are unecessary.
>

The intent is to avoid parsing the empty string, so arguably, we
should test for cmdline_size > 1 instead. But if we fix
efi_convert_cmdline() instead, as I proposed in reply to 1/3, I guess
we can drop this patch.


> Signed-off-by: Jonathan Marek <jonathan@xxxxxxxx>
> ---
>  drivers/firmware/efi/libstub/efi-stub.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/firmware/efi/libstub/efi-stub.c b/drivers/firmware/efi/libstub/efi-stub.c
> index 709ae2d41a632..f166614ef8432 100644
> --- a/drivers/firmware/efi/libstub/efi-stub.c
> +++ b/drivers/firmware/efi/libstub/efi-stub.c
> @@ -112,7 +112,7 @@ static u32 get_supported_rt_services(void)
>
>  efi_status_t efi_handle_cmdline(efi_loaded_image_t *image, char **cmdline_ptr)
>  {
> -       int cmdline_size = 0;
> +       int cmdline_size;
>         efi_status_t status;
>         char *cmdline;
>
> @@ -137,7 +137,7 @@ efi_status_t efi_handle_cmdline(efi_loaded_image_t *image, char **cmdline_ptr)
>                 }
>         }
>
> -       if (!IS_ENABLED(CONFIG_CMDLINE_FORCE) && cmdline_size > 0) {
> +       if (!IS_ENABLED(CONFIG_CMDLINE_FORCE)) {
>                 status = efi_parse_options(cmdline);
>                 if (status != EFI_SUCCESS) {
>                         efi_err("Failed to parse options\n");
> --
> 2.45.1
>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux