public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrei Emeltchenko <andrei.emeltchenko.news@gmail.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] Bluetooth: Fix registering HCI devices with duplicate name
Date: Thu, 12 Apr 2012 13:45:24 +0300	[thread overview]
Message-ID: <20120412104521.GA2779@aemeltch-MOBL1> (raw)
In-Reply-To: <1334225714.16897.142.camel@aeonflux>

Hi Marcel,

On Thu, Apr 12, 2012 at 12:15:14PM +0200, Marcel Holtmann wrote:
> 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.

Best regards 
Andrei Emeltchenko 

> the second time you only run until you found a free spot, but
> nevertheless, you run it again.
> 
> Regards
> 
> Marcel
> 
> 

  reply	other threads:[~2012-04-12 10:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-11 15:32 [PATCH] Bluetooth: Fix registering HCI devices with duplicate name Marcel Holtmann
2012-04-12  7:38 ` Andrei Emeltchenko
2012-04-12  9:50   ` Marcel Holtmann
2012-04-12 10:03     ` Andrei Emeltchenko
2012-04-12 10:15       ` Marcel Holtmann
2012-04-12 10:45         ` Andrei Emeltchenko [this message]
2012-04-12 10:50           ` Marcel Holtmann
2012-04-12 11:39 ` Andrei Emeltchenko
2012-04-13  8:29   ` Andrei Emeltchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120412104521.GA2779@aemeltch-MOBL1 \
    --to=andrei.emeltchenko.news@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox