Commit a7bc5773 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

ov13858: fix endiannes warnings

3 warning regressions:
  + drivers/media/i2c/ov13858.c: warning: cast to restricted __be32:  => 1093:16
  + drivers/media/i2c/ov13858.c: warning: incorrect type in assignment (different base types):  => 1111:13
  + drivers/media/i2c/ov13858.c: warning: incorrect type in initializer (different base types):  => 1071:27
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 3b498424
...@@ -1061,14 +1061,15 @@ struct ov13858 { ...@@ -1061,14 +1061,15 @@ struct ov13858 {
#define to_ov13858(_sd) container_of(_sd, struct ov13858, sd) #define to_ov13858(_sd) container_of(_sd, struct ov13858, sd)
/* Read registers up to 4 at a time */ /* Read registers up to 4 at a time */
static int ov13858_read_reg(struct ov13858 *ov13858, u16 reg, u32 len, u32 *val) static int ov13858_read_reg(struct ov13858 *ov13858, u16 reg, u32 len,
u32 *val)
{ {
struct i2c_client *client = v4l2_get_subdevdata(&ov13858->sd); struct i2c_client *client = v4l2_get_subdevdata(&ov13858->sd);
struct i2c_msg msgs[2]; struct i2c_msg msgs[2];
u8 *data_be_p; u8 *data_be_p;
int ret; int ret;
u32 data_be = 0; __be32 data_be = 0;
u16 reg_addr_be = cpu_to_be16(reg); __be16 reg_addr_be = cpu_to_be16(reg);
if (len > 4) if (len > 4)
return -EINVAL; return -EINVAL;
...@@ -1096,11 +1097,13 @@ static int ov13858_read_reg(struct ov13858 *ov13858, u16 reg, u32 len, u32 *val) ...@@ -1096,11 +1097,13 @@ static int ov13858_read_reg(struct ov13858 *ov13858, u16 reg, u32 len, u32 *val)
} }
/* Write registers up to 4 at a time */ /* Write registers up to 4 at a time */
static int ov13858_write_reg(struct ov13858 *ov13858, u16 reg, u32 len, u32 val) static int ov13858_write_reg(struct ov13858 *ov13858, u16 reg, u32 len,
u32 __val)
{ {
struct i2c_client *client = v4l2_get_subdevdata(&ov13858->sd); struct i2c_client *client = v4l2_get_subdevdata(&ov13858->sd);
int buf_i, val_i; int buf_i, val_i;
u8 buf[6], *val_p; u8 buf[6], *val_p;
__be32 val;
if (len > 4) if (len > 4)
return -EINVAL; return -EINVAL;
...@@ -1108,7 +1111,7 @@ static int ov13858_write_reg(struct ov13858 *ov13858, u16 reg, u32 len, u32 val) ...@@ -1108,7 +1111,7 @@ static int ov13858_write_reg(struct ov13858 *ov13858, u16 reg, u32 len, u32 val)
buf[0] = reg >> 8; buf[0] = reg >> 8;
buf[1] = reg & 0xff; buf[1] = reg & 0xff;
val = cpu_to_be32(val); val = cpu_to_be32(__val);
val_p = (u8 *)&val; val_p = (u8 *)&val;
buf_i = 2; buf_i = 2;
val_i = 4 - len; val_i = 4 - len;
......
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