]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit - drivers/media/i2c/saa717x.c
[media] saa717x: fix multi-byte read code
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 28 Apr 2015 13:28:13 +0000 (10:28 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Thu, 30 Apr 2015 16:35:13 +0000 (13:35 -0300)
commit4c7ba4082f903c2df3801a26bf3199544c081830
treeb085aa89c5b8b4de655b12175b3fc70c545268ee
parent3c71d978c5e6dadfc798e84290014f713f56c97b
[media] saa717x: fix multi-byte read code

As reported by smatch:
drivers/media/i2c/saa717x.c:155 saa717x_read() warn: mask and shift to zero
drivers/media/i2c/saa717x.c:155 saa717x_read() warn: mask and shift to zero

This is done right at saa717x_write(), but the read function is
broken. Thankfully, there's just one place at saa717x driver that
uses multibyte read (for status report, via printk).

Yet, let's fix it. From saa717x_write(), it is clear that the
bytes are in little endian:
mm1[4] = (value >> 16) & 0xff;
mm1[3] = (value >> 8) & 0xff;
mm1[2] = value & 0xff;

So, the same order should be valid for read too.

Compile-tested only.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/i2c/saa717x.c