Re: [PATCH 07/18] media: staging: atomisp: fix endianess issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2018-03-26 at 17:10 -0400, Mauro Carvalho Chehab wrote:
> There are lots of be-related warnings there, as it doesn't properly
> mark what data uses bigendian.

> @@ -107,7 +107,7 @@ mt9m114_write_reg(struct i2c_client *client, u16
> data_length, u16 reg, u32 val)
>  	int num_msg;
>  	struct i2c_msg msg;
>  	unsigned char data[6] = {0};
> -	u16 *wreg;
> +	__be16 *wreg;
> 

> +		u16 *wdata = (void *)&data[2];
> +
> +		*wdata = be16_to_cpu(*(__be16 *)&data[2]);

> +		u32 *wdata = (void *)&data[2];
> +
> +		*wdata = be32_to_cpu(*(__be32 *)&data[2]);

For x86 it is okay, though in general it should use get_unaligned().

-- 
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Intel Finland Oy
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux