Re: [PATCH 3/5] Fix dubious bitwise 'and' usage spotted by sparse.

From: Jiri Kosina
Date: Fri Jan 09 2009 - 18:56:26 EST


On Sat, 10 Jan 2009, Alexey Zaytsev wrote:

> It doesn't change the semantics, but it looks like
> the logical 'and' was meant to be used here.
> ---
> drivers/media/video/gspca/m5602/m5602_s5k4aa.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/media/video/gspca/m5602/m5602_s5k4aa.c b/drivers/media/video/gspca/m5602/m5602_s5k4aa.c
> index 14b1eac..c3ebcca 100644
> --- a/drivers/media/video/gspca/m5602/m5602_s5k4aa.c
> +++ b/drivers/media/video/gspca/m5602/m5602_s5k4aa.c
> @@ -114,7 +114,7 @@ int s5k4aa_read_sensor(struct sd *sd, const u8 address,
> if (err < 0)
> goto out;
>
> - for (i = 0; (i < len) & !err; i++) {
> + for (i = 0; (i < len) && !err; i++) {
> err = m5602_read_bridge(sd, M5602_XB_I2C_DATA, &(i2c_data[i]));
>
> PDEBUG(D_CONF, "Reading sensor register "

Hi Alexey,

this one doesn't apply to Linus' tree anymore, the whole
s5k4aa_read_sensor() function is not there.

--
Jiri Kosina
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/