]> git.baikalelectronics.ru Git - kernel.git/commit
drivers/net/wireless/iwlwifi/iwl-agn.c: Fix return value from an unsigned function
authorJulia Lawall <julia@diku.dk>
Sun, 5 Sep 2010 19:00:26 +0000 (21:00 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 7 Sep 2010 17:54:34 +0000 (13:54 -0400)
commit9e22642fc7c264b86c8235d5498e4234b07bdd9a
treefcfd1fa33ba97a10d167fedb16787e9943b8d048
parent94b46332f40896d1cf4b2bc3efe01c96e28b25f5
drivers/net/wireless/iwlwifi/iwl-agn.c: Fix return value from an unsigned function

The function has an unsigned return type, but returns a negative constant
to indicate an error condition.  Another error condition in the same
function is indicated by returning 0, and indeed the only call to the
function checks for 0 to detect errors, so the return of a negative value
it converted to a return of 0.

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: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-agn.c