staging: ft1000: extract dsp_broadcast_msg_id()
authorKelley Nielsen <kelleynnn@gmail.com>
Wed, 6 Nov 2013 05:39:10 +0000 (21:39 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 10 Nov 2013 15:53:48 +0000 (07:53 -0800)
commit6eca0c1fa29bd4d92cd0cb20fd421c8e631814dc
tree466d5f14e8c1f2b390bd2d3d8784d1109a182ce4
parentd5ae3c482df04a74e03ed944f33209178adaf03f
staging: ft1000: extract dsp_broadcast_msg_id()

The function ft1000_poll, in ft1000_hw.c, is overly complex, with at
least five levels of nesting. Extract the lines in switch case
DSPBCMSGID into their own function, called dsp_broadcast_msg_id(). Pass
one parameter, struct ft1000_usb *dev. Make a copy of struct dpram_blk
*pdpram_blk local to the new function, since it is initialized at the
top of each case in which it appears. Make unsigned long flags local to
the new function. Remove the assignment to struct pseudo_hdr
*ppseudo_hdr, which is otherwise unused in the switch case, and receives
the same assignment at the top of each case in which it appears. Return
an int, 0 for success and -1 for error. Correct style issues in the
extracted lines.

Signed-off-by: Kelley Nielsen <kelleynnn@gmail.com>
Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ft1000/ft1000-usb/ft1000_hw.c