Skip to contentSkip to conversation

ocb: remove unnecessary variable increments

PATCH In review Ola Olsson 2 participants 2 messages Dec 12, 2015

lore
Share & tools
lore

Ola Olsson

author
#0 lore raw

PATCH 1/1 ocb: remove unnecessary variable increments

The arg[c|v] variables are incremented even if
they are not used afterwards. Fix that.

---
 ocb.c |    3 ---
 1 file changed, 3 deletions(-)
ocb.c +0 -3
index 767eb82..b43fba8 100644
@@ -33,7 +33,6 @@ static int join_ocb(struct nl80211_state *state,
 
 	NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, freq);
 	argv++;
-	argc--;
 
 	/* channel width */
 	for (i = 0; i < ARRAY_SIZE(chanmode); i++) {
@@ -47,8 +46,6 @@ static int join_ocb(struct nl80211_state *state,
 			    chanmode_selected->width);
 		NLA_PUT_U32(msg, NL80211_ATTR_CENTER_FREQ1, freq);
 
-		argv++;
-		argc--;
 	} else {
 		return 1;
 	}
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 2 lines · Ola Olsson

The arg[c|v] variables are incremented even if
they are not used afterwards. Fix that.

Good find, thanks, but I think I'd rather leave the code as is - the compiler ought to discard the useless code anyway, but somebody editing it later might have it easier if it's already done.

johannes