[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100906163044.GA14188@lixom.net>
Date: Mon, 6 Sep 2010 11:30:44 -0500
From: Olof Johansson <olof@...om.net>
To: Julia Lawall <julia@...u.dk>
Cc: kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-i2c@...r.kernel.org,
"Ben Dooks (embedded platforms)" <ben-linux@...ff.org>,
"Jean Delvare (PC drivers, core)" <khali@...ux-fr.org>,
linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH 4/8] drivers/i2c/busses/i2c-pasemi.c: Fix unsigned
return type
On Sun, Sep 05, 2010 at 09:00:22PM +0200, Julia Lawall wrote:
> 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@...u.dk>
Acked-by: Olof Johansson <olof@...om.net>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists