提交 2e3c35ea 编写于 作者: A Andrei Emeltchenko 提交者: Gustavo Padovan

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: NAndrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: NMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
上级 1f350c87
...@@ -288,7 +288,7 @@ static int read_commands(struct sock *sk, struct hci_dev *hdev, void *data, ...@@ -288,7 +288,7 @@ static int read_commands(struct sock *sk, struct hci_dev *hdev, void *data,
struct mgmt_rp_read_commands *rp; struct mgmt_rp_read_commands *rp;
const u16 num_commands = ARRAY_SIZE(mgmt_commands); const u16 num_commands = ARRAY_SIZE(mgmt_commands);
const u16 num_events = ARRAY_SIZE(mgmt_events); const u16 num_events = ARRAY_SIZE(mgmt_events);
u16 *opcode; __le16 *opcode;
size_t rp_size; size_t rp_size;
int i, err; int i, err;
...@@ -2647,7 +2647,7 @@ static int load_long_term_keys(struct sock *sk, struct hci_dev *hdev, ...@@ -2647,7 +2647,7 @@ static int load_long_term_keys(struct sock *sk, struct hci_dev *hdev,
return 0; return 0;
} }
struct mgmt_handler { static const struct mgmt_handler {
int (*func) (struct sock *sk, struct hci_dev *hdev, void *data, int (*func) (struct sock *sk, struct hci_dev *hdev, void *data,
u16 data_len); u16 data_len);
bool var_len; bool var_len;
...@@ -2704,7 +2704,7 @@ int mgmt_control(struct sock *sk, struct msghdr *msg, size_t msglen) ...@@ -2704,7 +2704,7 @@ int mgmt_control(struct sock *sk, struct msghdr *msg, size_t msglen)
struct mgmt_hdr *hdr; struct mgmt_hdr *hdr;
u16 opcode, index, len; u16 opcode, index, len;
struct hci_dev *hdev = NULL; struct hci_dev *hdev = NULL;
struct mgmt_handler *handler; const struct mgmt_handler *handler;
int err; int err;
BT_DBG("got %zu bytes", msglen); BT_DBG("got %zu bytes", msglen);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册