Commit 0348bb1a authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] s5k5baf: fix sparse warnings

drivers/media/i2c/s5k5baf.c:1796:33: warning: duplicate const
drivers/media/i2c/s5k5baf.c:379:24: warning: cast to restricted __le16
drivers/media/i2c/s5k5baf.c:437:11: warning: incorrect type in assignment (different base types)
drivers/media/i2c/s5k5baf.c:445:16: warning: incorrect type in return expression (different base types)
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Acked-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 7c7586bb
...@@ -353,7 +353,7 @@ static struct v4l2_rect s5k5baf_cis_rect = { ...@@ -353,7 +353,7 @@ static struct v4l2_rect s5k5baf_cis_rect = {
* *
*/ */
static int s5k5baf_fw_parse(struct device *dev, struct s5k5baf_fw **fw, static int s5k5baf_fw_parse(struct device *dev, struct s5k5baf_fw **fw,
size_t count, const u16 *data) size_t count, const __le16 *data)
{ {
struct s5k5baf_fw *f; struct s5k5baf_fw *f;
u16 *d, i, *end; u16 *d, i, *end;
...@@ -421,6 +421,7 @@ static u16 s5k5baf_i2c_read(struct s5k5baf *state, u16 addr) ...@@ -421,6 +421,7 @@ static u16 s5k5baf_i2c_read(struct s5k5baf *state, u16 addr)
{ {
struct i2c_client *c = v4l2_get_subdevdata(&state->sd); struct i2c_client *c = v4l2_get_subdevdata(&state->sd);
__be16 w, r; __be16 w, r;
u16 res;
struct i2c_msg msg[] = { struct i2c_msg msg[] = {
{ .addr = c->addr, .flags = 0, { .addr = c->addr, .flags = 0,
.len = 2, .buf = (u8 *)&w }, .len = 2, .buf = (u8 *)&w },
...@@ -434,15 +435,15 @@ static u16 s5k5baf_i2c_read(struct s5k5baf *state, u16 addr) ...@@ -434,15 +435,15 @@ static u16 s5k5baf_i2c_read(struct s5k5baf *state, u16 addr)
w = cpu_to_be16(addr); w = cpu_to_be16(addr);
ret = i2c_transfer(c->adapter, msg, 2); ret = i2c_transfer(c->adapter, msg, 2);
r = be16_to_cpu(r); res = be16_to_cpu(r);
v4l2_dbg(3, debug, c, "i2c_read: 0x%04x : 0x%04x\n", addr, r); v4l2_dbg(3, debug, c, "i2c_read: 0x%04x : 0x%04x\n", addr, res);
if (ret != 2) { if (ret != 2) {
v4l2_err(c, "i2c_read: error during transfer (%d)\n", ret); v4l2_err(c, "i2c_read: error during transfer (%d)\n", ret);
state->error = ret; state->error = ret;
} }
return r; return res;
} }
static void s5k5baf_i2c_write(struct s5k5baf *state, u16 addr, u16 val) static void s5k5baf_i2c_write(struct s5k5baf *state, u16 addr, u16 val)
...@@ -1037,7 +1038,7 @@ static int s5k5baf_load_setfile(struct s5k5baf *state) ...@@ -1037,7 +1038,7 @@ static int s5k5baf_load_setfile(struct s5k5baf *state)
} }
ret = s5k5baf_fw_parse(&c->dev, &state->fw, fw->size / 2, ret = s5k5baf_fw_parse(&c->dev, &state->fw, fw->size / 2,
(u16 *)fw->data); (__le16 *)fw->data);
release_firmware(fw); release_firmware(fw);
...@@ -1793,7 +1794,7 @@ static const struct v4l2_subdev_ops s5k5baf_subdev_ops = { ...@@ -1793,7 +1794,7 @@ static const struct v4l2_subdev_ops s5k5baf_subdev_ops = {
static int s5k5baf_configure_gpios(struct s5k5baf *state) static int s5k5baf_configure_gpios(struct s5k5baf *state)
{ {
static const char const *name[] = { "S5K5BAF_STBY", "S5K5BAF_RST" }; static const char * const name[] = { "S5K5BAF_STBY", "S5K5BAF_RST" };
struct i2c_client *c = v4l2_get_subdevdata(&state->sd); struct i2c_client *c = v4l2_get_subdevdata(&state->sd);
struct s5k5baf_gpio *g = state->gpios; struct s5k5baf_gpio *g = state->gpios;
int ret, i; int ret, i;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment