* [patch] video: comparing unsigned with negative 0
@ 2010-04-07 9:41 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2010-04-07 9:41 UTC (permalink / raw)
To: Mauro Carvalho Chehab
Cc: Guennadi Liakhovetski, Kuninori Morimoto, Magnus Damm,
Hans Verkuil, linux-media, kernel-janitors
soc_mbus_bytes_per_line() returns -EINVAL on error but we store it in an
unsigned int so the test for less than zero doesn't work. I think it
always returns "small" positive values so we can just cast it to int
here.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/drivers/media/video/sh_mobile_ceu_camera.c b/drivers/media/video/sh_mobile_ceu_camera.c
index 6e16b39..1ad980f 100644
--- a/drivers/media/video/sh_mobile_ceu_camera.c
+++ b/drivers/media/video/sh_mobile_ceu_camera.c
@@ -1633,7 +1633,7 @@ static int sh_mobile_ceu_try_fmt(struct soc_camera_device *icd,
height = pix->height;
pix->bytesperline = soc_mbus_bytes_per_line(width, xlate->host_fmt);
- if (pix->bytesperline < 0)
+ if ((int)pix->bytesperline < 0)
return pix->bytesperline;
pix->sizeimage = height * pix->bytesperline;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2010-04-07 9:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-07 9:41 [patch] video: comparing unsigned with negative 0 Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).