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

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


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 23 Aug 2023 08:55:58 +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=lXnadGLEX1PVRHhnDnCP4H+Nrv4kKX5YbCgEP1SFTIQ=; b=LdnqrT7VSwMJzAivZ8XL3TpdoXBsKYBDi5ZYjmI4S4BeK19/484FSe7gylIs4N5mKSrdQVg4tPSFtN6C2L2ZMSxwUpLDO/li+rxyyC9AtcMarN+RacSKZBhgq9lYM5icIXNOjfgEC4osvfpjRbSDH42t8u25v5oJWGXdQyL24yV55K53kVY/EswhGCS30R193cHape6e0WdIwqRJ9gyr4rn25Tf3vTV+7gqUQprrlY8g1aVpUm5cSD6AOIcjPVVJavnsuVAPTLRVV0b1JnbjnWxR+tuuUHFCGvDXMYv1PhYmG4rosotSLINy0ydoE4lZ2LqTNUcBjQ++deNLN5rt1Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RQyZuGo6/Hugnz2edWO76euLxLVPPhlabLBzlIQy479zQKF9VLcvgDZPFrxs8F8vyF1aQxK+0I0Ik7BUTAcwScq/EIAU25Hs6L6IQ5vlcwLF783sAhbGhJIEvYN71erRIFaAeznepD6iAIdvur0vjEzlCAp8VF9t5vCr6xSHtj5SryNTil0OSsQYWwq8bLEPEYHeRnrlEBDkUHUVfAn+KTbGsnJOmoydMVcfWmMHOiVKWQuHDNL4REXFO3+cj41EulnQRzlPA7MQegvj4nmelq8Lztl+fXVBlXMME7zFb7tlQX9L0izpdl7ogDUPPx9b8RBtXC9j4n0GSH7oe7gUXA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: andrew.cooper3@xxxxxxxxxx, roger.pau@xxxxxxxxxx, julien@xxxxxxx, george.dunlap@xxxxxxxxxx, bertrand.marquis@xxxxxxx, nicola.vetrini@xxxxxxxxxxx, Stefano Stabellini <stefano.stabellini@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 23 Aug 2023 06:56:14 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 23.08.2023 02:24, Stefano Stabellini wrote:
> From: Stefano Stabellini <stefano.stabellini@xxxxxxx>
> 
> During the discussions that led to the acceptable of Rule 2.1, we

Nit (as before): "acceptance"?

> decided on a few exceptions that were not properly recorded in
> rules.rst. Add them now.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>
> ---
>  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 b6d87e076b..8f38227994 100644
> --- a/docs/misra/rules.rst
> +++ b/docs/misra/rules.rst
> @@ -107,7 +107,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 never referenced from C
> +           code (e.g. 'do_trap_fiq')

Maybe better put it the other way around, "only referenced from assembly
code"? This is because "never referenced from C" also includes truly
unreferenced functions/data.

> +         - Unreachability caused by the certain macros/functions is
> +           deliberate, e.g. BUG, assert_failed, panic, etc.

I think the "the" here wants dropping, and even then the result doesn't
read very well imo. How about "Deliberate unreachability caused by
certain macros/functions, e.g. BUG, assert_failed, panic, etc"?

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

Provided additionally this sub-sub-bullet-list then also translates
correctly to the various derived formats, then:
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan



 


Rackspace

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