]> git.baikalelectronics.ru Git - kernel.git/commit
Staging: comedi: Fix unsigned return type
authorJulia Lawall <julia@diku.dk>
Sun, 5 Sep 2010 19:00:24 +0000 (21:00 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 5 Sep 2010 23:59:55 +0000 (16:59 -0700)
commit5363effa039a76a12d0dc34b5bc6e27aef3b9d99
tree8c5d9c9ddb581c1ed08bdc4842fca7dd71208ec1
parent2df93cd35ec448b962cde3502399e324e03ea2c7
Staging: comedi: Fix unsigned return type

In each case, the function has an unsigned return type, but returns a
negative constant to indicate an error condition.  For move_block_from_dma,
there is only one call and the return value is dropped, so it need not be
unsigned.  For labpc_eeprom_write, there is only one call and the result is
stored in a signed variable, so again the unsigned return type is not
necessary.

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: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/comedi/drivers/adl_pci9118.c
drivers/staging/comedi/drivers/ni_labpc.c