[PATCH v2 1/8] MdePkg: Fix IORT header file include guard


Sami Mujawar
 

According to section 5.3.5, EDK II C Coding Standards Specification
(https://edk2-docs.gitbook.io/edk-ii-c-coding-standards-specification)
the header file guard names must not be prefixed with underscores as
they are reserved for compiler implementation.

Therefore, fix the header file include guard as per the specification
guidelines.

Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
---

Notes:
v2:
- No code change since v1. Re-sending with v2 series. [SAMI]

MdePkg/Include/IndustryStandard/IoRemappingTable.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MdePkg/Include/IndustryStandard/IoRemappingTable.h b/MdePkg/Include/IndustryStandard/IoRemappingTable.h
index 90504e3a6715be7facc6450c6ff0e1eab92cd3c7..731217441438a00dd5ff0bedf2010598d48d6dbf 100644
--- a/MdePkg/Include/IndustryStandard/IoRemappingTable.h
+++ b/MdePkg/Include/IndustryStandard/IoRemappingTable.h
@@ -9,8 +9,8 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
**/

-#ifndef __IO_REMAPPING_TABLE_H__
-#define __IO_REMAPPING_TABLE_H__
+#ifndef IO_REMAPPING_TABLE_H_
+#define IO_REMAPPING_TABLE_H_

#include <IndustryStandard/Acpi.h>

--
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


Michael D Kinney
 

Hi Sami,

The include guard pattern is present everywhere. No sure it makes sense to start fixing these one at a time.

The #pragma once may be a better long term solution and may improve build times slightly.

https://en.wikipedia.org/wiki/Pragma_once

Best regards,

Mike

-----Original Message-----
From: Sami Mujawar <sami.mujawar@arm.com>
Sent: Thursday, June 17, 2021 2:56 AM
To: devel@edk2.groups.io
Cc: Sami Mujawar <sami.mujawar@arm.com>; Alexei.Fedorov@arm.com; ardb+tianocore@kernel.org; Matteo.Carlini@arm.com;
Ben.Adderson@arm.com; Kinney, Michael D <michael.d.kinney@intel.com>; gaoliming@byosoft.com.cn; Liu, Zhiguang
<zhiguang.liu@intel.com>; Ni, Ray <ray.ni@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>; nd@arm.com
Subject: [PATCH v2 1/8] MdePkg: Fix IORT header file include guard

According to section 5.3.5, EDK II C Coding Standards Specification
(https://edk2-docs.gitbook.io/edk-ii-c-coding-standards-specification)
the header file guard names must not be prefixed with underscores as
they are reserved for compiler implementation.

Therefore, fix the header file include guard as per the specification
guidelines.

Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
---

Notes:
v2:
- No code change since v1. Re-sending with v2 series. [SAMI]

MdePkg/Include/IndustryStandard/IoRemappingTable.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MdePkg/Include/IndustryStandard/IoRemappingTable.h b/MdePkg/Include/IndustryStandard/IoRemappingTable.h
index 90504e3a6715be7facc6450c6ff0e1eab92cd3c7..731217441438a00dd5ff0bedf2010598d48d6dbf 100644
--- a/MdePkg/Include/IndustryStandard/IoRemappingTable.h
+++ b/MdePkg/Include/IndustryStandard/IoRemappingTable.h
@@ -9,8 +9,8 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
**/

-#ifndef __IO_REMAPPING_TABLE_H__
-#define __IO_REMAPPING_TABLE_H__
+#ifndef IO_REMAPPING_TABLE_H_
+#define IO_REMAPPING_TABLE_H_

#include <IndustryStandard/Acpi.h>

--
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


Sami Mujawar
 

Hi Mike,

I agree the use of the include guard is not consistent across edk2 code and it may be better to fix them all at once. However, if we decide to use '#pragma once', then the edk2 coding standard specification would need to be updated first. Similarly, the ECC tool would also need to be updated.

I can drop this change for now. Please let me know how you wish to proceed.

Regards,

Sami Mujawar

´╗┐On 17/06/2021, 19:19, "devel@edk2.groups.io on behalf of Michael D Kinney via groups.io" <devel@edk2.groups.io on behalf of michael.d.kinney=intel.com@groups.io> wrote:

Hi Sami,

The include guard pattern is present everywhere. No sure it makes sense to start fixing these one at a time.

The #pragma once may be a better long term solution and may improve build times slightly.

https://en.wikipedia.org/wiki/Pragma_once

Best regards,

Mike

-----Original Message-----
> From: Sami Mujawar <sami.mujawar@arm.com>
> Sent: Thursday, June 17, 2021 2:56 AM
> To: devel@edk2.groups.io
> Cc: Sami Mujawar <sami.mujawar@arm.com>; Alexei.Fedorov@arm.com; ardb+tianocore@kernel.org; Matteo.Carlini@arm.com;
> Ben.Adderson@arm.com; Kinney, Michael D <michael.d.kinney@intel.com>; gaoliming@byosoft.com.cn; Liu, Zhiguang
> <zhiguang.liu@intel.com>; Ni, Ray <ray.ni@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>; nd@arm.com
> Subject: [PATCH v2 1/8] MdePkg: Fix IORT header file include guard
>
> According to section 5.3.5, EDK II C Coding Standards Specification
> (https://edk2-docs.gitbook.io/edk-ii-c-coding-standards-specification)
> the header file guard names must not be prefixed with underscores as
> they are reserved for compiler implementation.
>
> Therefore, fix the header file include guard as per the specification
> guidelines.
>
> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
> ---
>
> Notes:
> v2:
> - No code change since v1. Re-sending with v2 series. [SAMI]
>
> MdePkg/Include/IndustryStandard/IoRemappingTable.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/MdePkg/Include/IndustryStandard/IoRemappingTable.h b/MdePkg/Include/IndustryStandard/IoRemappingTable.h
> index 90504e3a6715be7facc6450c6ff0e1eab92cd3c7..731217441438a00dd5ff0bedf2010598d48d6dbf 100644
> --- a/MdePkg/Include/IndustryStandard/IoRemappingTable.h
> +++ b/MdePkg/Include/IndustryStandard/IoRemappingTable.h
> @@ -9,8 +9,8 @@
> SPDX-License-Identifier: BSD-2-Clause-Patent
> **/
>
> -#ifndef __IO_REMAPPING_TABLE_H__
> -#define __IO_REMAPPING_TABLE_H__
> +#ifndef IO_REMAPPING_TABLE_H_
> +#define IO_REMAPPING_TABLE_H_
>
> #include <IndustryStandard/Acpi.h>
>
> --
> 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'