aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_event.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2011-03-16 08:29:35 -0400
committerGustavo F. Padovan <padovan@profusion.mobi>2011-03-31 13:22:54 -0400
commit1f6c6378c59f3ddac9ed89a68ccefe2611300c09 (patch)
tree14dd2ecd69225f3535f72c461575d289c879dd2f /net/bluetooth/hci_event.c
parentf0681a68dd3a32699891cd1de93459aee5af7728 (diff)
Bluetooth: Add define for the maximum name length on HCI level
This patch adds a clear define for the maximum device name length in HCI messages and thereby avoids magic numbers in the code. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r--net/bluetooth/hci_event.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 3fbfa50c2bff..91ef52673ed3 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -200,7 +200,7 @@ static void hci_cc_write_local_name(struct hci_dev *hdev, struct sk_buff *skb)
200 if (!sent) 200 if (!sent)
201 return; 201 return;
202 202
203 memcpy(hdev->dev_name, sent, 248); 203 memcpy(hdev->dev_name, sent, HCI_MAX_NAME_LENGTH);
204} 204}
205 205
206static void hci_cc_read_local_name(struct hci_dev *hdev, struct sk_buff *skb) 206static void hci_cc_read_local_name(struct hci_dev *hdev, struct sk_buff *skb)
@@ -212,7 +212,7 @@ static void hci_cc_read_local_name(struct hci_dev *hdev, struct sk_buff *skb)
212 if (rp->status) 212 if (rp->status)
213 return; 213 return;
214 214
215 memcpy(hdev->dev_name, rp->name, 248); 215 memcpy(hdev->dev_name, rp->name, HCI_MAX_NAME_LENGTH);
216} 216}
217 217
218static void hci_cc_write_auth_enable(struct hci_dev *hdev, struct sk_buff *skb) 218static void hci_cc_write_auth_enable(struct hci_dev *hdev, struct sk_buff *skb)