On Mon, Oct 27, 2025 at 08:01:59PM -0400, Pasha Tatashin wrote:
> > > static void *xa_load_or_alloc(struct xarray *xa, unsigned long index,
> > > size_t sz)
> > > {
> > > - void *elm, *res;
> > > + void *res = xa_load(xa, index);
> > >
> > > - elm = xa_load(xa, index);
> > > - if (elm)
> > > - return elm;
> > > + if (res)
> > > + return res;
> > > +
> > > + void *elm __free(kfree) = kzalloc(sz, GFP_KERNEL);
> >
> > nit: This breaks the local style of always declaring variables at the
> > beginning of blocks.
>
> I think this suggestion came from Mike, to me it looks alright, as it
> is only part of the clean-up path.
It is the recommended style for using cleanup.h stuff, declare and
assign in one statement.
Jason