* [PATCH] ocb: remove unnecessary variable increments
@ 2015-12-12 17:50 Ola Olsson
2015-12-12 18:00 ` Johannes Berg
0 siblings, 1 reply; 2+ messages in thread
From: Ola Olsson @ 2015-12-12 17:50 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Ola Olsson, Ola Olsson
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(-)
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;
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ocb: remove unnecessary variable increments
2015-12-12 17:50 [PATCH] ocb: remove unnecessary variable increments Ola Olsson
@ 2015-12-12 18:00 ` Johannes Berg
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2015-12-12 18:00 UTC (permalink / raw)
To: Ola Olsson; +Cc: linux-wireless, Ola Olsson
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-12-12 18:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-12 17:50 [PATCH] ocb: remove unnecessary variable increments Ola Olsson
2015-12-12 18:00 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).