]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: usbip: userspace: libsrc: removed assignments in if conditions
authorKurt Kanzenbach <ly80toro@cip.cs.fau.de>
Fri, 22 Feb 2013 11:13:30 +0000 (12:13 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 Mar 2013 16:45:28 +0000 (09:45 -0700)
This patch fixes the following checkpatch error:
-ERROR: do not use assignment in if condition

Signed-off-by: Kurt Kanzenbach <ly80toro@cip.cs.fau.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/usbip/userspace/libsrc/names.c

index a66f5391e5dc41e2ef00e647e6ccd5bbb7993952..3b151dff85a6d4821d050297791fd57494b3284f 100644 (file)
@@ -491,9 +491,11 @@ static void parse(FILE *f)
        while (fgets(buf, sizeof(buf), f)) {
                linectr++;
                /* remove line ends */
-               if ((cp = strchr(buf, 13)))
+               cp = strchr(buf, 13);
+               if (cp)
                        *cp = 0;
-               if ((cp = strchr(buf, 10)))
+               cp = strchr(buf, 10);
+               if (cp)
                        *cp = 0;
                if (buf[0] == '#' || !buf[0])
                        continue;
@@ -857,9 +859,10 @@ int names_init(char *n)
 {
        FILE *f;
 
-       if (!(f = fopen(n, "r"))) {
+       f = fopen(n, "r");
+       if (!f)
                return errno;
-       }
+
        parse(f);
        fclose(f);
        return 0;