소스 검색

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: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab 7 년 전
부모
커밋
baa6f19b37
1개의 변경된 파일5개의 추가작업 그리고 4개의 파일을 삭제
  1. 5 4
      drivers/media/i2c/ov5670.c

+ 5 - 4
drivers/media/i2c/ov5670.c

@@ -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;
-	u16 reg_addr_be = cpu_to_be16(reg);
+	__be32 data_be = 0;
+	__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,
 	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,
 	buf[0] = reg >> 8;
 	buf[0] = reg >> 8;
 	buf[1] = reg & 0xff;
 	buf[1] = reg & 0xff;
 
 
-	val = cpu_to_be32(val);
-	val_p = (u8 *)&val;
+	tmp = cpu_to_be32(val);
+	val_p = (u8 *)&tmp;
 	buf_i = 2;
 	buf_i = 2;
 	val_i = 4 - len;
 	val_i = 4 - len;