diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2012-02-17 11:40:55 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-02-17 13:01:10 +0200 |
commit | 20d1803a70ddafc8410b461caaa397e49da246ac (patch) | |
tree | d2347c25bb35832d6c931bdb1711c16f3f57d441 /include/net | |
parent | 3ed7003e724a04482e0ef1e794eece8c1c177b37 (diff) | |
download | linux-3.10-20d1803a70ddafc8410b461caaa397e49da246ac.tar.gz linux-3.10-20d1803a70ddafc8410b461caaa397e49da246ac.tar.bz2 linux-3.10-20d1803a70ddafc8410b461caaa397e49da246ac.zip |
Bluetooth: Move scope of state_to_string
Function state_to_string will be used in other files in debug
statements.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/bluetooth/bluetooth.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 9f5f2c1c555..5ca9219fe94 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h @@ -131,6 +131,33 @@ enum { BT_CLOSED }; +/* If unused will be removed by compiler */ +static inline const 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]; |