diff options
-rw-r--r-- | include/net/bluetooth/bluetooth.h | 27 | ||||
-rw-r--r-- | 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 9f5f2c1c5554..5ca9219fe940 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
@@ -131,6 +131,33 @@ enum { | |||
131 | BT_CLOSED | 131 | BT_CLOSED |
132 | }; | 132 | }; |
133 | 133 | ||
134 | /* If unused will be removed by compiler */ | ||
135 | static inline const char *state_to_string(int state) | ||
136 | { | ||
137 | switch (state) { | ||
138 | case BT_CONNECTED: | ||
139 | return "BT_CONNECTED"; | ||
140 | case BT_OPEN: | ||
141 | return "BT_OPEN"; | ||
142 | case BT_BOUND: | ||
143 | return "BT_BOUND"; | ||
144 | case BT_LISTEN: | ||
145 | return "BT_LISTEN"; | ||
146 | case BT_CONNECT: | ||
147 | return "BT_CONNECT"; | ||
148 | case BT_CONNECT2: | ||
149 | return "BT_CONNECT2"; | ||
150 | case BT_CONFIG: | ||
151 | return "BT_CONFIG"; | ||
152 | case BT_DISCONN: | ||
153 | return "BT_DISCONN"; | ||
154 | case BT_CLOSED: | ||
155 | return "BT_CLOSED"; | ||
156 | } | ||
157 | |||
158 | return "invalid state"; | ||
159 | } | ||
160 | |||
134 | /* BD Address */ | 161 | /* BD Address */ |
135 | typedef struct { | 162 | typedef struct { |
136 | __u8 b[6]; | 163 | __u8 b[6]; |
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 8efac7884ffb..252a96e474ca 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) | |||
215 | return 0; | 215 | return 0; |
216 | } | 216 | } |
217 | 217 | ||
218 | static char *state_to_string(int state) | ||
219 | { | ||
220 | switch(state) { | ||
221 | case BT_CONNECTED: | ||
222 | return "BT_CONNECTED"; | ||
223 | case BT_OPEN: | ||
224 | return "BT_OPEN"; | ||
225 | case BT_BOUND: | ||
226 | return "BT_BOUND"; | ||
227 | case BT_LISTEN: | ||
228 | return "BT_LISTEN"; | ||
229 | case BT_CONNECT: | ||
230 | return "BT_CONNECT"; | ||
231 | case BT_CONNECT2: | ||
232 | return "BT_CONNECT2"; | ||
233 | case BT_CONFIG: | ||
234 | return "BT_CONFIG"; | ||
235 | case BT_DISCONN: | ||
236 | return "BT_DISCONN"; | ||
237 | case BT_CLOSED: | ||
238 | return "BT_CLOSED"; | ||
239 | } | ||
240 | |||
241 | return "invalid state"; | ||
242 | } | ||
243 | |||
244 | static void l2cap_state_change(struct l2cap_chan *chan, int state) | 218 | static void l2cap_state_change(struct l2cap_chan *chan, int state) |
245 | { | 219 | { |
246 | BT_DBG("%p %s -> %s", chan, state_to_string(chan->state), | 220 | BT_DBG("%p %s -> %s", chan, state_to_string(chan->state), |