Re: [PATCH v2] i2c: cp2615: handle allocation failure

From: Triet Hoang

Date: Fri Aug 28 2026 - 23:42:47 EST


On Fri, 28 Aug 2026 19:09:03 +0200 Andi Shyti wrote:

> Next time please don't send your v2 as in reply to v1. It
> confuses me.

Sorry about that. Will keep it in my mind!

> Your patch looks good, but, as you are at it, can I ask you here
> a little effort? Personally I don't like and I find unreadable
> the form:
>
> struct cp2615_iop_msg *msg = kzalloc_obj(*msg);
> ...
>
> if (!msg)
> return -ENOMEM.
>
> Important assignments, like kzalloc_*(), shouldn't be made during
> declaration. I prefer the form:
>
>
> struct cp2615_iop_msg *msg;
> ...
>
> msg = kzalloc_obj(*msg);
> if (!msg)
> return -ENOMEM.
>
> Works for you? Do you mind updating in v3?

Sure, no problem. I will update and send the v3.
Thanks for your reviewing and suggestion!

Regards,
Triet