提交 c4d66b5f 编写于 作者: P Peter Senna Tschudin 提交者: Greg Kroah-Hartman

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: NPeter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 05ebc36e
......@@ -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)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册