Skip to content

Commit a0ece28

Browse files
Julia Lawalldavem330
authored andcommitted
drivers/atm/firestream.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> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 29af930 commit a0ece28

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎drivers/atm/firestream.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,8 @@ static inline void fs_kfree_skb (struct sk_buff * skb)
444444
#define ROUND_NEAREST 3
445445
/********** make rate (not quite as much fun as Horizon) **********/
446446

447-
static unsigned int make_rate (unsigned int rate, int r,
448-
u16 * bits, unsigned int * actual)
447+
static int make_rate(unsigned int rate, int r,
448+
u16 *bits, unsigned int *actual)
449449
{
450450
unsigned char exp = -1; /* hush gcc */
451451
unsigned int man = -1; /* hush gcc */

0 commit comments

Comments
 (0)