Skip to content

Commit

Permalink
net/9p/trans_fd.c: Fix unsigned return type
Browse files Browse the repository at this point in the history
The function has an unsigned return type, but returns a negative constant
to indicate an error condition.  The result of calling the function is
always stored in a variable of type (signed) int, and thus unsigned can be
dropped from the return type.

A sematic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@exists@
identifier f;
constant C;
@@

 unsigned f(...)
 { <+...
*  return -C;
 ...+> }
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Julia Lawall authored and David S. Miller committed Sep 7, 2010
1 parent e04c4dc commit 29af930
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/9p/trans_fd.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ static void p9_conn_cancel(struct p9_conn *m, int err)
}
}

static unsigned int
static int
p9_fd_poll(struct p9_client *client, struct poll_table_struct *pt)
{
int ret, n;
Expand Down

0 comments on commit 29af930

Please sign in to comment.