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

Re: [XEN PATCH 09/13] xen/common: address violations of MISRA C:2012 Directive 4.10


  • To: Simone Ballarin <simone.ballarin@xxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 29 Aug 2023 08:50:12 +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=sUhOxWnOFlO6DHDWaDimQHauNO+LCfzlMafAO9n+010=; b=d9s7p3MapmRgrWCpPpeasbsIiNcltu9OFwxcSxrLUFL2V8tBGk90CXHbgjJW3fDAwjruLXIJ3htmfhywXe69Q2tcR+BwwPcslUyoR+SNSC4M9/Abb5DeGiIeb+MpdowasGApaufEEjnzCZuXhhmhcHBFlLOUkgsqegnoSPqbbhMPPF71M6Be0RFNNaIvGY8ZfOR7vcHOI6cY1fMSN/lO0QkrZW6/XlZ9vDIDjR6lhtmFmTlZzr9O7CuhlRBdLaTQU9fKEOEwGnIr/QfqDsFG/tEM2zyK/OQI+5ZrvZcQk2OGyg4QLzuPnkqBFklTNCJbTtJNC7bMUKfw7ie7zV6KGg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kKvKHCKZlThc7NeddotBnylOlBowRwnEbL4JjnK+xu1WQmYix8kgp7cuGP8HIhzHSU6yIDoP4vnuxMVjXZzSuoQqap3OCEkDB5pxsJsaWKN+Hn3kst2WNzstA5kfrKlABTzIDDQv9t7e6RH1TM2C4r6eSbpyVPMHssPyGjFNjwhX3UwCWd8yXgEP77j6vxq8bfb590m+gq9M3REO0IjbGImyoavAP3aaeJ4mQ9ceYxtYOJ86xCQ4BASm+Slh3UE0d+L2awRa6lrgucwJjGDD2mAnb2yftTvQjHZ+o0FmrLgzY1SFfpYBirCCTwYzf/W8f8yKWPbuyL/r1jgxtO6oUw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: consulting@xxxxxxxxxxx, sstabellini@xxxxxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 29 Aug 2023 06:50:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 28.08.2023 15:20, Simone Ballarin wrote:
> Add inclusion guards to address violations of
> MISRA C:2012 Directive 4.10 ("Precautions shall be taken in order
> to prevent the contents of a header file being included more than
> once").
> 
> Also C files, if included somewhere, need to comply with the guideline.
> 
> Mechanical change.
> 
> Signed-off-by: Simone Ballarin <simone.ballarin@xxxxxxxxxxx>
> ---
>  xen/common/compat/grant_table.c | 7 +++++++
>  xen/common/coverage/gcc_4_7.c   | 5 +++++
>  xen/common/decompress.h         | 5 +++++
>  xen/common/event_channel.h      | 5 +++++
>  xen/common/multicall.c          | 5 +++++
>  5 files changed, 27 insertions(+)

As already said in reply to another patch, imo .c files shouldn't gain such
guards. These are commonly referred to as "header guards" for a reason.

> --- a/xen/common/compat/grant_table.c
> +++ b/xen/common/compat/grant_table.c
> @@ -3,6 +3,10 @@
>   *
>   */
>  
> +

Nit: No double blank lines please.

> +#ifndef __COMMON_COMPAT_GRANT_TABLE_C__
> +#define __COMMON_COMPAT_GRANT_TABLE_C__
> +
>  #include <xen/hypercall.h>
>  #include <compat/grant_table.h>
>  
> @@ -331,6 +335,9 @@ int compat_grant_table_op(
>      return rc;
>  }
>  
> +

Again here (at least).

Jan



 


Rackspace

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