summaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/fotg210-hcd.c
diff options
context:
space:
mode:
authorPeter Senna Tschudin <peter.senna@gmail.com>2015-10-12 23:22:38 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-17 08:46:27 +0200
commitc4d66b5f8da338482005cf7f3dd2fcdaed09dd3f (patch)
treea2a20de869e5671b534e3e39da34e370402db60c /drivers/usb/host/fotg210-hcd.c
parentusb/host/fotg210: replace msleep by usleep_range (diff)
downloadlinux-c4d66b5f8da338482005cf7f3dd2fcdaed09dd3f.tar.xz
linux-c4d66b5f8da338482005cf7f3dd2fcdaed09dd3f.zip
usb/host/fotg210: convert macro to inline function
This patch convert the macro speed_char in an inline function. The goal of this patch is to make the code easier to read. Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/fotg210-hcd.c')
-rw-r--r--drivers/usb/host/fotg210-hcd.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/drivers/usb/host/fotg210-hcd.c b/drivers/usb/host/fotg210-hcd.c
index f3c1a718fe0b..158423230a88 100644
--- a/drivers/usb/host/fotg210-hcd.c
+++ b/drivers/usb/host/fotg210-hcd.c
@@ -330,17 +330,22 @@ struct debug_buffer {
size_t alloc_size;
};
-#define speed_char(info1)({ char tmp; \
- switch (info1 & (3 << 12)) { \
- case QH_FULL_SPEED: \
- tmp = 'f'; break; \
- case QH_LOW_SPEED: \
- tmp = 'l'; break; \
- case QH_HIGH_SPEED: \
- tmp = 'h'; break; \
- default: \
- tmp = '?'; break; \
- } tmp; })
+static inline char speed_char(u32 scratch)
+{
+ switch (scratch & (3 << 12)) {
+ case QH_FULL_SPEED:
+ return 'f';
+
+ case QH_LOW_SPEED:
+ return 'l';
+
+ case QH_HIGH_SPEED:
+ return 'h';
+
+ default:
+ return '?';
+ }
+}
static inline char token_mark(struct fotg210_hcd *fotg210, __hc32 token)
{