Whamcloud - gitweb
LU-6501 libcfs: removal last entry of libcfs_netstrfns[]
[fs/lustre-release.git] / libcfs / libcfs / util / nidstrings.c
index b150a0d..b52d041 100644 (file)
@@ -459,8 +459,6 @@ static struct netstrfns  libcfs_netstrfns[] = {
         /* .nf_match_addr*/      cfs_ip_addr_match,
         /* .nf_is_contiguous */  cfs_ip_is_contiguous,
         /* .nf_min_max   */      cfs_ip_min_max},
-        /* placeholder for net0 alias.  It MUST BE THE LAST ENTRY */
-       {/* .nf_type      */  -1},
 };
 
 static const size_t libcfs_nnetstrfns =
@@ -486,8 +484,7 @@ libcfs_namenum2netstrfns(const char *name)
 
        for (i = 0; i < libcfs_nnetstrfns; i++) {
                nf = &libcfs_netstrfns[i];
-               if (nf->nf_type >= 0 &&
-                   !strncmp(name, nf->nf_name, strlen(nf->nf_name)))
+               if (!strncmp(name, nf->nf_name, strlen(nf->nf_name)))
                        return nf;
        }
        return NULL;
@@ -499,8 +496,7 @@ libcfs_name2netstrfns(const char *name)
        int    i;
 
        for (i = 0; i < libcfs_nnetstrfns; i++)
-               if (libcfs_netstrfns[i].nf_type >= 0 &&
-                   !strcmp(libcfs_netstrfns[i].nf_name, name))
+               if (!strcmp(libcfs_netstrfns[i].nf_name, name))
                        return &libcfs_netstrfns[i];
 
        return NULL;
@@ -607,8 +603,7 @@ libcfs_str2net_internal(const char *str, __u32 *net)
 
        for (i = 0; i < libcfs_nnetstrfns; i++) {
                nf = &libcfs_netstrfns[i];
-               if (nf->nf_type >= 0 &&
-                   !strncmp(str, nf->nf_name, strlen(nf->nf_name)))
+               if (!strncmp(str, nf->nf_name, strlen(nf->nf_name)))
                        break;
        }