Search Linux Wireless

[PATCH] Prevent unnecessary iteration in __handle_cmd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Sunil Shahu <shshahu@xxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux