Skip to contentSkip to conversation

dma/idxd: fix build on Windows

PATCH Applied David Marchand 3 participants 5 messages Oct 23, 2021 – Oct 25, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dma/idxd: fix build on Windows

Windows compilation gives us a splat:
In file included from ../drivers/dma/idxd/idxd_pci.c:10:
In file included from ..\drivers\dma\idxd/idxd_internal.h:11:
..\drivers\dma\idxd/idxd_hw_defs.h:46:21: error: expected member name or
';' after declaration specifiers

        uint16_t __reserved[13];
        ~~~~~~~~           ^

1 error generated.

Ironically, __reserved is probably a reserved token.
Some drivers that build fine on Windows have structs with a "reserved" field, let's go with this.

Fixes 82147042d062 ("dma/idxd: add datapath structures")
---
 drivers/dma/idxd/idxd_hw_defs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/idxd/idxd_hw_defs.h +1 -1
index 55ca9f7f52..2a219c1312 100644
@@ -43,7 +43,7 @@ struct idxd_hw_desc {
 	uint16_t intr_handle; /* completion interrupt handle */
 
 	/* remaining 26 bytes are reserved */
-	uint16_t __reserved[13];
+	uint16_t reserved[13];
 } __rte_aligned(64);
 
 #define IDXD_COMP_STATUS_INCOMPLETE        0
Signature · 1 line
2.23.0
#1 lore raw

2021-10-23 08:55 (UTC+0200), David Marchand:

Quoted 10 lines

Windows compilation gives us a splat:
In file included from ../drivers/dma/idxd/idxd_pci.c:10:
In file included from ..\drivers\dma\idxd/idxd_internal.h:11:
..\drivers\dma\idxd/idxd_hw_defs.h:46:21: error: expected member name or
';' after declaration specifiers

        uint16_t __reserved[13];
        ~~~~~~~~           ^

1 error generated.

Ironically, __reserved is probably a reserved token.

Yes, and it's used in system headers for static analyzer annotations:
https://docs.microsoft.com/en-us/windows/win32/winprog/header-annotations#advanced-annotations

Quoted 23 lines

Some drivers that build fine on Windows have structs with a "reserved" field, let's go with this.

Fixes 82147042d062 ("dma/idxd: add datapath structures")
---
 drivers/dma/idxd/idxd_hw_defs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/idxd/idxd_hw_defs.h +1 -1
index 55ca9f7f52..2a219c1312 100644
@@ -43,7 +43,7 @@ struct idxd_hw_desc {
 	uint16_t intr_handle; /* completion interrupt handle */
 
 	/* remaining 26 bytes are reserved */
-	uint16_t __reserved[13];
+	uint16_t reserved[13];
 } __rte_aligned(64);
 
 #define IDXD_COMP_STATUS_INCOMPLETE        0
#2 lore raw
Quoted 11 lines · Dmitry Kozlyuk

2021-10-23 08:55 (UTC+0200), David Marchand:

Quoted 9 lines

Windows compilation gives us a splat:
In file included from ../drivers/dma/idxd/idxd_pci.c:10:
In file included from ..\drivers\dma\idxd/idxd_internal.h:11:
..\drivers\dma\idxd/idxd_hw_defs.h:46:21: error: expected member name or
';' after declaration specifiers

        uint16_t __reserved[13];
        ~~~~~~~~           ^

1 error generated.

Quoted 4 lines
Quoted 1 line

Ironically, __reserved is probably a reserved token.

Yes, and it's used in system headers for static analyzer annotations:
https://docs.microsoft.com/en-us/windows/win32/winprog/header-annotations#advanced-annotations

Thanks for confirming.

Signature · 1 line
David Marchand
author Applied
#3 lore raw
In reply to David Marchand
Quoted 10 lines · David Marchand

Windows compilation gives us a splat:
In file included from ../drivers/dma/idxd/idxd_pci.c:10:
In file included from ..\drivers\dma\idxd/idxd_internal.h:11:
..\drivers\dma\idxd/idxd_hw_defs.h:46:21: error: expected member name or
';' after declaration specifiers

        uint16_t __reserved[13];
        ~~~~~~~~           ^

1 error generated.

Quoted 7 lines

Ironically, __reserved is probably a reserved token.
Some drivers that build fine on Windows have structs with a "reserved" field, let's go with this.

Fixes 82147042d062 ("dma/idxd: add datapath structures")

Tested via CI@UNH.

Applied.

Signature · 1 line
David Marchand
#4 lore raw
Quoted 15 lines · David Marchand
Quoted 13 lines · David Marchand

Windows compilation gives us a splat:
In file included from ../drivers/dma/idxd/idxd_pci.c:10:
In file included from ..\drivers\dma\idxd/idxd_internal.h:11:
..\drivers\dma\idxd/idxd_hw_defs.h:46:21: error: expected member name or
';' after declaration specifiers

         uint16_t __reserved[13];
         ~~~~~~~~           ^

1 error generated.

Ironically, __reserved is probably a reserved token.
Some drivers that build fine on Windows have structs with a "reserved" field, let's go with this.

Quoted 6 lines
Quoted 3 lines
Fixes 82147042d062 ("dma/idxd: add datapath structures")

Tested via CI@UNH.

Applied.

Thanks for investigating and sending the fix for this, David.

/Kevin