Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3349b0b7 authored by Rasmus Villemoes's avatar Rasmus Villemoes Committed by David S. Miller
Browse files

net: tulip: rearrange order of searching for substrings



Currently, two of the branches are dead code, since an earlier smaller
substring would have been found ("TP" in the "TP_NW" case and either
of "BNC" and "AUI" in the "BNC_AUI" case). Rearrange the strstr()
calls so that the longer strings are searched for first.

Signed-off-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 633cc5fe
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -5189,16 +5189,16 @@ de4x5_parse_params(struct net_device *dev)
	if (strstr(p, "fdx") || strstr(p, "FDX")) lp->params.fdx = true;

	if (strstr(p, "autosense") || strstr(p, "AUTOSENSE")) {
	    if (strstr(p, "TP")) {
		lp->params.autosense = TP;
	    } else if (strstr(p, "TP_NW")) {
	    if (strstr(p, "TP_NW")) {
		lp->params.autosense = TP_NW;
	    } else if (strstr(p, "TP")) {
		lp->params.autosense = TP;
	    } else if (strstr(p, "BNC_AUI")) {
		lp->params.autosense = BNC;
	    } else if (strstr(p, "BNC")) {
		lp->params.autosense = BNC;
	    } else if (strstr(p, "AUI")) {
		lp->params.autosense = AUI;
	    } else if (strstr(p, "BNC_AUI")) {
		lp->params.autosense = BNC;
	    } else if (strstr(p, "10Mb")) {
		lp->params.autosense = _10Mb;
	    } else if (strstr(p, "100Mb")) {