diff mbox

ocb: remove unnecessary variable increments

Message ID 1449942620-29997-1-git-send-email-ola1olsson@gmail.com (mailing list archive)
State Rejected
Delegated to: Johannes Berg
Headers show

Commit Message

Ola Olsson Dec. 12, 2015, 5:50 p.m. UTC
The arg[c|v] variables are incremented even if
they are not used afterwards. Fix that.

Signed-off-by: Ola Olsson <ola.olsson@sonymobile.com>
---
 ocb.c |    3 ---
 1 file changed, 3 deletions(-)

Comments

Johannes Berg Dec. 12, 2015, 6 p.m. UTC | #1
On Sat, 2015-12-12 at 18:50 +0100, Ola Olsson wrote:
> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/ocb.c b/ocb.c
index 767eb82..b43fba8 100644
--- a/ocb.c
+++ b/ocb.c
@@ -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;
 	}