Re: [PATCH v3 7/9] driver core: Correct parameter check for API device_for_each_child_reverse_from()

From: Zijun Hu
Date: Tue Dec 17 2024 - 09:18:57 EST


On 2024/12/16 23:23, Jonathan Cameron wrote:
>> Correct the API's parameter @parent check by (!parent || !parent->p).
>>
>> Signed-off-by: Zijun Hu <quic_zijuhu@xxxxxxxxxxx>
> Given that 'from' implies continuation of an iteration I can see why
> it might not ever be relevant to check parent. It's harmless, but to
> my mind unnecessary.

the extra check !parent has no overhead and make this check consistent
with others in the cluster. (^^)