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

Gavin Shan gshan at redhat.com
Sun Jul 26 20:33:46 EDT 2020


Hi Jonathan,

On 7/24/20 1:52 AM, Jonathan Cameron wrote:
> 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
> 

It will be fixed in v3.

>> changes is introduced:
> 
> changes are introduced:
> 

It will be fixed in v3.

>>
>>     * 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.
> 

Sorry, I guess you're talking about "./scripts/cleanpatch"? As stated
in the head of the script, the result would be destructive. So I think
manual changes would be more reliable. Lets keep this in v3 if you agree.

Extracted from "scripts/cleanpatch":

# Clean a patch file -- or directory of patch files -- of stealth whitespace.
# WARNING: this can be a highly destructive operation.  Use with caution.
#


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

Thanks.

>>     * Remove unnecessary space before @event in sdei_do_cross_call()
> 
> Good change, but seems to have gotten lost in this patch.
> 

Thanks.

>>
>> 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)
>>   {
> 

Thanks,
Gavin




More information about the linux-arm-kernel mailing list