dma/idxd: fix build on Windows
Subsystems (2)
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.
--- drivers/dma/idxd/idxd_hw_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/idxd/idxd_hw_defs.h +1 -1
@@ -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
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 specifiersuint16_t __reserved[13]; ~~~~~~~~ ^1 error generated.
Ironically,
__reservedis 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")Signed-off-by David Marchand <[email protected]>--- drivers/dma/idxd/idxd_hw_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/dma/idxd/idxd_hw_defs.h +1
-1@@ -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
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 specifiersuint16_t __reserved[13]; ~~~~~~~~ ^1 error generated.
Quoted 4 lines
Quoted 1 line
Ironically,
__reservedis 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
David Marchand
AppliedQuoted 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 specifiersuint16_t __reserved[13]; ~~~~~~~~ ^1 error generated.
Quoted 7 lines
Ironically,
__reservedis 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")Signed-off-by David Marchand <[email protected]>
Tested via CI@UNH.
Applied.
Signature · 1 line
David Marchand
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 specifiersuint16_t __reserved[13]; ~~~~~~~~ ^1 error generated.
Ironically,
__reservedis 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")Signed-off-by David Marchand <[email protected]>Tested via CI@UNH.
Applied.
Thanks for investigating and sending the fix for this, David.
/Kevin