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

Re: [PATCH v2] docs/misra: add rule 2.1 exceptions


  • To: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Henry Wang <Henry.Wang@xxxxxxx>
  • Date: Fri, 29 Sep 2023 08:55:43 +0000
  • Accept-language: zh-CN, 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=pLgX0KY7zC1SRsSG1ebaSn3YYeLI8ocnEIZMZpMUAW0=; b=VnAd0NEHSv5Az+XUfrCLjsGxYBx+AaQhb3DvelYNSIn0uE36fA1EhnOF2KHtcGENtVFm5uqlluoS/5hw9McB4IEcJaPE9PYBY7xNYf/z3p8NyelShVTvinJH6YgQ68QTGTHY8AQl6M/NqjynYXApNNf9/r44+mKBRIEKlfLdqvmYf5OrO8t08X2J9vWPb7D7HDn2Updq0Cv9vEKA2BntVHgtaokgTeaDx/+Fnf5ucx+x31sRVUDmThAA1sBEGSrkEbnjVzFCTSVVEG5thKjNyRWWZ5qezTP0o1qA72kMuOLXrMyfoEWXQxO1IoclODsesJhYhejAKJnvgfEYAkp4kA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iVTrwX00PA+R8HLA9yoctuSxVgiC6K/GEAtpY7CqswdMrCq7JXsZiqVIUUAtalmg5lr/iFvx2keIOY9mk7rAHOcviGFxxbOv9Y+hPaye8flnHpWYOPn6KOtyjqGmTaxH/bYQDgYZOrs2qxDZLi4/6wdENZXEejlbnR34zTYe41I7GP0JsyPze6PLhmuShjy0xQkpBMLL7JpVFIvcbM7SyG3yHK56QeBvN94fJ+uEVwylYesS0UOJhIzBqyWQLU60gK6xV0ydR2bt8RTgd/a9OKuczY/HbqezP7ut86K4o8JEcCarqSY6Dlk3N7v1yGUeZxa/SJb94aQKpLiTzMLYYg==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, "roger.pau@xxxxxxxxxx" <roger.pau@xxxxxxxxxx>, "julien@xxxxxxx" <julien@xxxxxxx>, "george.dunlap@xxxxxxxxxx" <george.dunlap@xxxxxxxxxx>, "nicola.vetrini@xxxxxxxxxxx" <nicola.vetrini@xxxxxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxx>
  • Delivery-date: Fri, 29 Sep 2023 08:56:09 +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: AQHZ1hLNZ0a6rcghx0ulDP6jzcXqzbAwKyuAgAGOFwA=
  • Thread-topic: [PATCH v2] docs/misra: add rule 2.1 exceptions

Hi Stefano,

> On Sep 28, 2023, at 17:10, Bertrand Marquis <Bertrand.Marquis@xxxxxxx> wrote:
> 
> Hi Stefano,
> 
>> On 24 Aug 2023, at 00:39, Stefano Stabellini <sstabellini@xxxxxxxxxx> wrote:
>> 
>> From: Stefano Stabellini <stefano.stabellini@xxxxxxx>
>> 
>> During the discussions that led to the acceptance of Rule 2.1, we
>> decided on a few exceptions that were not properly recorded in
>> rules.rst. Add them now.
>> 
>> Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>
>> Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
>> ---
>> Note that safe.json and the codebase are not yet updated with an
>> appropriate tag for BUG, panic and friends.
>> 
>> v2:
>> - fix typo in commit message
>> - use "only referenced from assembly"
>> - use "Deliberate unreachability caused by"
>> - add "See safe.json"
>> - add acked-by (although I also added "See safe.json")
>> ---
>> docs/misra/rules.rst | 13 ++++++++++++-
>> 1 file changed, 12 insertions(+), 1 deletion(-)
>> 
>> diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
>> index 8f0e4d3f25..4f33ed4ba6 100644
>> --- a/docs/misra/rules.rst
>> +++ b/docs/misra/rules.rst
>> @@ -106,7 +106,18 @@ maintainers if you want to suggest a change.
>>   * - `Rule 2.1 
>> <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_02_01_1.c>`_
>>     - Required
>>     - A project shall not contain unreachable code
>> -     -
>> +     - The following are allowed:
>> +         - Invariantly constant conditions, e.g. if(IS_ENABLED(CONFIG_HVM)) 
>> { S; }
>> +         - Switch with a controlling value statically determined not to
>> +           match one or more case statements
>> +         - Functions that are intended to be referenced only from
>> +           assembly code (e.g. 'do_trap_fiq')
>> +         - Deliberate unreachability caused by certain macros/functions,
>> +           e.g. BUG, assert_failed, panic, etc. See safe.json.
> 
> As Julien requested, you should remove this.
> 
> With that handled:
> 
> Acked-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>

With Bertrand’s comments addressed:

Release-acked-by: Henry Wang <Henry.Wang@xxxxxxx>

Kind regards,
Henry


> 
> Cheers
> Bertrand
> 
>> +         - asm-offsets.c, as they are not linked deliberately, because
>> +           they are used to generate definitions for asm modules
>> +         - Declarations without initializer are safe, as they are not
>> +           executed
>> 
>>   * - `Rule 2.6 
>> <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_02_06.c>`_
>>     - Advisory
>> -- 
>> 2.25.1
>> 
> 
> 


 


Rackspace

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