Skip to contentSkip to conversation

net/bluetooth/: possible cleanups

PATCH In review Adrian Bunk 2 participants 2 messages May 5, 2005

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/bluetooth/: possible cleanups

This patch contains the following possible cleanups:
- #ifdef HCI_DATA_DUMP the following function:
lib.c: bt_dump
- #if 0 the following unused global functions:
- hci_core.c: hci_suspend_dev
- hci_core.c: hci_resume_dev
- remove the following unneeded EXPORT_SYMBOL's:
- hci_core.c: hci_dev_get
- hci_core.c: hci_send_cmd
- hci_event.c: hci_si_event

Please review which of these changes do make sense and which conflict with pending patches.

---

 include/net/bluetooth/hci_core.h |    2 --
 net/bluetooth/hci_core.c         |    6 ++++--
 net/bluetooth/hci_event.c        |    1 -
 net/bluetooth/lib.c              |    2 ++
 4 files changed, 6 insertions(+), 5 deletions(-)
include/net/bluetooth/hci_core.h renamed from include/net/bluetooth/hci_core.h.old +0 -2
@@ -375,8 +375,6 @@
 void hci_free_dev(struct hci_dev *hdev);
 int hci_register_dev(struct hci_dev *hdev);
 int hci_unregister_dev(struct hci_dev *hdev);
-int hci_suspend_dev(struct hci_dev *hdev);
-int hci_resume_dev(struct hci_dev *hdev);
 int hci_dev_open(__u16 dev);
 int hci_dev_close(__u16 dev);
 int hci_dev_reset(__u16 dev);
net/bluetooth/hci_core.c renamed from net/bluetooth/hci_core.c.old +4 -2
@@ -299,7 +299,6 @@
 	read_unlock(&hci_dev_list_lock);
 	return hdev;
 }
-EXPORT_SYMBOL(hci_dev_get);
 
 /* ---- Inquiry support ---- */
 static void inquiry_cache_flush(struct hci_dev *hdev)
@@ -899,6 +898,8 @@
 }
 EXPORT_SYMBOL(hci_unregister_dev);
 
+#if 0
+
 /* Suspend HCI device */
 int hci_suspend_dev(struct hci_dev *hdev)
 {
@@ -915,6 +916,8 @@
 }
 EXPORT_SYMBOL(hci_resume_dev);
 
+#endif  /*  0  */
+
 /* ---- Interface to upper protocols ---- */
 
 /* Register/Unregister protocols.
@@ -1042,7 +1045,6 @@
 
 	return 0;
 }
-EXPORT_SYMBOL(hci_send_cmd);
 
 /* Get data from the previously sent command */
 void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 ogf, __u16 ocf)
net/bluetooth/lib.c renamed from net/bluetooth/lib.c.old +2 -0
@@ -34,6 +34,7 @@
 
 #include <net/bluetooth/bluetooth.h>
 
+#ifdef HCI_DATA_DUMP
 void bt_dump(char *pref, __u8 *buf, int count)
 {
 	char *ptr;
@@ -58,6 +59,7 @@
 		printk(KERN_INFO "%s:%s\n", pref, line);
 }
 EXPORT_SYMBOL(bt_dump);
+#endif  /*  HCI_DATA_DUMP  */
 
 void baswap(bdaddr_t *dst, bdaddr_t *src)
 {
net/bluetooth/hci_event.c renamed from net/bluetooth/hci_event.c.old +0 -1
@@ -1040,4 +1040,3 @@
 	hci_send_to_sock(hdev, skb);
 	kfree_skb(skb);
 }
-EXPORT_SYMBOL(hci_si_event);
maintainer
#1 lore raw

Hi Adrian,

Quoted 11 lines

This patch contains the following possible cleanups:
- #ifdef HCI_DATA_DUMP the following function:
lib.c: bt_dump
- #if 0 the following unused global functions:
- hci_core.c: hci_suspend_dev
- hci_core.c: hci_resume_dev
- remove the following unneeded EXPORT_SYMBOL's:
- hci_core.c: hci_dev_get
- hci_core.c: hci_send_cmd
- hci_event.c: hci_si_event

Quoted 2 lines

Please review which of these changes do make sense and which conflict with pending patches.

I like to let hci_suspend_dev() and hci_resume_dev() stay for now. No driver uses it, but actually nobody really looked deep enough to really understand the needs for suspend of Bluetooth devices.

The hci_dev_get(), hci_send_cmd() and hci_si_event() doesn't need to be exported. And I think that the bt_dump() and and BT_DMP() stuff can be removed completely.

Please redo the patch and actually it is enough to copy the bluez-devel mailing list. I will take care of getting it back into mainline.

Regards

Marcel