diff options
author | Julia Lawall <julia@diku.dk> | 2010-10-28 00:33:26 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-28 03:03:08 +0200 |
commit | 847fb8aca3b79d03ef6c5f87f0843a30ed9e6627 (patch) | |
tree | b1916b554960b20d4e7e158cfc803f575cc40a1c /drivers/video/matrox/matroxfb_maven.c | |
parent | savagefb: fix DDC for Savage 4 (diff) | |
download | linux-847fb8aca3b79d03ef6c5f87f0843a30ed9e6627.tar.xz linux-847fb8aca3b79d03ef6c5f87f0843a30ed9e6627.zip |
drivers/video/matrox/matroxfb_maven.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
only tested by comparison to 0, and thus unsigned is not needed and 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>
Cc: Petr Vandrovec <vandrove@vc.cvut.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/matrox/matroxfb_maven.c')
-rw-r--r-- | drivers/video/matrox/matroxfb_maven.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/video/matrox/matroxfb_maven.c b/drivers/video/matrox/matroxfb_maven.c index 1e3e8f19783e..31b8f67477b7 100644 --- a/drivers/video/matrox/matroxfb_maven.c +++ b/drivers/video/matrox/matroxfb_maven.c @@ -280,7 +280,7 @@ static int matroxfb_PLL_mavenclock(const struct matrox_pll_features2* pll, return fxtal * (*feed) / (*in) * ctl->den; } -static unsigned int matroxfb_mavenclock(const struct matrox_pll_ctl* ctl, +static int matroxfb_mavenclock(const struct matrox_pll_ctl *ctl, unsigned int htotal, unsigned int vtotal, unsigned int* in, unsigned int* feed, unsigned int* post, unsigned int* htotal2) { |