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>
1 file changed