usb/host/fotg210: Add function scan_frame_queue()
authorPeter Senna Tschudin <peter.senna@gmail.com>
Mon, 12 Oct 2015 21:22:40 +0000 (23:22 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Oct 2015 06:46:27 +0000 (23:46 -0700)
commit50bdb12388c520e93947fca3cabf233a77fefd42
treef753d4ebe0f99c9980472083f3d9b47e1cea1369
parent32fb1939e3921691c71f7cd274d80d487af72fae
usb/host/fotg210: Add function scan_frame_queue()

checkpatch complains about too many leading tabs because the if
statement starts after 6 tabs:

scan_iosoc() -> for() -> while() -> switch() -> if() -> for() -> if()

There is also a goto statement going backwards in case of failure. This
patch creates a new inline function named scan_frame_queue() containing
the last 4 nesting levels, and removes the need of backwards goto,
making the code easier to read. After the patch it becomes:

scan_iosoc() -> for() -> while() -> scan_frame_queue()

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/fotg210-hcd.c