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

Re: [PATCH v3 38/39] xen/riscv: set the guest's XLEN explicitly in hstatus.VSXL



On 2026-11-06 12:59 +0100, Oleksii Kurochko wrote:
> [ ... 33 lines skipped ... ]
> I'd rather not: d->type is an enum, and for those Xen deliberately omits
> the default label, as -Wall enables -Wswitch, which breaks the build
> (-Werror) if one of the enum's values isn't handled. 
I didn't know that, so yes, you're right it's better to keep without default.
> A default label
> would silence exactly that check. MISRA-wise this is covered by the
> R16.4 deviation for switches on enums.
> 
> I'll move the explanation into the switch() itself, though, and mention 
> -Wswitch there, which should make the intent clearer:
> 
> ...
>      case DOMAIN_64BIT:
>          return XLEN_FIELD_64;
> 
>      /*
>       * No default case: -Wswitch then fails the build should a new
>       * domain_type (a 128-bit one, in particular) be added without
>       * updating this mapping.
>       */
More clear, thanks.
> [ ... 44 lines skipped ... ]
> Your suggested rewording looks good to me. I'll take your wording, and 
> name kernel_probe() in the commit message as well, which has the same 
> ambiguity.
Agree, thanks.

-- 
Baptiste Le Duc <baptiste.le-duc@xxxxxxxxxx>



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.