Re: [PATCH] serial: core: Fix serial core port id, including multiport devices

From: Tony Lindgren
Date: Fri Aug 11 2023 - 01:11:40 EST


* Andy Shevchenko <andriy.shevchenko@xxxxxxxxx> [230810 15:26]:
> On Thu, Aug 10, 2023 at 06:24:13PM +0300, Andy Shevchenko wrote:
> > On Thu, Aug 10, 2023 at 09:57:34AM +0300, Tony Lindgren wrote:
>
> ...
>
> > > + unsigned int min = 0, max = ~0U;
> >
> > Shouldn't this be int? The max IIRC will be INT_MAX with this anyway.
>
> Ah, and then you can supply is as 0 (IIRC).

The returned id will be INT_MAX, but idr.h uses unsigned int:

int ida_alloc_range(struct ida *, unsigned int min, unsigned int max, gfp_t);

If there's some reason to limit max id we can do it, otherwise it's just
a don't care flag.

Please clarify if I'm not following what you are suggesting :)

Regards,

Tony