From f3802bdb15f7bea68ca330d8d909c56ac1e15119 Mon Sep 17 00:00:00 2001 From: Kelley Nielsen Date: Wed, 6 Nov 2013 05:08:58 -0800 Subject: [PATCH] staging: ft1000: flatten nesting in handle_misc_portid The newly extracted function handle_misc_portid still has several unnecessary levels of nesting, having inherited its logic from the original extracted lines. Move handling for failed memory allocation (of *pdpram_blk) to the top of the function, and return -1 from within it. This eliminates the if statement around the body of the function. Change two levels of nested if/else to an if/else-if/else. Create a label, exit_failure, at the end of the function with the cleanup code, and goto it at all points of failure. Also, goto it if the call to ft1000_receive_cmd() fails, instead of descending into an if block if it succeeds. Pull all lines from inside the former if blocks to the left, and rejoin lines to take advantage of reclaimed horizontal space. Signed-off-by: Kelley Nielsen Signed-off-by: Greg Kroah-Hartman --- Reading git-format-patch failed