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

Re: [XEN PATCH 13/13] xen: fixed violations of MISRA C:2012 Rule 7.2



Hi,

Il giorno mar 20 giu 2023 alle ore 15:20 Jan Beulich <jbeulich@xxxxxxxx> ha scritto:
On 20.06.2023 12:35, Simone Ballarin wrote:
> --- a/xen/common/gunzip.c
> +++ b/xen/common/gunzip.c
> @@ -11,7 +11,7 @@ static unsigned char *__initdata window;
>  static memptr __initdata free_mem_ptr;
>  static memptr __initdata free_mem_end_ptr;

> -#define WSIZE           0x80000000
> +#define WSIZE           0x80000000U

This again is an imported file, which I'm not sure we want to touch like
this. (Then again it's only a single line change.)

This file is not present in exclude-list.json, in any case, I can remove the change.
 

> --- 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) + (rl & 0xffffffffU)) / c;

This might be neater and more consistent with surrounding code if
switched to (uint32_t)rl.

Jan

Ok.

--
Simone Ballarin, M.Sc.

Field Application Engineer, BUGSENG (https://bugseng.com)

 


Rackspace

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