Skip to contentSkip to conversation

wl1271: remove some unneeded code

PATCH In review Dan Carpenter 2 participants 2 messages May 8, 2010 – May 11, 2010 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 9/9 wl1271: remove some unneeded code

The goto and the break are equivelent. I removed the goto in memory of Edsger Dijkstra who famously hated gotos and who would have been eighty years old next Tuesday.

drivers/net/wireless/wl12xx/wl1271_main.c +0 -2
index 55aa813..da40cee 100644
@@ -1563,8 +1563,6 @@ static int wl1271_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
 	default:
 		wl1271_error("Unsupported key cmd 0x%x", cmd);
 		ret = -EOPNOTSUPP;
-		goto out_sleep;
-
 		break;
 	}
 
Acked-by on v1 9/9
#1 lore raw
Quoted 11 lines · ext Dan Carpenter

The goto and the break are equivelent. I removed the goto in memory of Edsger Dijkstra who famously hated gotos and who would have been eighty years old next Tuesday.

drivers/net/wireless/wl12xx/wl1271_main.c +0 -0
index 55aa813..da40cee 100644

drivers/net/wireless/wl12xx/wl1271_main.c static int wl1271_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, · line 1567

Quoted 7 lines
drivers/net/wireless/wl12xx/wl1271_main.c +0 -2
@@ -1563,8 +1563,6 @@ static int wl1271_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
 	default:
 		wl1271_error("Unsupported key cmd 0x%x", cmd);
 		ret = -EOPNOTSUPP;
-		goto out_sleep;
-
 		break;
 	}

We use goto out_* in error cases throughout our code (sorry Edsger!) and in many cases they are not needed because they're the last check in the function, but we still use them for consistency.

In this case, there are two "consistency" items conflicting with each other (ie. the "break" in the last case entry is not needed, but it's there for consistency). Your change indeed makes the code look cleaner, so I think the "keep-the-break-in-the-default-case" rule should win here. ;)

Signature · 2 lines
Cheers,
Luca.