[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
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Simone Ballarin <simone.ballarin@xxxxxxxxxxx>
- Date: Tue, 20 Jun 2023 15:59:28 +0200
- Cc: consulting@xxxxxxxxxxx, Gianluca Luparini <gianluca.luparini@xxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Xenia Ragiadakou <Xenia.Ragiadakou@xxxxxxx>, Ayan Kumar <ayan.kumar.halder@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Tue, 20 Jun 2023 13:59:50 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
Hi,
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.
--
|