[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: Simone Ballarin <simone.ballarin@xxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 20 Jun 2023 15:20:49 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3W3Q4/gEpez7UTZK/oBjLPGe8Qea/qB5WAOwzl/epaQ=; b=Tjflp5nFCX5qLfvNPeF9AYkR0nG45lfQrKSP3vv+5+03UXiEOJDCu9AgrJRdKGYP63szkq+0U5M/brGIYMvdXY79euxJkmz64sTFQyNKVoWBKiRv/I5SCVBKeI/QArX+cxkX0tB8D1qy7BpQ2N4XnObrUlYnsyIIF6bKAy0wXEULajPuklkInhcifMaOMu1NUjWf3YLeaAV3FNsvDGhIIjdb7Ovj5fOqEmJQOBCxyekQp03FRjieFFuAoD+5a8JjuUxel+Zcrpfu2KSvRLDaFPtYCV6WrHKQDkcXK8DRdOpPG135Lj8ASNV4MaZkTMJr/u927GvRdgO0B+UROvxXhA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e7ruIj/ePbABAKh7M355D1dDGL4KccwLIVbJgz1qJSoSW5CKa2U4++JAimoR+b3SHnt7/3zm2Elu6YLzrAhYqQVElqfldeW2IIJ9ArRqC4i6ABemtCW9y5V+XEvDFlwbGXEr/O+QHRa4i5YH9upl5aOaPTJGMmOTvRyQqAX7etas/Hprjb5DPgMFIp7Ko7V5RfQ1JKicGZ1JSApqyzDk72BBoFy1eS8Rw9d0V029hQwo0Rz6tdBVuuEYte7QjBWufAj3HYHQOhEFY4LkMB5IagITDRiUGiSDK6UYMjCFJfzNfY9M++dno04gIQoiHpFLOwKoSWevRqNIrISSzGXiRA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • 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:21:09 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.)

> --- 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



 


Rackspace

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