linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: Szymon Janc <szymon.janc@tieto.com>
Cc: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH] adapter: Fix compilation on some architectures
Date: Wed, 5 Dec 2012 13:14:30 +0200	[thread overview]
Message-ID: <20121205111430.GA5233@x220.ger.corp.intel.com> (raw)
In-Reply-To: <1564894.mIcBMGi0ah@uw000953>

Hi Szymon,

On Wed, Dec 05, 2012, Szymon Janc wrote:
> > > --- a/src/adapter.c
> > > +++ b/src/adapter.c
> > > @@ -2673,7 +2673,7 @@ static void convert_ltk_entry(GKeyFile *key_file, void *value)
> > >  static void convert_entry(char *key, char *value, void *user_data)
> > >  {
> > >  	struct device_converter *converter = user_data;
> > > -	char device_type = -1;
> > > +	signed char device_type = -1;
> > >  	char filename[PATH_MAX + 1];
> > >  	GKeyFile *key_file;
> > >  	char *data;
> > 
> > Couldn't we just initialize the value to BDADDR_BREDR or maybe use an
> > int for it. And the naming is confusing as the value contains an address
> > type and not a device type.
> 
> Initializing it to BDADDR_BREDR wouldn't fix compilation as problem is in
> comparing >=0 when type is unsigned (and would change function flow as now
> device_set_type is called only if device_type is >=0)...  I'm not sure what
> was decided about storage changes so didn't wanted to fiddle with that.

I meant that you'd also then remove the test for >= 0 and always write
the type (defaulting to BR/EDR)

> So, if it is OK to always fall back to BDADDR_BREDR I can resent V2 with that
> change, else I can sent V2 with use of int if you prefer it over signed char.

I'd just default to BDADDR_BREDR. That's what entries without an
explicit type are going to be anyway since older BlueZ versions didn't
support LE.

Johan

  reply	other threads:[~2012-12-05 11:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-05 10:02 [PATCH] adapter: Fix compilation on some architectures Szymon Janc
2012-12-05 10:29 ` Johan Hedberg
2012-12-05 11:06   ` Szymon Janc
2012-12-05 11:14     ` Johan Hedberg [this message]
2012-12-05 12:32       ` [PATCH] adapter: Always write address type when converting to new storage Szymon Janc
2012-12-05 14:28         ` Johan Hedberg

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=20121205111430.GA5233@x220.ger.corp.intel.com \
    --to=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=szymon.janc@tieto.com \
    /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;
as well as URLs for NNTP newsgroup(s).