public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: Marcel Holtmann <marcel@holtman.org>,
	Maxim Krasnyansky <maxk@qualcomm.com>
Cc: bluez-devel@lists.sourceforge.net
Subject: [Bluez-devel] [PATCH] change inquiry_cache to hci_inquiry_cache to avoid possible name conflicts
Date: Tue, 22 Jun 2004 14:41:48 -0700	[thread overview]
Message-ID: <20040622144148.13ef5b10@dell_ss3.pdx.osdl.net> (raw)

This patch changes the inquiry_XXX function to be either local to hci_core.c
or change name from inquiry_cache_lookup to hci_inquiry_cache_lookup to try and
reduce the potential for namespace conflicts.  There could be USB or SCSI or other
code that uses an inquiry_cache.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>

diff -Nru a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
--- a/include/net/bluetooth/hci_core.h	2004-06-22 14:38:03 -07:00
+++ b/include/net/bluetooth/hci_core.h	2004-06-22 14:38:03 -07:00
@@ -195,10 +195,8 @@
 	return jiffies - e->timestamp;
 }
 
-struct inquiry_entry *inquiry_cache_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr);
-void inquiry_cache_update(struct hci_dev *hdev, struct inquiry_info *info);
-void inquiry_cache_flush(struct hci_dev *hdev);
-int  inquiry_cache_dump(struct hci_dev *hdev, int num, __u8 *buf);
+struct inquiry_entry *hci_inquiry_cache_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr);
+void hci_inquiry_cache_update(struct hci_dev *hdev, struct inquiry_info *info);
 
 /* ----- HCI Connections ----- */
 enum {
diff -Nru a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
--- a/net/bluetooth/hci_core.c	2004-06-22 14:38:03 -07:00
+++ b/net/bluetooth/hci_core.c	2004-06-22 14:38:03 -07:00
@@ -287,7 +287,7 @@
 EXPORT_SYMBOL(hci_dev_get);
 
 /* ---- Inquiry support ---- */
-void inquiry_cache_flush(struct hci_dev *hdev)
+static void inquiry_cache_flush(struct hci_dev *hdev)
 {
 	struct inquiry_cache *cache = &hdev->inq_cache;
 	struct inquiry_entry *next  = cache->list, *e;
@@ -301,7 +301,7 @@
 	}
 }
 
-struct inquiry_entry *inquiry_cache_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr)
+struct inquiry_entry *hci_inquiry_cache_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr)
 {
 	struct inquiry_cache *cache = &hdev->inq_cache;
 	struct inquiry_entry *e;
@@ -314,14 +314,14 @@
 	return e;
 }
 
-void inquiry_cache_update(struct hci_dev *hdev, struct inquiry_info *info)
+void hci_inquiry_cache_update(struct hci_dev *hdev, struct inquiry_info *info)
 {
 	struct inquiry_cache *cache = &hdev->inq_cache;
 	struct inquiry_entry *e;
 
 	BT_DBG("cache %p, %s", cache, batostr(&info->bdaddr));
 
-	if (!(e = inquiry_cache_lookup(hdev, &info->bdaddr))) {
+	if (!(e = hci_inquiry_cache_lookup(hdev, &info->bdaddr))) {
 		/* Entry not in the cache. Add new one. */
 		if (!(e = kmalloc(sizeof(struct inquiry_entry), GFP_ATOMIC)))
 			return;
@@ -335,7 +335,7 @@
 	cache->timestamp = jiffies;
 }
 
-int inquiry_cache_dump(struct hci_dev *hdev, int num, __u8 *buf)
+static int inquiry_cache_dump(struct hci_dev *hdev, int num, __u8 *buf)
 {
 	struct inquiry_cache *cache = &hdev->inq_cache;
 	struct inquiry_info *info = (struct inquiry_info *) buf;
diff -Nru a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
--- a/net/bluetooth/hci_event.c	2004-06-22 14:38:03 -07:00
+++ b/net/bluetooth/hci_event.c	2004-06-22 14:38:03 -07:00
@@ -486,7 +486,7 @@
 
 	hci_dev_lock(hdev);
 	for (; num_rsp; num_rsp--)
-		inquiry_cache_update(hdev, info++);
+		hci_inquiry_cache_update(hdev, info++);
 	hci_dev_unlock(hdev);
 }
 
@@ -508,7 +508,7 @@
 		memcpy(tmp.dev_class, &info->dev_class, 3);
 		tmp.clock_offset      = info->clock_offset;
 		info++;
-		inquiry_cache_update(hdev, &tmp);
+		hci_inquiry_cache_update(hdev, &tmp);
 	}
 	hci_dev_unlock(hdev);
 }


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

             reply	other threads:[~2004-06-22 21:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-22 21:41 Stephen Hemminger [this message]
2004-06-23  9:11 ` [Bluez-devel] [PATCH] change inquiry_cache to hci_inquiry_cache to avoid possible name conflicts Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040622144148.13ef5b10@dell_ss3.pdx.osdl.net \
    --to=shemminger@osdl.org \
    --cc=bluez-devel@lists.sourceforge.net \
    --cc=marcel@holtman.org \
    --cc=maxk@qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox