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

Re: [Xen-devel] [PATCH v6 01/12] xen: allow only sizeof(bool) variables for boolean_param()



On 26.02.2020 13:46, Juergen Gross wrote:
> Support of other variable sizes than that of normal bool ones for
> boolean_parameter() don't make sense, so catch any other sized
> variables at build time.

Nit: boolean_param()

> @@ -46,7 +48,8 @@ extern const struct kernel_param __param_start[], 
> __param_end[];
>      __kparam __setup_##_var = \
>          { .name = __setup_str_##_var, \
>            .type = OPT_BOOL, \
> -          .len = sizeof(_var), \
> +          .len = sizeof(_var) + \
> +                 BUILD_BUG_ON_ZERO(sizeof(_var) != sizeof(bool)), \

I was first going to suggest to see about tightening this to
do an actual type check, but I think we have a number of
cases where boolean_param() actually involves int8_t variables,
to allow us to detect whether a command line option was used.
Hence
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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