Re: [PATCH v4] staging: greybus: Convert uart.c from IDR to XArray

From: Fabio M. De Francesco
Date: Mon Aug 30 2021 - 09:16:40 EST


On Monday, August 30, 2021 2:33:05 PM CEST Johan Hovold wrote:
> On Mon, Aug 30, 2021 at 01:16:07PM +0100, Matthew Wilcox wrote:
> > On Mon, Aug 30, 2021 at 01:52:48PM +0200, Johan Hovold wrote:
> > > Whether the API is better is debatable. As I said, almost no drivers use
> > > the new XArray interface, and perhaps partly because the new interface
> > > isn't as intuitive as has been claimed (e.g. xa_load() instead of
> > > ida_find()). And IDR/IDA isn't marked/documented as deprecated as far as
> > > I know.
> >
> > I can't just slap a 'deprecated' attribute on it. That'll cause a
> > storm of warnings. What would you suggest I do to warn people that
> > this interface is deprecated and I would like to remove it?
>
> I'd at least expect a suggestion in the IDR documentation to consider
> using XArray instead.
>
> > Why do you think that idr_find() is more intuitive than xa_load()?
> > The 'find' verb means that you search for something. But it doesn't
> > search for anything; it just returns the pointer at that index.
> > 'find' should return the next non-NULL pointer at-or-above a given
> > index.
>
> We're looking up a minor number which may or may not exist. "Find" (or
> "lookup" or "search") seems to describe this much better than "load"
> (even if that may better reflect the implementation of XArray).
>
> And no, I would not expect a find implementation to return the next
> entry if the requested entry does not exist (and neither does idr_find()
> or radix_tree_lookup()).
>
> Johan
>
Dear Johan,

Since your are not interested to this changes there's no need to restore the
Mutexes that were in v1. Please drop the patch and sorry for the noise.

Regards,

Fabio