Skip to content

Commit

Permalink
staging: usbip: userspace: libsrc: removed assignments in if conditions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kurt Kanzenbach authored and Greg Kroah-Hartman committed Mar 11, 2013
1 parent 9db91e1 commit 6f19a2b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions drivers/staging/usbip/userspace/libsrc/names.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 6f19a2b

Please sign in to comment.