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

James Morse james.morse at arm.com
Tue Jul 21 16:41:06 EDT 2020


Hi Gavin,

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.


> 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!


> Besides, the local scoped variables
> are reordered according to their importance by the way.

Please: never do this.


Thanks,

James



More information about the linux-arm-kernel mailing list