android_kernel_oneplus_msm8998/drivers/media/i2c
Arnd Bergmann f9e5537086 tc358743: fix register i2c_rd/wr functions
commit 3538aa6ecfb2dd727a40f9ebbbf25a0c2afe6226 upstream.

While testing with CONFIG_UBSAN, I got this warning:

drivers/media/i2c/tc358743.c: In function 'tc358743_probe':
drivers/media/i2c/tc358743.c:1930:1: error: the frame size of 2480 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]

The problem is that the i2c_rd8/wr8/rd16/... functions in this driver pass
a pointer to a local variable into a common function, and each call to one
of them adds another variable plus redzone to the stack.

I also noticed that the way this is done is broken on big-endian machines,
as we copy the registers in CPU byte order.

To address both those problems, I'm adding two helper functions for reading
a register of up to 32 bits with correct endianess and change all other
functions to use that instead. Just to be sure we don't get the problem
back with changed optimizations in gcc, I'm also marking the new functions
as 'noinline', although my tests with gcc-7 don't require that.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-25 11:03:48 +01:00
..
cx25840
m5mols
s5c73m3 v4l: s5c73m3: fix negation operator 2017-08-06 19:19:42 -07:00
smiapp
soc_camera
ad9389b.c
adp1653.c
adv7170.c
adv7175.c
adv7180.c
adv7183.c
adv7183_regs.h
adv7343.c
adv7343_regs.h
adv7393.c
adv7393_regs.h
adv7511.c
adv7604.c adv7604: Initialize drive strength to default when using DT 2017-11-15 17:13:09 +01:00
adv7842.c
ak881x.c
aptina-pll.c
aptina-pll.h
as3645a.c
bt819.c
bt856.c
bt866.c
cs53l32a.c
cs5345.c
ir-kbd-i2c.c
Kconfig
ks0127.c
ks0127.h
lm3560.c
lm3646.c
m52790.c
Makefile
ml86v7667.c
msp3400-driver.c
msp3400-driver.h
msp3400-kthreads.c
mt9m032.c
mt9p031.c
mt9t001.c
mt9v011.c
mt9v032.c
noon010pc30.c
ov2659.c
ov7640.c
ov7670.c
ov9650.c
s5k4ecgx.c
s5k5baf.c
s5k6a3.c
s5k6aa.c media: s5k6aa: describe some function parameters 2018-02-25 11:03:39 +01:00
saa711x_regs.h
saa717x.c
saa6588.c
saa6752hs.c
saa7110.c
saa7115.c
saa7127.c
saa7185.c
smiapp-pll.c
smiapp-pll.h
sony-btf-mpx.c
sr030pc30.c
tc358743.c tc358743: fix register i2c_rd/wr functions 2018-02-25 11:03:48 +01:00
tc358743_regs.h
tda7432.c
tda9840.c
tea6415c.c
tea6415c.h
tea6420.c
tea6420.h
ths7303.c
ths8200.c
ths8200_regs.h
tlv320aic23b.c
tvaudio.c
tvp514x.c
tvp514x_regs.h
tvp5150.c
tvp5150_reg.h
tvp7002.c
tvp7002_reg.h
tw2804.c
tw9903.c
tw9906.c
uda1342.c
upd64031a.c
upd64083.c
vp27smpx.c
vpx3220.c
vs6624.c
vs6624_regs.h
wm8739.c
wm8775.c