Re: [PATCH v3 10/23] clk: Add clock driver for the RISC-V RPMI clock service group

Andy Shevchenko
2025-05-12T14:15:13Z

On Mon, May 12, 2025 at 03:28:37PM +0530, Rahul Pathak wrote:
> On Mon, May 12, 2025 at 12:38 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> > On Sun, May 11, 2025 at 07:09:26PM +0530, Anup Patel wrote:

...

> > > +struct rpmi_get_supp_rates_rx {
> > > + u32 status;
> > > + u32 flags;
> > > + u32 remaining;
> > > + u32 returned;
> > > + u32 rates[];
> > > +};
> >
> > Is it ABI? (I mean if this is interface with some kind of FW)
> > If so, Use proper endianess aware types. Same Q for all data
> > types defined in this driver.
>
> Sure.
>
> It's the message format defined by the RISC-V RPMI spec.

So, use the endianess as provided. Or is it always native endianess?

...

> > > + devm_kfree(context->dev, rx);
> >
> > Why?! This is a red flag to point that here is misunderstanding or abuse of
> > managed resources approach. Either use __Free() from cleanup.h or don't call
> > devm_kfree(). The latter must have a very good justification to explain why.
>
> Yeah, I think it's better to use kzalloc for this case and then free it.

Instead of freeing it explicitly consider using cleanup.h, i.e. __free().

--
With Best Regards,
Andy Shevchenko