提交 baa6f19b 编写于 作者: M Mauro Carvalho Chehab

media: ov5670: get rid of a series of __be warnings

There are some troubles on this driver with respect to the usage
of __be16 and __b32 macros:

	drivers/media/i2c/ov5670.c:1857:27: warning: incorrect type in initializer (different base types)
	drivers/media/i2c/ov5670.c:1857:27:    expected unsigned short [unsigned] [usertype] reg_addr_be
	drivers/media/i2c/ov5670.c:1857:27:    got restricted __be16 [usertype] <noident>
	drivers/media/i2c/ov5670.c:1880:16: warning: cast to restricted __be32
	drivers/media/i2c/ov5670.c:1880:16: warning: cast to restricted __be32
	drivers/media/i2c/ov5670.c:1880:16: warning: cast to restricted __be32
	drivers/media/i2c/ov5670.c:1880:16: warning: cast to restricted __be32
	drivers/media/i2c/ov5670.c:1880:16: warning: cast to restricted __be32
	drivers/media/i2c/ov5670.c:1880:16: warning: cast to restricted __be32
	drivers/media/i2c/ov5670.c:1901:13: warning: incorrect type in assignment (different base types)
	drivers/media/i2c/ov5670.c:1901:13:    expected unsigned int [unsigned] [usertype] val
	drivers/media/i2c/ov5670.c:1901:13:    got restricted __be32 [usertype] <noident>

Fix them.
Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
上级 43d1ed08
...@@ -1853,8 +1853,8 @@ static int ov5670_read_reg(struct ov5670 *ov5670, u16 reg, unsigned int len, ...@@ -1853,8 +1853,8 @@ static int ov5670_read_reg(struct ov5670 *ov5670, u16 reg, unsigned int len,
struct i2c_client *client = v4l2_get_subdevdata(&ov5670->sd); struct i2c_client *client = v4l2_get_subdevdata(&ov5670->sd);
struct i2c_msg msgs[2]; struct i2c_msg msgs[2];
u8 *data_be_p; u8 *data_be_p;
u32 data_be = 0; __be32 data_be = 0;
u16 reg_addr_be = cpu_to_be16(reg); __be16 reg_addr_be = cpu_to_be16(reg);
int ret; int ret;
if (len > 4) if (len > 4)
...@@ -1891,6 +1891,7 @@ static int ov5670_write_reg(struct ov5670 *ov5670, u16 reg, unsigned int len, ...@@ -1891,6 +1891,7 @@ static int ov5670_write_reg(struct ov5670 *ov5670, u16 reg, unsigned int len,
int val_i; int val_i;
u8 buf[6]; u8 buf[6];
u8 *val_p; u8 *val_p;
__be32 tmp;
if (len > 4) if (len > 4)
return -EINVAL; return -EINVAL;
...@@ -1898,8 +1899,8 @@ static int ov5670_write_reg(struct ov5670 *ov5670, u16 reg, unsigned int len, ...@@ -1898,8 +1899,8 @@ static int ov5670_write_reg(struct ov5670 *ov5670, u16 reg, unsigned int len,
buf[0] = reg >> 8; buf[0] = reg >> 8;
buf[1] = reg & 0xff; buf[1] = reg & 0xff;
val = cpu_to_be32(val); tmp = cpu_to_be32(val);
val_p = (u8 *)&val; val_p = (u8 *)&tmp;
buf_i = 2; buf_i = 2;
val_i = 4 - len; val_i = 4 - len;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册