Linux bluetooth development
 help / color / mirror / Atom feed
From: Andrei Emeltchenko <Andrei.Emeltchenko.news@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 1/2] Bluetooth: Use defined link key size
Date: Mon, 21 May 2012 15:25:56 +0300	[thread overview]
Message-ID: <20120521122554.GB30424@aemeltch-MOBL1> (raw)
In-Reply-To: <20120518144044.GA5494@x220.P-661HNU-F1>

Hi Johan,

On Fri, May 18, 2012 at 05:40:44PM +0300, Johan Hedberg wrote:
> Hi Andrei,
> 
> On Fri, May 18, 2012, Andrei Emeltchenko wrote:
> > Remove magic number with defined link key size. This is especially
> > useful for calculation other keys which are 2 * key_size, etc that
> > makes usage of magic numbers too much.
> > 
> > Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> > ---
> >  include/net/bluetooth/bluetooth.h |    2 ++
> >  include/net/bluetooth/hci.h       |    4 ++--
> >  include/net/bluetooth/hci_core.h  |    2 +-
> >  net/bluetooth/hci_core.c          |    2 +-
> >  net/bluetooth/hci_event.c         |    2 +-
> >  net/bluetooth/mgmt.c              |    2 +-
> >  6 files changed, 8 insertions(+), 6 deletions(-)
> > 
> > diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
> > index 961669b..4abedfe 100644
> > --- a/include/net/bluetooth/bluetooth.h
> > +++ b/include/net/bluetooth/bluetooth.h
> > @@ -68,6 +68,8 @@ struct bt_security {
> >  #define BT_SECURITY_MEDIUM	2
> >  #define BT_SECURITY_HIGH	3
> >  
> > +#define BT_SEC_LINK_KEY_SIZE		16
> 
> The patch seems ok'ish to me but I'd remove the _SEC part from the
> define name since it doesn't really buy you anything. 

Sent new version with a name proposed by Marcel.

> Also, I'm a bit
> confused by the commit message. What other keys are "2 * key_size"?

This is AMP key size which is calculated from link keys.

> There are no such occurrences in the patch itself so you should at least
> give some examples in the commit message.

I deleted this from the patch description.

Best regards 
Andrei Emeltchenko 

  reply	other threads:[~2012-05-21 12:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-18 14:20 [PATCH 1/2] Bluetooth: Use defined link key size Andrei Emeltchenko
2012-05-18 14:20 ` [PATCH 2/2] Bluetooth: Define L2CAP conf continuation flag Andrei Emeltchenko
2012-05-18 16:55   ` Marcel Holtmann
2012-05-21 12:10     ` Andrei Emeltchenko
2012-05-18 14:40 ` [PATCH 1/2] Bluetooth: Use defined link key size Johan Hedberg
2012-05-21 12:25   ` Andrei Emeltchenko [this message]
2012-05-18 16:30 ` Marcel Holtmann
2012-05-21 12:10 ` [PATCHv2 1/3] " Andrei Emeltchenko
2012-05-21 12:10   ` [PATCHv2 2/3] Bluetooth: Define L2CAP conf continuation flag Andrei Emeltchenko
2012-05-21 12:11   ` [PATCHv2 3/3] Bluetooth: Preserve flags values 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=20120521122554.GB30424@aemeltch-MOBL1 \
    --to=andrei.emeltchenko.news@gmail.com \
    --cc=linux-bluetooth@vger.kernel.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