diff mbox series

[edk2,edk2-staging,11/19] IntelUndiPkg/GigUndiDxe: fix incorrect use of CPP token pasting

Message ID 20181106175833.26964-12-ard.biesheuvel@linaro.org
State Superseded
Headers show
Series IntelUndiPkg/GigUndiDxe: build fixes for AARCH64/ARM/GCC | expand

Commit Message

Ard Biesheuvel Nov. 6, 2018, 5:58 p.m. UTC
The ## CPP token pasting operator is used to paste *tokens*, which
is not the same thing as pasting arbitrary macro arguments. Since a
token cannot contain . or ) characters in the first place, using
the ## operator here is wrong and unnecessary, so just remove it.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

---
 IntelUndiPkg/GigUndiDxe/NVDataStruc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.19.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Comments

Ryszard Knop Jan. 30, 2019, 1:35 p.m. UTC | #1
Reviewed-by: Ryszard Knop <ryszard.knop@linux.intel.com>


On Tue, 2018-11-06 at 18:58 +0100, ard.biesheuvela wrote:
> The ## CPP token pasting operator is used to paste *tokens*, which

> is not the same thing as pasting arbitrary macro arguments. Since a

> token cannot contain . or ) characters in the first place, using

> the ## operator here is wrong and unnecessary, so just remove it.

> 

> Contributed-under: TianoCore Contribution Agreement 1.1

> Signed-off-by: Ard Biesheuvel <ard.biesheuvel at linaro.org>

> ---

>  IntelUndiPkg/GigUndiDxe/NVDataStruc.h | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/IntelUndiPkg/GigUndiDxe/NVDataStruc.h

> b/IntelUndiPkg/GigUndiDxe/NVDataStruc.h

> index 72f6a95ccb6d..04f08b41c842 100644

> --- a/IntelUndiPkg/GigUndiDxe/NVDataStruc.h

> +++ b/IntelUndiPkg/GigUndiDxe/NVDataStruc.h

> @@ -112,7 +112,7 @@ typedef struct {

>  

>     @return   Width of given field is returned

>  **/

> -#define UNDI_CONFIG_WIDTH(Field) sizeof (UndiPrivateData-

> >Configuration. ## Field ## )

> +#define UNDI_CONFIG_WIDTH(Field) sizeof (UndiPrivateData-

> >Configuration.Field)

>  

>  // General parameters

>  #define     QUESTION_ID_EFI_DRIVER_VER                          0x11

> 00


_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
diff mbox series

Patch

diff --git a/IntelUndiPkg/GigUndiDxe/NVDataStruc.h b/IntelUndiPkg/GigUndiDxe/NVDataStruc.h
index 72f6a95ccb6d..04f08b41c842 100644
--- a/IntelUndiPkg/GigUndiDxe/NVDataStruc.h
+++ b/IntelUndiPkg/GigUndiDxe/NVDataStruc.h
@@ -112,7 +112,7 @@  typedef struct {
 
    @return   Width of given field is returned
 **/
-#define UNDI_CONFIG_WIDTH(Field) sizeof (UndiPrivateData->Configuration. ## Field ## )
+#define UNDI_CONFIG_WIDTH(Field) sizeof (UndiPrivateData->Configuration.Field)
 
 // General parameters
 #define     QUESTION_ID_EFI_DRIVER_VER                          0x1100