summaryrefslogtreecommitdiff
path: root/drivers/staging/usbip/userspace
diff options
context:
space:
mode:
authorKurt Kanzenbach <ly80toro@cip.cs.fau.de>2013-02-22 11:13:30 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-11 16:45:28 (GMT)
commit6f19a2b1c386d6ef75bcfebf5c1a68d28658d62e (patch)
tree0a0dd2f8c403bb5146d3785de6d6cd15d0c4a705 /drivers/staging/usbip/userspace
parent9db91e1b4cdf23c28f7f932376bcdeafbd1aee28 (diff)
downloadlinux-fsl-qoriq-6f19a2b1c386d6ef75bcfebf5c1a68d28658d62e.tar.xz
staging: usbip: userspace: libsrc: removed assignments in if conditions
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>
Diffstat (limited to 'drivers/staging/usbip/userspace')
-rw-r--r--drivers/staging/usbip/userspace/libsrc/names.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/staging/usbip/userspace/libsrc/names.c b/drivers/staging/usbip/userspace/libsrc/names.c
index a66f539..3b151df 100644
--- a/drivers/staging/usbip/userspace/libsrc/names.c
+++ b/drivers/staging/usbip/userspace/libsrc/names.c
@@ -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;