Re: [PATCH] Bluetooth: Fix registering HCI devices with duplicate name

Marcel Holtmann
2012-04-12T10:50:19Z

Hi Andrei,

> > then lets fix the logic we have right now. It can not be that hard to
> > have this behave correctly. Find the proper next free id and find the
> > right location in the list to add it to.
>
> We are highly dependent here on ordered list which is not good IMO,
> especially given that BR/EDR shall be first element with id=0. This of
> course works well in default situation when we have only 2 controllers.
>
> > > > > BTW: Have you checked my patch version 3.
> > > >
> > > > If we have to run through that list twice, then we are doing something
> > > > wrong. Also having to run through the whole list seems pointless. We
> > > > just need to make sure that the list stays ordered.
> > >
> > > We are not running through the whole list, just until found free id.
> >
> > You are running the whole list for the bitmask creation and then a
> > second time for finding the right location in the list. Fair enough that
>
> Second run is not needed, we can just add to the tail of the list. In most
> cases list will still be ordered and this does not matter since we do not
> depend on ordered list.

can we just ensure we have an ordered list and fix this.

Regards

Marcel