Search Linux Wireless

Re: [PATCH v2 04/35] brcmfmac: firmware: Support having multiple alt paths

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 7, 2022 at 5:12 AM Dmitry Osipenko <digetx@xxxxxxxxx> wrote:
> 06.01.2022 20:58, Andy Shevchenko пишет:
> > On Thu, Jan 6, 2022 at 7:40 PM Dmitry Osipenko <digetx@xxxxxxxxx> wrote:
> >> 05.01.2022 16:22, Hector Martin пишет:

...

> >> while (alt_paths.index)
> >>         kfree(alt_paths.path[--alt_paths.index]);
> >
> > Usual pattern is
> >
> >   while (x--)
> >     kfree(x);

I have to elaborate that my point is to have postdecrement in the
while() instead of doing predecrement in its body. So the above
example will look

  while (alt_paths.index--)
    kfree(alt_paths.path[alt_paths.index]);

> > easier to read, extend (if needed).
>
> That is indeed a usual patter for the driver removal code paths. I
> didn't like to have index of struct brcmf_fw underflowed, but I see now
> that fwctx is dynamically created and freed during driver probe, so it
> should be fine to use that usual pattern here too.



-- 
With Best Regards,
Andy Shevchenko




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux