Skip to content

Commit a27c04e

Browse files
Gavin Shanwilldeacon
authored andcommitted
firmware: arm_sdei: Cleanup on cross call function
This applies cleanup on the cross call functions, no functional changes are introduced: * Wrap the code block of CROSSCALL_INIT inside "do { } while (0)" as linux kernel usually does. Otherwise, scripts/checkpatch.pl reports warning regarding this. * Use smp_call_func_t for @fn argument in sdei_do_cross_call() as the function is called on target CPU(s). * Remove unnecessary space before @event in sdei_do_cross_call() Signed-off-by: Gavin Shan <gshan@redhat.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: James Morse <james.morse@arm.com> Link: https://lore.kernel.org/r/20200922130423.10173-11-gshan@redhat.com Signed-off-by: Will Deacon <will@kernel.org>
1 parent b06146b commit a27c04e

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

drivers/firmware/arm_sdei.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,15 @@ struct sdei_crosscall_args {
7878
int first_error;
7979
};
8080

81-
#define CROSSCALL_INIT(arg, event) (arg.event = event, \
82-
arg.first_error = 0, \
83-
atomic_set(&arg.errors, 0))
84-
85-
static inline int sdei_do_cross_call(void *fn, struct sdei_event * event)
81+
#define CROSSCALL_INIT(arg, event) \
82+
do { \
83+
arg.event = event; \
84+
arg.first_error = 0; \
85+
atomic_set(&arg.errors, 0); \
86+
} while (0)
87+
88+
static inline int sdei_do_cross_call(smp_call_func_t fn,
89+
struct sdei_event *event)
8690
{
8791
struct sdei_crosscall_args arg;
8892

0 commit comments

Comments
 (0)