[PATCH 03/14] drivers/firmware/sdei: Dereference SDEI event parameter directly

Gavin Shan gshan at redhat.com
Tue Jul 21 22:38:50 EDT 2020


Hi James,

On 7/22/20 6:41 AM, James Morse wrote:
> On 06/07/2020 06:47, Gavin Shan wrote:
>> The SDEI parameter is dereferenced by @sdei_event->registered or
>> @sdei_event->private_registered, depending on the event type.
> 
>> They
>> can be dereferenced directly so that the intermediate variable
>> (@regs) can be removed.
> 
> Unless its there to make it obvious that the shared/private blocks of this are doing the
> same work.
> 
> 
>> It makes the code looks a bit simplified.
> 
> I disagree.
> 

Well, @regs can be removed and the scope of @reg is narrowed.
However, it might be not worthy for the effort. I will drop
this part of changes in v2.

> 
>> Also, @event->event_num instead of @event_num is used for retrieving
>> the event number for the shared event, which makes the code similar
>> to the case of private event.
> 
> Sure, this is an an inconsistency that could be changed. But I don't think its worth the
> effort!
> 

Yes, but I think it's still worthy to make the code consistent.
Lets keep this change in v2 only. All other changes will be
dropped.

> 
>> Besides, the local scoped variables
>> are reordered according to their importance by the way.
> 
> Please: never do this.
> 

Sure.

Thanks,
Gavin




More information about the linux-arm-kernel mailing list