]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: remove unnecessary variable in find_mesh_param
authorAshok Nagarajan <ashok@cozybit.com>
Tue, 9 Oct 2012 20:29:26 +0000 (13:29 -0700)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 22 Oct 2012 13:34:55 +0000 (15:34 +0200)
Also stick to coding style. use "strcmp ( , ) == 0" instead of (!strcmp( , ))

Signed-off-by: Ashok Nagarajan <ashok@cozybit.com>
mesh.c

diff --git a/mesh.c b/mesh.c
index 3077abf72b621b5134012231cd61c6da11dba00f..4fdad6a09a76991c73005be575bde5d0a9a9d4a5 100644 (file)
--- a/mesh.c
+++ b/mesh.c
@@ -232,19 +232,15 @@ static void print_all_mesh_param_descr(void)
 static const struct mesh_param_descr *find_mesh_param(const char *name)
 {
        int i;
-       const struct mesh_param_descr *mdescr = NULL;
 
        /* Find out what mesh parameter we want to change. */
        for (i = 0; i < ARRAY_SIZE(_mesh_param_descrs); i++) {
-               if (!strcmp(_mesh_param_descrs[i].name, name))
+               if (strcmp(_mesh_param_descrs[i].name, name) == 0)
                        return _mesh_param_descrs + i;
        }
 
-       if (!mdescr) {
-               print_all_mesh_param_descr();
-               return NULL;
-       }
-       return mdescr;
+       print_all_mesh_param_descr();
+       return NULL;
 }
 
 /* Setter */