Skip to content

Commit 93998f3

Browse files
Tyler Retzlaffdavid-marchand
authored andcommitted
add extension keyword to GCC statement expressions
Add __extension__ keyword to gcc statement expression extensions. This is necessary for MSVC support. Signed-off-by: Tyler Retzlaff <[email protected]> Reviewed-by: Ruifeng Wang <[email protected]>
1 parent 40277bb commit 93998f3

File tree

31 files changed

+78
-78
lines changed

31 files changed

+78
-78
lines changed

drivers/bus/fslmc/mc/fsl_mc_sys.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ struct fsl_mc_io {
4040
#define __arch_putq(v, a) (*(volatile uint64_t *)(a) = (v))
4141
#define __arch_putq32(v, a) (*(volatile uint32_t *)(a) = (v))
4242
#define readq(c) \
43-
({ uint64_t __v = __arch_getq(c); __iormb(); __v; })
43+
__extension__ ({ uint64_t __v = __arch_getq(c); __iormb(); __v; })
4444
#define writeq(v, c) \
45-
({ uint64_t __v = v; __iowmb(); __arch_putq(__v, c); __v; })
45+
__extension__ ({ uint64_t __v = v; __iowmb(); __arch_putq(__v, c); __v; })
4646
#define writeq32(v, c) \
47-
({ uint32_t __v = v; __iowmb(); __arch_putq32(__v, c); __v; })
47+
__extension__ ({ uint32_t __v = v; __iowmb(); __arch_putq32(__v, c); __v; })
4848
#define ioread64(_p) readq(_p)
4949
#define iowrite64(_v, _p) writeq(_v, _p)
5050
#define iowrite32(_v, _p) writeq32(_v, _p)

drivers/common/cnxk/roc_io.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,21 @@
3030
#endif
3131

3232
#define roc_load_pair(val0, val1, addr) \
33-
({ \
33+
__extension__ ({ \
3434
asm volatile("ldp %x[x0], %x[x1], [%x[p1]]" \
3535
: [x0] "=r"(val0), [x1] "=r"(val1) \
3636
: [p1] "r"(addr)); \
3737
})
3838

3939
#define roc_store_pair(val0, val1, addr) \
40-
({ \
40+
__extension__ ({ \
4141
asm volatile( \
4242
"stp %x[x0], %x[x1], [%x[p1], #0]!" ::[x0] "r"(val0), \
4343
[x1] "r"(val1), [p1] "r"(addr)); \
4444
})
4545

4646
#define roc_prefetch_store_keep(ptr) \
47-
({ asm volatile("prfm pstl1keep, [%x0]\n" : : "r"(ptr)); })
47+
__extension__ ({ asm volatile("prfm pstl1keep, [%x0]\n" : : "r"(ptr)); })
4848

4949
#if defined(__clang__)
5050
static __plt_always_inline void

drivers/common/cnxk/roc_platform.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282

8383
/** Divide ceil */
8484
#define PLT_DIV_CEIL(x, y) \
85-
({ \
85+
__extension__ ({ \
8686
__typeof(x) __x = x; \
8787
__typeof(y) __y = y; \
8888
(__x + __y - 1) / __y; \

drivers/common/dpaax/dpaa_list.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ do { \
3131
#define list_entry(node, type, member) \
3232
(type *)((void *)node - offsetof(type, member))
3333
#define list_empty(p) \
34-
({ \
34+
__extension__ ({ \
3535
const struct list_head *__p298 = (p); \
3636
((__p298->next == __p298) && (__p298->prev == __p298)); \
3737
})

drivers/common/qat/qat_adf/icp_qat_hw.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ enum icp_qat_hw_cipher_convert {
292292
#define QAT_CIPHER_AEAD_AAD_SIZE_BITPOS 16
293293
#define QAT_CIPHER_AEAD_AAD_SIZE_LE_BITPOS 0
294294
#define ICP_QAT_HW_CIPHER_CONFIG_BUILD_UPPER(aad_size) \
295-
({ \
295+
__extension__ ({ \
296296
typeof(aad_size) aad_size1 = aad_size; \
297297
(((((aad_size1) >> QAT_CIPHER_AEAD_AAD_UPPER_SHIFT) & \
298298
QAT_CIPHER_AEAD_AAD_SIZE_UPPER_MASK) << \

drivers/crypto/armv8/rte_armv8_pmd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ crypto_chain_order[] = {
139139
* Extract particular combined mode crypto function from the 3D array.
140140
*/
141141
#define CRYPTO_GET_ALGO(order, cop, calg, aalg, keyl) \
142-
({ \
142+
__extension__ ({ \
143143
crypto_func_tbl_t *func_tbl = \
144144
(crypto_chain_order[(order)])[(cop)]; \
145145
\
@@ -186,7 +186,7 @@ crypto_key_sched_dir[] = {
186186
* Extract particular combined mode crypto function from the 3D array.
187187
*/
188188
#define CRYPTO_GET_KEY_SCHED(cop, calg, keyl) \
189-
({ \
189+
__extension__ ({ \
190190
crypto_key_sched_tbl_t *ks_tbl = crypto_key_sched_dir[(cop)]; \
191191
\
192192
(calg >= CRYPTO_CIPHER_MAX) ? \

drivers/crypto/caam_jr/caam_jr_desc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
/* Macro for setting up a JD. The structure of the JD is common across all
3333
* supported protocols, thus its structure is identical.
3434
*/
35-
#define SEC_JD_INIT(descriptor) ({ \
35+
#define SEC_JD_INIT(descriptor) __extension__ ({ \
3636
/* CTYPE = job descriptor \
3737
* RSMS, DNR = 0
3838
* ONE = 1

drivers/dma/hisilicon/hisi_dmadev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ hisi_dma_update_queue_mbit(struct hisi_dma_dev *hw, uint32_t qoff,
124124
hisi_dma_write_queue(hw, qoff, tmp);
125125
}
126126

127-
#define hisi_dma_poll_hw_state(hw, val, cond, sleep_us, timeout_us) ({ \
127+
#define hisi_dma_poll_hw_state(hw, val, cond, sleep_us, timeout_us) __extension__ ({ \
128128
uint32_t timeout = 0; \
129129
while (timeout++ <= (timeout_us)) { \
130130
(val) = hisi_dma_read_queue(hw, HISI_DMA_QUEUE_FSM_REG); \

drivers/event/octeontx/ssovf_evdev.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@
9696

9797
/* ARM64 specific functions */
9898
#if defined(RTE_ARCH_ARM64)
99-
#define ssovf_load_pair(val0, val1, addr) ({ \
99+
#define ssovf_load_pair(val0, val1, addr) __extension__ ({ \
100100
asm volatile( \
101101
"ldp %x[x0], %x[x1], [%x[p1]]" \
102102
:[x0]"=r"(val0), [x1]"=r"(val1) \
103103
:[p1]"r"(addr) \
104104
); })
105105

106-
#define ssovf_store_pair(val0, val1, addr) ({ \
106+
#define ssovf_store_pair(val0, val1, addr) __extension__ ({ \
107107
asm volatile( \
108108
"stp %x[x0], %x[x1], [%x[p1]]" \
109109
::[x0]"r"(val0), [x1]"r"(val1), [p1]"r"(addr) \

drivers/mempool/octeontx/octeontx_fpavf.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@
5959

6060
/* ARM64 specific functions */
6161
#if defined(RTE_ARCH_ARM64)
62-
#define fpavf_load_pair(val0, val1, addr) ({ \
62+
#define fpavf_load_pair(val0, val1, addr) __extension__ ({ \
6363
asm volatile( \
6464
"ldp %x[x0], %x[x1], [%x[p1]]" \
6565
:[x0]"=r"(val0), [x1]"=r"(val1) \
6666
:[p1]"r"(addr) \
6767
); })
6868

69-
#define fpavf_store_pair(val0, val1, addr) ({ \
69+
#define fpavf_store_pair(val0, val1, addr) __extension__ ({ \
7070
asm volatile( \
7171
"stp %x[x0], %x[x1], [%x[p1]]" \
7272
::[x0]"r"(val0), [x1]"r"(val1), [p1]"r"(addr) \

0 commit comments

Comments
 (0)