Re: [PATCH v2 1/3] usb: misc: onboard-hub: support multiple power supplies

From: Benjamin Bara
Date: Thu Jun 22 2023 - 01:32:08 EST


Hi!

Thank you for the feedback!

On Thu, 22 Jun 2023 at 07:16, Alexander Stein <alexander.stein@xxxxxxxxxxxxxxx> wrote:
> Am Mittwoch, 21. Juni 2023, 16:57:03 CEST schrieb Matthias Kaehlcke:
> > > +#define SUPPLIES_NUM_MAX 2
> >
> > MAX_SUPPLIES?
>
> Do we need this MAX_SUPPLIES macro at all? This essentially is
> ARRAY_SIZE(supply_names), no? At least it should be
> > #define MAX_SUPPLIES ARRAY_SIZE(supply_names)

Thanks for the catch, will adapt.

> >       if (hub->pdata->supplies_num != 0)
> >               hub->supplies_num = hub->pdata->supplies_num;
> >       else
> >               hub->supplies_num = 1;
> >
>
> In the kernel there is also this style:
> > hub->supplies_num = hub->pdata->supplies_num? : 1;

I dropped it in v4[1].

br,
Benjamin

[1] https://lore.kernel.org/lkml/20230620-hx3-v4-0-e56b3c6db60b@xxxxxxxxxxx/