linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] Bluetooth: Move scope of state_to_string
@ 2012-02-15  9:50 Emeltchenko Andrei
  2012-02-15  9:50 ` [PATCH 2/2] Bluetooth: Use symbolic name for state in debug Emeltchenko Andrei
  2012-02-15 12:20 ` [PATCH 1/2] Bluetooth: Move scope of state_to_string Marcel Holtmann
  0 siblings, 2 replies; 8+ messages in thread
From: Emeltchenko Andrei @ 2012-02-15  9:50 UTC (permalink / raw)
  To: linux-bluetooth

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

Function state_to_string will be used in other files.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
 include/net/bluetooth/bluetooth.h |   27 +++++++++++++++++++++++++++
 net/bluetooth/l2cap_core.c        |   26 --------------------------
 2 files changed, 27 insertions(+), 26 deletions(-)

diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index 4a82ca0..0a47c20 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -129,6 +129,33 @@ enum {
 	BT_CLOSED
 };
 
+/* If unused will be removed by compiler */
+static inline char *state_to_string(int state)
+{
+	switch (state) {
+	case BT_CONNECTED:
+		return "BT_CONNECTED";
+	case BT_OPEN:
+		return "BT_OPEN";
+	case BT_BOUND:
+		return "BT_BOUND";
+	case BT_LISTEN:
+		return "BT_LISTEN";
+	case BT_CONNECT:
+		return "BT_CONNECT";
+	case BT_CONNECT2:
+		return "BT_CONNECT2";
+	case BT_CONFIG:
+		return "BT_CONFIG";
+	case BT_DISCONN:
+		return "BT_DISCONN";
+	case BT_CLOSED:
+		return "BT_CLOSED";
+	}
+
+	return "invalid state";
+}
+
 /* BD Address */
 typedef struct {
 	__u8 b[6];
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 8efac78..252a96e 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -215,32 +215,6 @@ static u16 l2cap_alloc_cid(struct l2cap_conn *conn)
 	return 0;
 }
 
-static char *state_to_string(int state)
-{
-	switch(state) {
-	case BT_CONNECTED:
-		return "BT_CONNECTED";
-	case BT_OPEN:
-		return "BT_OPEN";
-	case BT_BOUND:
-		return "BT_BOUND";
-	case BT_LISTEN:
-		return "BT_LISTEN";
-	case BT_CONNECT:
-		return "BT_CONNECT";
-	case BT_CONNECT2:
-		return "BT_CONNECT2";
-	case BT_CONFIG:
-		return "BT_CONFIG";
-	case BT_DISCONN:
-		return "BT_DISCONN";
-	case BT_CLOSED:
-		return "BT_CLOSED";
-	}
-
-	return "invalid state";
-}
-
 static void l2cap_state_change(struct l2cap_chan *chan, int state)
 {
 	BT_DBG("%p %s -> %s", chan, state_to_string(chan->state),
-- 
1.7.9


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

end of thread, other threads:[~2012-02-17  9:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-15  9:50 [PATCH 1/2] Bluetooth: Move scope of state_to_string Emeltchenko Andrei
2012-02-15  9:50 ` [PATCH 2/2] Bluetooth: Use symbolic name for state in debug Emeltchenko Andrei
2012-02-15 12:20 ` [PATCH 1/2] Bluetooth: Move scope of state_to_string Marcel Holtmann
2012-02-15 12:53   ` Emeltchenko Andrei
2012-02-17  9:10   ` Emeltchenko Andrei
2012-02-17  9:12     ` Marcel Holtmann
2012-02-17  9:18       ` Emeltchenko Andrei
2012-02-17  9:30         ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).