Re: [PATCH] driver core: platform: Simplify platform_device_alloc()

From: Cezary Rojewski

Date: Mon Sep 28 2026 - 04:04:53 EST


On 9/25/2026 2:38 PM, Vishal Moola (Fractile) wrote:
> On Fri, Sep 25, 2026 at 11:39:28AM +0200, Cezary Rojewski wrote:
>> There is no need to double check the 'pa' object.
>>
>> Reviewed-by: Dawid Osuchowski <dawid.osuchowski@xxxxxxxxxxxxxxx>
>> Signed-off-by: Cezary Rojewski <cezary.rojewski@xxxxxxxxx>
>
> Minor nit: The commit message could be more descriptive (i.e. something
> like "Check whether platform_object allocation failed once instead of
> checking for success twice"). Although I imagine compilers are smart
> enough to avoid double checking anyway (I haven't looked at the
> generated code myself).
>
> Either way the new code is more readable, so LGTM.
>
> Reviewed-by: Vishal Moola (Fractile) <vishal.moola@xxxxxxxxx>


Thank you for the review. Given the current AI era, I tend to leave very
straight-forward messages in contrast.

And yes, I believe the compiler would optimize this out anyway but the
readability is the key benefit here.

Kind regards,
Czarek