aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2015-04-04 23:59:41 -0400
committerMarcel Holtmann <marcel@holtmann.org>2015-04-07 12:47:09 -0400
commit9d1c40ebb66416f166b92c6828af48549ca99307 (patch)
treef9071750b40ce62a798a47cb861d1dc4a7cc1c86 /drivers/bluetooth
parent5c7d2dd2852c7cd8f07cf91291b351c01b781044 (diff)
Bluetooth: hci_uart: Use const data pointer for received data
The TTY layer provides its data pointers as const, but the HCI UART callbacks expect them as general data pointers. This is of course wrong and instead of casting them, just fix the individual drivers to actually take a const data pointer. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r--drivers/bluetooth/hci_ath.c2
-rw-r--r--drivers/bluetooth/hci_bcsp.c4
-rw-r--r--drivers/bluetooth/hci_h4.c2
-rw-r--r--drivers/bluetooth/hci_h5.c4
-rw-r--r--drivers/bluetooth/hci_ldisc.c2
-rw-r--r--drivers/bluetooth/hci_ll.c4
-rw-r--r--drivers/bluetooth/hci_uart.h2
7 files changed, 10 insertions, 10 deletions
diff --git a/drivers/bluetooth/hci_ath.c b/drivers/bluetooth/hci_ath.c
index 9c4dcf4c62ea..4e89d3e33b7b 100644
--- a/drivers/bluetooth/hci_ath.c
+++ b/drivers/bluetooth/hci_ath.c
@@ -188,7 +188,7 @@ static struct sk_buff *ath_dequeue(struct hci_uart *hu)
188} 188}
189 189
190/* Recv data */ 190/* Recv data */
191static int ath_recv(struct hci_uart *hu, void *data, int count) 191static int ath_recv(struct hci_uart *hu, const void *data, int count)
192{ 192{
193 int ret; 193 int ret;
194 194
diff --git a/drivers/bluetooth/hci_bcsp.c b/drivers/bluetooth/hci_bcsp.c
index 21cc45b34f13..50ef2e613d59 100644
--- a/drivers/bluetooth/hci_bcsp.c
+++ b/drivers/bluetooth/hci_bcsp.c
@@ -554,10 +554,10 @@ static u16 bscp_get_crc(struct bcsp_struct *bcsp)
554} 554}
555 555
556/* Recv data */ 556/* Recv data */
557static int bcsp_recv(struct hci_uart *hu, void *data, int count) 557static int bcsp_recv(struct hci_uart *hu, const void *data, int count)
558{ 558{
559 struct bcsp_struct *bcsp = hu->priv; 559 struct bcsp_struct *bcsp = hu->priv;
560 unsigned char *ptr; 560 const unsigned char *ptr;
561 561
562 BT_DBG("hu %p count %d rx_state %d rx_count %ld", 562 BT_DBG("hu %p count %d rx_state %d rx_count %ld",
563 hu, count, bcsp->rx_state, bcsp->rx_count); 563 hu, count, bcsp->rx_state, bcsp->rx_count);
diff --git a/drivers/bluetooth/hci_h4.c b/drivers/bluetooth/hci_h4.c
index 0d9ba07d2730..97a5df4941b4 100644
--- a/drivers/bluetooth/hci_h4.c
+++ b/drivers/bluetooth/hci_h4.c
@@ -113,7 +113,7 @@ static int h4_enqueue(struct hci_uart *hu, struct sk_buff *skb)
113} 113}
114 114
115/* Recv data */ 115/* Recv data */
116static int h4_recv(struct hci_uart *hu, void *data, int count) 116static int h4_recv(struct hci_uart *hu, const void *data, int count)
117{ 117{
118 int ret; 118 int ret;
119 119
diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c
index ec0fa7732c0d..0f681cc1af64 100644
--- a/drivers/bluetooth/hci_h5.c
+++ b/drivers/bluetooth/hci_h5.c
@@ -511,10 +511,10 @@ static void h5_reset_rx(struct h5 *h5)
511 clear_bit(H5_RX_ESC, &h5->flags); 511 clear_bit(H5_RX_ESC, &h5->flags);
512} 512}
513 513
514static int h5_recv(struct hci_uart *hu, void *data, int count) 514static int h5_recv(struct hci_uart *hu, const void *data, int count)
515{ 515{
516 struct h5 *h5 = hu->priv; 516 struct h5 *h5 = hu->priv;
517 unsigned char *ptr = data; 517 const unsigned char *ptr = data;
518 518
519 BT_DBG("%s pending %zu count %d", hu->hdev->name, h5->rx_pending, 519 BT_DBG("%s pending %zu count %d", hu->hdev->name, h5->rx_pending,
520 count); 520 count);
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index a3b906bcfca6..50dbaf3579ed 100644
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -441,7 +441,7 @@ static void hci_uart_tty_receive(struct tty_struct *tty, const u8 *data,
441 return; 441 return;
442 442
443 spin_lock(&hu->rx_lock); 443 spin_lock(&hu->rx_lock);
444 hu->proto->recv(hu, (void *) data, count); 444 hu->proto->recv(hu, data, count);
445 445
446 if (hu->hdev) 446 if (hu->hdev)
447 hu->hdev->stat.byte_rx += count; 447 hu->hdev->stat.byte_rx += count;
diff --git a/drivers/bluetooth/hci_ll.c b/drivers/bluetooth/hci_ll.c
index 69a90b1b5ff5..79eea1cbd988 100644
--- a/drivers/bluetooth/hci_ll.c
+++ b/drivers/bluetooth/hci_ll.c
@@ -370,10 +370,10 @@ static inline int ll_check_data_len(struct hci_dev *hdev, struct ll_struct *ll,
370} 370}
371 371
372/* Recv data */ 372/* Recv data */
373static int ll_recv(struct hci_uart *hu, void *data, int count) 373static int ll_recv(struct hci_uart *hu, const void *data, int count)
374{ 374{
375 struct ll_struct *ll = hu->priv; 375 struct ll_struct *ll = hu->priv;
376 char *ptr; 376 const char *ptr;
377 struct hci_event_hdr *eh; 377 struct hci_event_hdr *eh;
378 struct hci_acl_hdr *ah; 378 struct hci_acl_hdr *ah;
379 struct hci_sco_hdr *sh; 379 struct hci_sco_hdr *sh;
diff --git a/drivers/bluetooth/hci_uart.h b/drivers/bluetooth/hci_uart.h
index 4dc8ab3009a9..79bbcefb0112 100644
--- a/drivers/bluetooth/hci_uart.h
+++ b/drivers/bluetooth/hci_uart.h
@@ -60,7 +60,7 @@ struct hci_uart_proto {
60 int (*open)(struct hci_uart *hu); 60 int (*open)(struct hci_uart *hu);
61 int (*close)(struct hci_uart *hu); 61 int (*close)(struct hci_uart *hu);
62 int (*flush)(struct hci_uart *hu); 62 int (*flush)(struct hci_uart *hu);
63 int (*recv)(struct hci_uart *hu, void *data, int len); 63 int (*recv)(struct hci_uart *hu, const void *data, int len);
64 int (*enqueue)(struct hci_uart *hu, struct sk_buff *skb); 64 int (*enqueue)(struct hci_uart *hu, struct sk_buff *skb);
65 int (*setup)(struct hci_uart *hu); 65 int (*setup)(struct hci_uart *hu);
66 struct sk_buff *(*dequeue)(struct hci_uart *hu); 66 struct sk_buff *(*dequeue)(struct hci_uart *hu);