All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] Bluetooth: Make data pointer of hci_recv_stream_fragment const
@ 2015-04-05  3:59 Marcel Holtmann
  2015-04-05  6:24 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Marcel Holtmann @ 2015-04-05  3:59 UTC (permalink / raw)
  To: linux-bluetooth

The data pointer provided to hci_recv_stream_fragment function should
have been marked const. The function has no business in modifying the
original data. So fix this now.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
---
 include/net/bluetooth/hci_core.h | 2 +-
 net/bluetooth/hci_core.c         | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 93fd3e756b8a..ad957f336ead 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -1012,7 +1012,7 @@ int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr,
 void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb);
 
 int hci_recv_frame(struct hci_dev *hdev, struct sk_buff *skb);
-int hci_recv_stream_fragment(struct hci_dev *hdev, void *data, int count);
+int hci_recv_stream_fragment(struct hci_dev *hdev, const void *data, int count);
 
 void hci_init_sysfs(struct hci_dev *hdev);
 void hci_conn_init_sysfs(struct hci_conn *conn);
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 46b114c0140b..c9e7cafb245a 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -3320,7 +3320,7 @@ int hci_recv_frame(struct hci_dev *hdev, struct sk_buff *skb)
 }
 EXPORT_SYMBOL(hci_recv_frame);
 
-static int hci_reassembly(struct hci_dev *hdev, int type, void *data,
+static int hci_reassembly(struct hci_dev *hdev, int type, const void *data,
 			  int count, __u8 index)
 {
 	int len = 0;
@@ -3430,7 +3430,7 @@ static int hci_reassembly(struct hci_dev *hdev, int type, void *data,
 
 #define STREAM_REASSEMBLY 0
 
-int hci_recv_stream_fragment(struct hci_dev *hdev, void *data, int count)
+int hci_recv_stream_fragment(struct hci_dev *hdev, const void *data, int count)
 {
 	int type;
 	int rem = 0;
@@ -3439,7 +3439,7 @@ int hci_recv_stream_fragment(struct hci_dev *hdev, void *data, int count)
 		struct sk_buff *skb = hdev->reassembly[STREAM_REASSEMBLY];
 
 		if (!skb) {
-			struct { char type; } *pkt;
+			const struct { char type; } *pkt;
 
 			/* Start of the frame */
 			pkt = data;
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2 1/2] Bluetooth: Make data pointer of hci_recv_stream_fragment const
  2015-04-05  3:59 [PATCH v2 1/2] Bluetooth: Make data pointer of hci_recv_stream_fragment const Marcel Holtmann
@ 2015-04-05  6:24 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2015-04-05  6:24 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: linux-bluetooth

Hi Marcel,

On Sat, Apr 04, 2015, Marcel Holtmann wrote:
> The data pointer provided to hci_recv_stream_fragment function should
> have been marked const. The function has no business in modifying the
> original data. So fix this now.
> 
> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
> ---
>  include/net/bluetooth/hci_core.h | 2 +-
>  net/bluetooth/hci_core.c         | 6 +++---
>  2 files changed, 4 insertions(+), 4 deletions(-)

Both patches have been applied to bluetooth-next. Thanks.

Johan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-04-05  6:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-05  3:59 [PATCH v2 1/2] Bluetooth: Make data pointer of hci_recv_stream_fragment const Marcel Holtmann
2015-04-05  6:24 ` Johan Hedberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.