Skip to contentSkip to conversation

Code cleanup - else is not generally useful after a break or return

PATCH In review Leung Timothy Chi King 2 participants 2 messages Jul 1, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Code cleanup - else is not generally useful after a break or return

Ran checkpatch.pl on driver/staging/rts5208/sd.c and foudn a WARNING 'else is not generally useful after a break or return' on line 3523. I removed the else without affecting the logic and the WARNING is gone. I had compiled and modprobe rts5208 to double check as well.

Regards,
Tim

---
 drivers/staging/rts5208/sd.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/staging/rts5208/sd.c +5 -6
index a8d657b..cb41579 100644
@@ -3520,12 +3520,11 @@ int reset_sd_card(struct rtsx_chip *chip)
 			if (chip->sd_io) {
 				rtsx_trace(chip);
 				return STATUS_FAIL;
-			} else {
-				retval = reset_mmc(chip);
-				if (retval != STATUS_SUCCESS) {
-					rtsx_trace(chip);
-					return STATUS_FAIL;
-				}
+			}
+			retval = reset_mmc(chip);
+			if (retval != STATUS_SUCCESS) {
+				rtsx_trace(chip);
+				return STATUS_FAIL;
 			}
 		}
 	}
Signature · 1 line
1.9.1
maintainer
#1 lore raw

Your subject needs a hint as to what part of the kernel it is changing, please fix that up to match what other patches have looked like for this file.

Quoted 4 lines · Leung Timothy Chi King

Ran checkpatch.pl on driver/staging/rts5208/sd.c and foudn a WARNING 'else is not generally useful after a break or return' on line 3523. I removed the else without affecting the logic and the WARNING is gone. I had compiled and modprobe rts5208 to double check as well.

That's good, but not needed here, please say why you did what you did, but not in a narrative like you did.

Quoted 3 lines

Regards,
Tim

This isn't needed either.

Can you fix up and resend?

thanks,

greg k-h