linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Prevent unnecessary iteration in __handle_cmd
@ 2016-04-01  8:31 Sunil Shahu
  2016-04-01 11:48 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Sunil Shahu @ 2016-04-01  8:31 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless

Break the loop after matching sectcmd is found. Remove redundant
variable copying.

Signed-off-by: Sunil Shahu <shshahu@gmail.com>
---
 iw.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/iw.c b/iw.c
index 0f511d9..73ae347 100644
--- a/iw.c
+++ b/iw.c
@@ -376,11 +376,9 @@ static int __handle_cmd(struct nl80211_state *state, enum id_input idby,
 		if (match && sectcmd->idby != command_idby)
 			continue;
 		if (strcmp(sectcmd->name, section) == 0)
-			match = sectcmd;
+			break;
 	}
 
-	sectcmd = match;
-	match = NULL;
 	if (!sectcmd)
 		return 1;
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-01 11:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-01  8:31 [PATCH] Prevent unnecessary iteration in __handle_cmd Sunil Shahu
2016-04-01 11:48 ` 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).