Message ID | 20200730014531.310465-11-gshan@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Refactor SDEI client driver | expand |
Hi Gavin, On 30/07/2020 02:45, Gavin Shan wrote: > This applies cleanup on the cross call functions, no functional > changes are introduced: > * Refactor CROSSCALL_INIT to use "do { ... } while (0)" to be > compatible with scripts/checkpatch.pl What does this mean? > * Use smp_call_func_t for @fn argument in sdei_do_cross_call() > * Remove unnecessary space before @event in sdei_do_cross_call() > diff --git a/drivers/firmware/arm_sdei.c b/drivers/firmware/arm_sdei.c > index c8e894098c56..5560c8880631 100644 > --- a/drivers/firmware/arm_sdei.c > +++ b/drivers/firmware/arm_sdei.c > @@ -78,11 +78,15 @@ struct sdei_crosscall_args { > int first_error; > }; > > -#define CROSSCALL_INIT(arg, event) (arg.event = event, \ > - arg.first_error = 0, \ > - atomic_set(&arg.errors, 0)) > - > -static inline int sdei_do_cross_call(void *fn, struct sdei_event * event) > +#define CROSSCALL_INIT(arg, event) \ > + do { \ > + arg.event = event; \ > + arg.first_error = 0; \ > + atomic_set(&arg.errors, 0); \ > + } while (0) Huh, I'm surprised I didn't write it like that the first time! > +static inline int sdei_do_cross_call(smp_call_func_t fn, > + struct sdei_event *event) > { > struct sdei_crosscall_args arg; With some kind of motivation for the change, instead of "checkpatch made me do it": Reviewed-by: James Morse <james.morse@arm.com> Thanks, James
diff --git a/drivers/firmware/arm_sdei.c b/drivers/firmware/arm_sdei.c index c8e894098c56..5560c8880631 100644 --- a/drivers/firmware/arm_sdei.c +++ b/drivers/firmware/arm_sdei.c @@ -78,11 +78,15 @@ struct sdei_crosscall_args { int first_error; }; -#define CROSSCALL_INIT(arg, event) (arg.event = event, \ - arg.first_error = 0, \ - atomic_set(&arg.errors, 0)) - -static inline int sdei_do_cross_call(void *fn, struct sdei_event * event) +#define CROSSCALL_INIT(arg, event) \ + do { \ + arg.event = event; \ + arg.first_error = 0; \ + atomic_set(&arg.errors, 0); \ + } while (0) + +static inline int sdei_do_cross_call(smp_call_func_t fn, + struct sdei_event *event) { struct sdei_crosscall_args arg;