diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2012-03-14 12:54:15 -0400 |
---|---|---|
committer | Gustavo Padovan <gustavo@padovan.org> | 2012-05-08 23:41:32 -0400 |
commit | 2e3c35ead821498f5b0a5b6c62365fbb187420fc (patch) | |
tree | 461eefd8dc453b46d1bf4f2f5aa3706a15424c7b /net/bluetooth/mgmt.c | |
parent | 1f350c8724881fe6b1be9aa68d1e49508a6f8ab9 (diff) |
Bluetooth: trivial: Remove sparse warnings
Fix sparse warnings related to incorrect type in assignment and static
symbol. Also use const keyword. Warnings are shown below:
...
net/bluetooth/mgmt.c:305:28: warning: incorrect type in assignment
(different base types)
net/bluetooth/mgmt.c:305:28: expected unsigned short [usertype] *opcode
net/bluetooth/mgmt.c:305:28: got restricted __le16 *<noident>
...
net/bluetooth/mgmt.c:2609:3: warning: symbol 'mgmt_handlers' was not declared.
Should it be static?
...
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r-- | net/bluetooth/mgmt.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 287623c35d61..0ef4b6ca6e44 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -288,7 +288,7 @@ static int read_commands(struct sock *sk, struct hci_dev *hdev, void *data, | |||
288 | struct mgmt_rp_read_commands *rp; | 288 | struct mgmt_rp_read_commands *rp; |
289 | const u16 num_commands = ARRAY_SIZE(mgmt_commands); | 289 | const u16 num_commands = ARRAY_SIZE(mgmt_commands); |
290 | const u16 num_events = ARRAY_SIZE(mgmt_events); | 290 | const u16 num_events = ARRAY_SIZE(mgmt_events); |
291 | u16 *opcode; | 291 | __le16 *opcode; |
292 | size_t rp_size; | 292 | size_t rp_size; |
293 | int i, err; | 293 | int i, err; |
294 | 294 | ||
@@ -2647,7 +2647,7 @@ static int load_long_term_keys(struct sock *sk, struct hci_dev *hdev, | |||
2647 | return 0; | 2647 | return 0; |
2648 | } | 2648 | } |
2649 | 2649 | ||
2650 | struct mgmt_handler { | 2650 | static const struct mgmt_handler { |
2651 | int (*func) (struct sock *sk, struct hci_dev *hdev, void *data, | 2651 | int (*func) (struct sock *sk, struct hci_dev *hdev, void *data, |
2652 | u16 data_len); | 2652 | u16 data_len); |
2653 | bool var_len; | 2653 | bool var_len; |
@@ -2704,7 +2704,7 @@ int mgmt_control(struct sock *sk, struct msghdr *msg, size_t msglen) | |||
2704 | struct mgmt_hdr *hdr; | 2704 | struct mgmt_hdr *hdr; |
2705 | u16 opcode, index, len; | 2705 | u16 opcode, index, len; |
2706 | struct hci_dev *hdev = NULL; | 2706 | struct hci_dev *hdev = NULL; |
2707 | struct mgmt_handler *handler; | 2707 | const struct mgmt_handler *handler; |
2708 | int err; | 2708 | int err; |
2709 | 2709 | ||
2710 | BT_DBG("got %zu bytes", msglen); | 2710 | BT_DBG("got %zu bytes", msglen); |