staging: dgap: Merge two separate if conditions
PATCH 1/1 staging: dgap: Merge two separate if conditions
Merge two if conditions with the same statements to avoid code duplication.
Signed-off-by Janani Ravichandran <[email protected]>
--- drivers/staging/dgap/dgap.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/staging/dgap/dgap.c +1 -5
@@ -2014,11 +2014,7 @@ static void dgap_poll_tasklet(unsigned long data)if (bd->state ==BOARD_READY ) {struct ev_t __iomem *eaddr; -if (!bd->re_map_membase) { -spin_unlock_irqrestore (&bd->bd_lock, lock_flags); -return ; - } -if (!bd->re_map_port) { +if (!bd->re_map_membase || !bd->re_map_port) {spin_unlock_irqrestore (&bd->bd_lock, lock_flags);return ; }
Signature · 1 line
2.5.0
Quoted 6 lines · Janani Ravichandran
Merge two if conditions with the same statements to avoid code duplication.
Signed-off-by Janani Ravichandran <[email protected]>--- drivers/staging/dgap/dgap.c | 6 +-----
dgap is no longer in staging tree. Which tree are you using?
regards
sudip
Quoted 9 lines · Sudip Mukherjee
Quoted 6 lines · Janani Ravichandran
Merge two if conditions with the same statements to avoid code duplication.
Signed-off-by Janani Ravichandran <[email protected]>--- drivers/staging/dgap/dgap.c | 6 +-----dgap is no longer in staging tree. Which tree are you using?
Even if the patch is not useful any more, you could use Coccinelle to see if there are other occurrences of the same situation.
julia