[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: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Tue, 20 Jun 2023 19:54:54 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.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=9circiMDxEmemgz5d54tTuPK2WrlvY/vCTY4DFFw1Ac=; b=RI4soxr28P8MgAzZsoiQqN9bYRVCR+w7IC8i+mFQg5PbCWoY9jioPNeE+OMLM9OxqgNDDvJURVouPVWAOCb6kefCLhKdwY2gIYhIr1RNXNJpsFFNjBkCXj6/Zy89JFYrTMSZP1yI8A52oFn7Q812CbrNu21chwnKeHa97KgOfLVl5tVMcM8s4ZC2bid+QJHxAt4UVBmdzmr+TRV0c88miSk7gzEWhKwpOkawM06RQ7c4VbFR165BVowMkalZIZs9r7cuTXtHb75VWKSu018FXpdq5SJWKAvPdgX8KfDC72ShsaViAwDadwLsrW8uQaqsXmisN3eiYtEk2uI/6ZnWVA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kTiNF7aWca5AV8r4NzrLtmuO93N088TxqZl+ibA4jeOe/ogrSNoVJnEtXya8b9/LJsVWnBGR0rXgrF7DfZFhIkZJVA1BxRScXKX4+8UnYDyfH2CPStF1cXyVKsc7m+D5tRcCswUGw10pRsQR4fOYnAHUj4NkNVuTSlXQBpzeiAVuOELmmYjyuDizb3ff2BBlVHS+7SSrc+gf/iATZH533HtSVzuPT1Wze6m/5WR5io+edcuoKwLIPF9aGo1tDVTzTNMfCeyLXPPf3r5Pc0ETf6U/nc3/MYkGb2bEZ8DMlfUAJxYeyZJ8UWgF29XemgfpUHTvAXpV8dJApwmoOE26tA==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, "consulting@xxxxxxxxxxx" <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" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 20 Jun 2023 19:56:07 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZo2ahcQOuFpmGz0i0RQTxkmFbqK+TrUGAgAAKzQCAAGNCAA==
  • Thread-topic: [XEN PATCH 13/13] xen: fixed violations of MISRA C:2012 Rule 7.2


> On 20 Jun 2023, at 14:59, Simone Ballarin <simone.ballarin@xxxxxxxxxxx> wrote:
> 
> 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.

Hi,

I think you can touch this file, yes for sure it was imported from somewhere, 
but
from what I can see it was adopted by Xen and its code style is the Xen 
codestyle.
Furthermore a previous commit, 21a41a6164305bbc66ff1e42ffc11301712f6d65,
had already fixed a MISRA violation.

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