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

Re: [PATCH 1/3] x86/p2m.h: Add include guards


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 17 May 2022 17:38:43 +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=2xj5h4ued3T/BrsnWxIuy2EZy8/aYVoChYZR3tKstO8=; b=d5viUImJjFGfvBtZFKFYmeHv0c/eBbiiLQL2Ighc8tcb3R4L6C2SLxW5qizdFoXjFFU7b/7nY2fCZXxmnd5ywx/fo5RyEoODfa0/tq/8jINc/wvvvVMze52scaRFhA/miPH930FjoXhfG9oOVJiCq6qKNe0O0m0HLYIFE8WT1s9W9imIK5dpO8Fh/DGH8PolwTDZEfG72No18AS9urlq7eDwk6Lh+l6mG4LOzqkMBWE1rPMwps83vSnPn3vYH284wbLsB8G3QqIcp+MWBsxTqw7xWkv+Fsow9dJd88eG5YcR/fW65BSCsEZvbnT7UWwFgu/NOk0ELRe8RuczHFOJ1w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EbawRrsH71MIZ9c79r3vPuAyxpZUu7sJLqqUHMjDUdk300yu1eFQv6/AQrLln4hDthdJRXAKWdOVlYYgxZ094HJu/arVWc4SvXhU9X2vmG6X5p4hpr32TdgfeFtEoNrubQWs6KdkXYgWQF0JfuDQmcIe0n7wGO96s8F9A8jOADdeKvNPBc7em+Y9A5a9IPZ1+WaIrnm53WkqrPUzHLO4c14C6Yo3vMH5DjODOQ2kCvtBIvTXDjfBD5D/YcskROlN3n8EsG87RBtsZswdWohz+BQOFO8Ma1MBYQuTN9y/nF+JVbYelUBK5h+KVNTeAe3QXUo3fq0y1Bi+4phEsDJvwg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 17 May 2022 15:38:45 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 09.05.2022 14:24, Andrew Cooper wrote:
> Spotted by Eclair MISRA scanner.

I'm sorry, but what exactly was it that the scanner spotted? It was
actually deliberate to introduce this file without guards. I'm of
the general opinion that (private) headers not to be included by
other headers (but only by .c files) are not in need of guards. If
it is project-wide consensus that _all_ header files should have
guards, then I'll try to keep this in mind (in "x86emul: a few
small steps towards disintegration" for example I introduce
another such instance), but then it should also be put down in
./CODING_STYLE.

Jan

> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> ---
> CC: Jan Beulich <JBeulich@xxxxxxxx>
> CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> CC: Wei Liu <wl@xxxxxxx>
> CC: Stefano Stabellini <sstabellini@xxxxxxxxxx>
> CC: Julien Grall <julien@xxxxxxx>
> CC: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
> CC: Bertrand Marquis <bertrand.marquis@xxxxxxx>
> ---
>  xen/arch/x86/mm/p2m.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/xen/arch/x86/mm/p2m.h b/xen/arch/x86/mm/p2m.h
> index cc0f6766e4df..dc706b8e4799 100644
> --- a/xen/arch/x86/mm/p2m.h
> +++ b/xen/arch/x86/mm/p2m.h
> @@ -15,6 +15,9 @@
>   * along with this program; If not, see <http://www.gnu.org/licenses/>.
>   */
>  
> +#ifndef __ARCH_MM_P2M_H__
> +#define __ARCH_MM_P2M_H__
> +
>  struct p2m_domain *p2m_init_one(struct domain *d);
>  void p2m_free_one(struct p2m_domain *p2m);
>  
> @@ -39,6 +42,8 @@ int ept_p2m_init(struct p2m_domain *p2m);
>  void ept_p2m_uninit(struct p2m_domain *p2m);
>  void p2m_init_altp2m_ept(struct domain *d, unsigned int i);
>  
> +#endif /* __ARCH_MM_P2M_H__ */
> +
>  /*
>   * Local variables:
>   * mode: C




 


Rackspace

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