]> git.baikalelectronics.ru Git - kernel.git/commit
drivers/video/matrox/matroxfb_maven.c: fix unsigned return type
authorJulia Lawall <julia@diku.dk>
Wed, 27 Oct 2010 22:33:26 +0000 (15:33 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 28 Oct 2010 01:03:08 +0000 (18:03 -0700)
commita74ec3de0acd40bd47289a6b5504e712ecd6553b
treeb1916b554960b20d4e7e158cfc803f575cc40a1c
parent1d17fd73b44225b55069cd15a926ec8e8d9d8bcb
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>
drivers/video/matrox/matroxfb_maven.c