Permalink
Browse files

remove unneeded loop, use ifunit()

  • Loading branch information...
1 parent 965ac3d commit ad73c2e5edbff544f573e49c032ef7d72fac8b57 itojun committed Oct 6, 2004
Showing with 4 additions and 28 deletions.
  1. +1 −7 freebsd4/sys/net/if.c
  2. +1 −7 freebsd5/sys/net/if.c
  3. +1 −7 netbsd/sys/net/if.c
  4. +1 −7 openbsd/sys/net/if.c
View
@@ -518,7 +518,6 @@ if_clone_create(name, len)
int len;
{
struct if_clone *ifc;
- struct ifnet *ifp;
char *dp;
int wildcard;
int unit;
@@ -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);
View
@@ -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;
@@ -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);
View
@@ -750,7 +750,6 @@ if_clone_create(name)
const char *name;
{
struct if_clone *ifc;
- struct ifnet *ifp;
int unit;
int error;
int s;
@@ -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);
View
@@ -635,7 +635,6 @@ if_clone_create(name)
const char *name;
{
struct if_clone *ifc;
- struct ifnet *ifp;
int unit;
int error;
int s;
@@ -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);

0 comments on commit ad73c2e

Please sign in to comment.