Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 847fb8ac authored by Julia Lawall's avatar Julia Lawall Committed by Linus Torvalds
Browse files

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: default avatarJulia Lawall <julia@diku.dk>
Cc: Petr Vandrovec <vandrove@vc.cvut.cz>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent f0a2f357
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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) {