Linux-Media Archive mirror
 help / color / mirror / Atom feed
* [patch] [media] vpx3220: signedness bug in vpx3220_fp_read()
@ 2016-01-06 10:05 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2016-01-06 10:05 UTC (permalink / raw
  To: Mauro Carvalho Chehab
  Cc: Krzysztof Kozlowski, Hans Verkuil, linux-media, kernel-janitors

The intent was to return -1 on error and that's what the callers expect
but the current code returns USHRT_MAX instead.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/media/i2c/vpx3220.c b/drivers/media/i2c/vpx3220.c
index 4b564f1..90b693f 100644
--- a/drivers/media/i2c/vpx3220.c
+++ b/drivers/media/i2c/vpx3220.c
@@ -124,7 +124,7 @@ static int vpx3220_fp_write(struct v4l2_subdev *sd, u8 fpaddr, u16 data)
 	return 0;
 }
 
-static u16 vpx3220_fp_read(struct v4l2_subdev *sd, u16 fpaddr)
+static int vpx3220_fp_read(struct v4l2_subdev *sd, u16 fpaddr)
 {
 	struct i2c_client *client = v4l2_get_subdevdata(sd);
 	s16 data;

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-01-06 10:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-06 10:05 [patch] [media] vpx3220: signedness bug in vpx3220_fp_read() 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 read-only IMAP folder(s) and NNTP newsgroup(s).