On 21.11.2023 21:15, Andrew Cooper wrote:
> -Wwrite-strings is unhappy with assigning "xen" to a mutable pointer, but all
> this work is useless; it's making a memory allocation just to prepend the
> image name which cmdline_cook() intentionally strips back out.
> 
> Simply forgo the work and identify EFI_LOADER as one of the loaders which
> doesn't prepend the image name.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com>

Reviewed-by: Jan Beulich <jbeul...@suse.com>
with one nit:

> --- a/xen/arch/x86/setup.c
> +++ b/xen/arch/x86/setup.c
> @@ -850,8 +850,11 @@ static const char *__init cmdline_cook(const char *p, 
> const char *loader_name)
>      while ( *p == ' ' )
>          p++;
>  
> -    /* GRUB2 and PVH don't not include image name as first item on command 
> line. */
> -    if ( xen_guest || loader_is_grub2(loader_name) )
> +    /*
> +     * PVH, our EFI loader, and GRUB2 don't not include image name as first

Just "don't", or "do not"? (I realize it was this way before, but perhaps a
good chance to tidy.)

Jan

> +     * item on command line.
> +     */
> +    if ( xen_guest || efi_enabled(EFI_LOADER) || 
> loader_is_grub2(loader_name) )
>          return p;
>  
>      /* Strip image name plus whitespace. */


Reply via email to