[PATCH v2 10/17] drivers/firmware/sdei: Cleanup on cross call function

Jonathan Cameron Jonathan.Cameron at Huawei.com
Thu Jul 23 11:52:22 EDT 2020


On Wed, 22 Jul 2020 19:57:33 +1000
Gavin Shan <gshan at redhat.com> wrote:

> This applies cleanup on the corss call functions, no functional

cross

> changes is introduced:

changes are introduced:

> 
>    * Cleanup struct sdei_crosscall_arg to use tab between fields
>      and their types
Hmm. I guess there is a consistency argument for doing this but generally
that one doesn't look like it actually has much benefit.

>    * Refactor CROSSCALL_INIT to use "do { ... } while (0)" to be
>      compatible with scripts/checkpatch.pl
Good to tidy that up.

>    * Remove unnecessary space before @event in sdei_do_cross_call()

Good change, but seems to have gotten lost in this patch.

> 
> Signed-off-by: Gavin Shan <gshan at redhat.com>
> ---
> v2: Drop changes to sdei_cross_call_return()
>     Remove unnecessary space before @event in sdei_do_cross_call()
> ---
>  drivers/firmware/arm_sdei.c | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/firmware/arm_sdei.c b/drivers/firmware/arm_sdei.c
> index d03371161aaf..04dc144a8f31 100644
> --- a/drivers/firmware/arm_sdei.c
> +++ b/drivers/firmware/arm_sdei.c
> @@ -73,14 +73,17 @@ static LIST_HEAD(sdei_list);
>  
>  /* Private events are registered/enabled via IPI passing one of these */
>  struct sdei_crosscall_args {
> -	struct sdei_event *event;
> -	atomic_t errors;
> -	int first_error;
> +	struct sdei_event	*event;
> +	atomic_t		errors;
> +	int			first_error;
>  };
>  
> -#define CROSSCALL_INIT(arg, event)	(arg.event = event, \
> -					 arg.first_error = 0, \
> -					 atomic_set(&arg.errors, 0))
> +#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(void *fn, struct sdei_event * event)
>  {





More information about the linux-arm-kernel mailing list