Skip to content

Commit

Permalink
remove unneeded loop, use ifunit()
Browse files Browse the repository at this point in the history
  • Loading branch information
itojun committed Oct 6, 2004
1 parent 965ac3d commit ad73c2e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 28 deletions.
8 changes: 1 addition & 7 deletions freebsd4/sys/net/if.c
Expand Up @@ -518,7 +518,6 @@ if_clone_create(name, len)
int len;
{
struct if_clone *ifc;
struct ifnet *ifp;
char *dp;
int wildcard;
int unit;
Expand Down Expand Up @@ -554,12 +553,7 @@ if_clone_create(name, len)
}

s = splimp();
for (ifp = TAILQ_FIRST(&ifnet); ifp; ifp = TAILQ_NEXT(ifp, if_list)) {
if (ifp == ifunit(name)) {
if_attachdomain1(ifp);
break;
}
}
if_attachdomain1(ifunit(name));
splx(s);

return (0);
Expand Down
8 changes: 1 addition & 7 deletions freebsd5/sys/net/if.c
Expand Up @@ -668,7 +668,6 @@ int
if_clone_create(char *name, int len)
{
struct if_clone *ifc;
struct ifnet *ifp;
char *dp;
int wildcard, bytoff, bitoff;
int unit;
Expand Down Expand Up @@ -733,12 +732,7 @@ if_clone_create(char *name, int len)
}

s = splimp();
for (ifp = TAILQ_FIRST(&ifnet); ifp; ifp = TAILQ_NEXT(ifp, if_list)) {
if (ifp == ifunit(name)) {
if_attachdomain1(ifp);
break;
}
}
if_attachdomain1(ifunit(name));
splx(s);

return (0);
Expand Down
8 changes: 1 addition & 7 deletions netbsd/sys/net/if.c
Expand Up @@ -750,7 +750,6 @@ if_clone_create(name)
const char *name;
{
struct if_clone *ifc;
struct ifnet *ifp;
int unit;
int error;
int s;
Expand All @@ -767,12 +766,7 @@ if_clone_create(name)
return (error);

s = splnet();
for (ifp = TAILQ_FIRST(&ifnet); ifp; ifp = TAILQ_NEXT(ifp, if_list)) {
if (strcmp(name, ifp->if_xname) == 0) {
if_attachdomain1(ifp);
break;
}
}
if_attachdomain1(ifunit(name));
splx(s);

return (error);
Expand Down
8 changes: 1 addition & 7 deletions openbsd/sys/net/if.c
Expand Up @@ -635,7 +635,6 @@ if_clone_create(name)
const char *name;
{
struct if_clone *ifc;
struct ifnet *ifp;
int unit;
int error;
int s;
Expand All @@ -652,12 +651,7 @@ if_clone_create(name)
return (error);

s = splnet();
for (ifp = TAILQ_FIRST(&ifnet); ifp; ifp = TAILQ_NEXT(ifp, if_list)) {
if (strcmp(name, ifp->if_xname) == 0) {
if_attachdomain1(ifp);
break;
}
}
if_attachdomain1(ifunit(name));
splx(s);

return (error);
Expand Down

0 comments on commit ad73c2e

Please sign in to comment.