Commit c4d66b5f authored by Peter Senna Tschudin's avatar Peter Senna Tschudin Committed by Greg Kroah-Hartman
Browse files

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: default avatarPeter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 05ebc36e
Loading
Loading
Loading
Loading
+16 −11
Original line number Original line Diff line number Diff line
@@ -330,17 +330,22 @@ struct debug_buffer {
	size_t alloc_size;
	size_t alloc_size;
};
};


#define speed_char(info1)({ char tmp; \
static inline char speed_char(u32 scratch)
		switch (info1 & (3 << 12)) { \
{
		case QH_FULL_SPEED:	\
	switch (scratch & (3 << 12)) {
			tmp = 'f'; break; \
	case QH_FULL_SPEED:
		case QH_LOW_SPEED:	\
		return 'f';
			tmp = 'l'; break; \

		case QH_HIGH_SPEED:	\
	case QH_LOW_SPEED:
			tmp = 'h'; break; \
		return 'l';
		default:		\

			tmp = '?'; break; \
	case QH_HIGH_SPEED:
		} tmp; })
		return 'h';

	default:
		return '?';
	}
}


static inline char token_mark(struct fotg210_hcd *fotg210, __hc32 token)
static inline char token_mark(struct fotg210_hcd *fotg210, __hc32 token)
{
{