On 12.07.2023 12:32, Simone Ballarin wrote:
> From: Gianluca Luparini <gianluca.lupar...@bugseng.com>
> 
> The xen sources contains violations of MISRA C:2012 Rule 7.2 whose
> headline states:
> "A 'u' or 'U' suffix shall be applied to all integer constants
> that are represented in an unsigned type".
> 
> Add the 'U' suffix to integers literals with unsigned type.
> 
> Fot the sake of uniformity, the following changes are made:
> - add the 'U' suffix to all integer constants before the
>   '?' operator in 'bitops.h'
> 
> Signed-off-by: Gianluca Luparini <gianluca.lupar...@bugseng.com>
> Signed-off-by: Simone Ballarin <simone.balla...@bugseng.com>
> Reviewed-by: Stefano Stabellini <sstabell...@kernel.org>

Acked-by: Jan Beulich <jbeul...@suse.com>
with ...

> --- a/xen/lib/muldiv64.c
> +++ b/xen/lib/muldiv64.c
> @@ -27,7 +27,7 @@ uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c)
>      rh = (uint64_t)u.l.high * (uint64_t)b;
>      rh += (rl >> 32);
>      res.l.high = rh / c;
> -    res.l.low = (((rh % c) << 32) + (rl & 0xffffffff)) / c;
> +    res.l.low = (((rh % c) << 32) + ((uint32_t)rl)) / c;

... the excess pair of parentheses here dropped (which I'll do while
committing).

Jan

Reply via email to