brick: safeguard mb() before check

This commit is contained in:
Thomas Schoebel-Theuer 2021-04-16 11:42:16 +02:00
parent 8761f8739d
commit 320e9335c9

View File

@ -328,20 +328,22 @@ struct generic_output {
};
#define GENERIC_OUTPUT_CALL(OUTPUT,OP,ARGS...) \
( \
({ \
mb(); \
(void)LOCK_CHECK(OP), \
(OUTPUT) && (OUTPUT)->ops->OP ? \
(OUTPUT)->ops->OP(OUTPUT, ##ARGS) : \
-ENOTCONN \
)
-ENOTCONN; \
})
#define GENERIC_INPUT_CALL(INPUT,OP,ARGS...) \
( \
({ \
mb(); \
(void)LOCK_CHECK(OP), \
(INPUT) && (INPUT)->connect ? \
GENERIC_OUTPUT_CALL((INPUT)->connect, OP, ##ARGS) : \
-ENOTCONN \
)
-ENOTCONN; \
})
#define GENERIC_BRICK_OPS(BRITYPE) \
int (*brick_switch)(struct BRITYPE##_brick *brick); \