On 02.09.2019 14:14, Andrew Cooper wrote:
> --- a/xen/arch/x86/acpi/power.c
> +++ b/xen/arch/x86/acpi/power.c
> @@ -33,8 +33,32 @@
>  
>  uint32_t system_reset_counter = 1;
>  
> -static char __initdata opt_acpi_sleep[20];
> -string_param("acpi_sleep", opt_acpi_sleep);
> +static int __init parse_acpi_sleep(const char *s)
> +{
> +    const char *ss;
> +    unsigned int flag = 0;
> +    int rc = 0;
> +
> +    do {
> +        ss = strchr(s, ',');
> +        if ( !ss )
> +            ss = strchr(s, '\0');
> +
> +        if ( !cmdline_strcmp(s, "s3_bios") )
> +            flag |= 1;
> +        else if ( !cmdline_strcmp(s, "s3_mode") )
> +            flag |= 2;

You didn't fancy using parse_boolean() here (to also allow
specifying the negative forms), did you?

> +        else
> +            rc = -EINVAL;
> +
> +        s = ss + 1;
> +    } while ( *ss );
> +
> +    acpi_video_flags = flag;

This wants to be |= , such that "acpi_sleep=s3_bios acpi_sleep=s3_mode"
has the same effect as "acpi_sleep=s3_mode,s3_bios". With at least this
adjustment
Reviewed-by: Jan Beulich <[email protected]>

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to