public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gspca m5602: eliminate sparse warnings
@ 2009-12-11 21:33 Németh Márton
  2009-12-12 10:21 ` Jean-Francois Moine
  0 siblings, 1 reply; 3+ messages in thread
From: Németh Márton @ 2009-12-11 21:33 UTC (permalink / raw)
  To: Jean-Francois Moine, V4L Mailing List

From: Márton Németh <nm127@freemail.hu>

Eliminate the following sparse warnings (see "make C=1"):
 * v4l/m5602_s5k4aa.c:530:23: warning: dubious: x | !y
 * v4l/m5602_s5k4aa.c:575:23: warning: dubious: x | !y

Signed-off-by: Márton Németh <nm127@freemail.hu>
---
../../m5602_s5k4aa_dubious.patch
diff -r f5662ce08663 linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c
--- a/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c	Fri Dec 11 09:53:41 2009 +0100
+++ b/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c	Fri Dec 11 22:25:50 2009 +0100
@@ -527,7 +527,7 @@
 	err = m5602_read_sensor(sd, S5K4AA_ROWSTART_LO, &data, 1);
 	if (err < 0)
 		return err;
-	data = (data & 0xfe) | !val;
+	data = (data & 0xfe) | (val ? 0 : 1);
 	err = m5602_write_sensor(sd, S5K4AA_ROWSTART_LO, &data, 1);
 	return err;
 }
@@ -572,7 +572,7 @@
 	err = m5602_read_sensor(sd, S5K4AA_COLSTART_LO, &data, 1);
 	if (err < 0)
 		return err;
-	data = (data & 0xfe) | !val;
+	data = (data & 0xfe) | (val ? 0 : 1);
 	err = m5602_write_sensor(sd, S5K4AA_COLSTART_LO, &data, 1);
 	return err;
 }

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-12-12 11:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-11 21:33 [PATCH] gspca m5602: eliminate sparse warnings Németh Márton
2009-12-12 10:21 ` Jean-Francois Moine
2009-12-12 11:15   ` Németh Márton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox