linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: vinicius.gomes@openbossa.org
Cc: linux-bluetooth@vger.kernel.org
Subject: re: Bluetooth: Use the updated key structures for handling LTKs
Date: Wed, 7 Mar 2012 14:44:37 +0300	[thread overview]
Message-ID: <20120307114437.GA13172@elgon.mountain> (raw)

Hello Vinicius Costa Gomes,

The patch c9839a11c0e4: "Bluetooth: Use the updated key structures 
for handling LTKs" from Feb 2, 2012, leads to the following Sparse
warning: net/bluetooth/mgmt.c:2590:59: warning: incorrect type in
argument 9 (different base types)

+int hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 addr_type, u8 type,
+                               int new_key, u8 authenticated, u8 tk[16],
+                               u8 enc_size, u16 ediv, u8 rand[8]);
                                             ^^^^^^^^
+struct smp_ltk *hci_find_ltk_by_addr(struct hci_dev *hdev, bdaddr_t *bdaddr,
+                                                               u8 addr_type);
 int hci_remove_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr);
-int hci_add_ltk(struct hci_dev *hdev, int new_key, bdaddr_t *bdaddr,
-                       u8 key_size, __le16 ediv, u8 rand[8], u8 ltk[16]);
                                     ^^^^^^^^^^^
 int hci_smp_ltks_clear(struct hci_dev *hdev);

We removed the endian notation from ediv, but it seems from a quick read
that the __le16 was correct.  Btw, here is an article on how to use
Sparse to find endian bugs:  http://lwn.net/Articles/205624/

regards,
dan carpenter


             reply	other threads:[~2012-03-07 11:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-07 11:44 Dan Carpenter [this message]
2012-03-07 18:02 ` Bluetooth: Use the updated key structures for handling LTKs Vinicius Costa Gomes

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=20120307114437.GA13172@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=vinicius.gomes@openbossa.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;
as well as URLs for NNTP newsgroup(s).