diff options
author | Julia Lawall <julia@diku.dk> | 2010-09-05 05:00:22 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-10-13 01:19:04 -0400 |
commit | 8032214346c0c892e859cf6eee6c8ba305cbfe78 (patch) | |
tree | 77438b235db10a3a6fc9030e01c82759cc461984 | |
parent | a655237fa2f9e4afe9949abe2c511432ab9537dd (diff) |
i2c/i2c-pasemi.c: Fix unsigned return type
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>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | drivers/i2c/busses/i2c-pasemi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-pasemi.c b/drivers/i2c/busses/i2c-pasemi.c index 4174101660c9..837b8c1aa02a 100644 --- a/drivers/i2c/busses/i2c-pasemi.c +++ b/drivers/i2c/busses/i2c-pasemi.c | |||
@@ -88,7 +88,7 @@ static void pasemi_smb_clear(struct pasemi_smbus *smbus) | |||
88 | reg_write(smbus, REG_SMSTA, status); | 88 | reg_write(smbus, REG_SMSTA, status); |
89 | } | 89 | } |
90 | 90 | ||
91 | static unsigned int pasemi_smb_waitready(struct pasemi_smbus *smbus) | 91 | static int pasemi_smb_waitready(struct pasemi_smbus *smbus) |
92 | { | 92 | { |
93 | int timeout = 10; | 93 | int timeout = 10; |
94 | unsigned int status; | 94 | unsigned int status; |