• Arnd Bergmann's avatar
    drivers/media/dvb-frontends/cxd2841er.c: avoid misleading gcc warning · bb9bd878
    Arnd Bergmann authored
    The addition of jump label support in dynamic_debug caused an unexpected
    warning in exactly one file in the kernel:
    
      drivers/media/dvb-frontends/cxd2841er.c: In function 'cxd2841er_tune_tc':
      include/linux/dynamic_debug.h:134:3: error: 'carrier_offset' may be used uninitialized in this function [-Werror=maybe-uninitialized]
         __dynamic_dev_dbg(&descriptor, dev, fmt, \
         ^~~~~~~~~~~~~~~~~
      drivers/media/dvb-frontends/cxd2841er.c:3177:11: note: 'carrier_offset' was declared here
        int ret, carrier_offset;
                 ^~~~~~~~~~~~~~
    
    The problem seems to be that the compiler gets confused by the extra
    conditionals in static_branch_unlikely, to the point where it can no
    longer keep track of which branches have already been taken, and it
    doesn't realize that this variable is now always initialized when it
    gets used.
    
    I have done lots of randconfig kernel builds and could not find any
    other file with this behavior, so I assume it's a rare enough glitch
    that we don't need to change the jump label support but instead just
    work around the warning in the driver.
    
    To achieve that, I'm moving the check for the return value into the
    switch() statement, which is an obvious transformation, but is enough to
    un-confuse the compiler here.  The resulting code is not as nice to
    read, but at least we retain the behavior of warning if it gets changed
    to actually access an uninitialized carrier offset value in the future.
    
    Link: http://lkml.kernel.org/r/20160713204342.1221511-1-arnd@arndb.deSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Acked-by: default avatarAbylay Ospan <aospan@netup.ru>
    Cc: Sergey Kozlov <serjk@netup.ru>
    Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
    Cc: Jason Baron <jbaron@akamai.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    bb9bd878
Name
Last commit
Last update
..
drx39xyj Loading commit data...
Kconfig Loading commit data...
Makefile Loading commit data...
a8293.c Loading commit data...
a8293.h Loading commit data...
af9013.c Loading commit data...
af9013.h Loading commit data...
af9013_priv.h Loading commit data...
af9033.c Loading commit data...
af9033.h Loading commit data...
af9033_priv.h Loading commit data...
as102_fe.c Loading commit data...
as102_fe.h Loading commit data...
as102_fe_types.h Loading commit data...
ascot2e.c Loading commit data...
ascot2e.h Loading commit data...
atbm8830.c Loading commit data...
atbm8830.h Loading commit data...
atbm8830_priv.h Loading commit data...
au8522.h Loading commit data...
au8522_common.c Loading commit data...
au8522_decoder.c Loading commit data...
au8522_dig.c Loading commit data...
au8522_priv.h Loading commit data...
bcm3510.c Loading commit data...
bcm3510.h Loading commit data...
bcm3510_priv.h Loading commit data...
bsbe1-d01a.h Loading commit data...
bsbe1.h Loading commit data...
bsru6.h Loading commit data...
cx22700.c Loading commit data...
cx22700.h Loading commit data...
cx22702.c Loading commit data...
cx22702.h Loading commit data...
cx24110.c Loading commit data...
cx24110.h Loading commit data...
cx24113.c Loading commit data...
cx24113.h Loading commit data...
cx24116.c Loading commit data...
cx24116.h Loading commit data...
cx24117.c Loading commit data...
cx24117.h Loading commit data...
cx24120.c Loading commit data...
cx24120.h Loading commit data...
cx24123.c Loading commit data...
cx24123.h Loading commit data...
cxd2820r.h Loading commit data...
cxd2820r_c.c Loading commit data...
cxd2820r_core.c Loading commit data...
cxd2820r_priv.h Loading commit data...
cxd2820r_t.c Loading commit data...
cxd2820r_t2.c Loading commit data...
cxd2841er.c Loading commit data...
cxd2841er.h Loading commit data...
cxd2841er_priv.h Loading commit data...
dib0070.c Loading commit data...
dib0070.h Loading commit data...
dib0090.c Loading commit data...
dib0090.h Loading commit data...
dib3000.h Loading commit data...
dib3000mb.c Loading commit data...
dib3000mb_priv.h Loading commit data...
dib3000mc.c Loading commit data...
dib3000mc.h Loading commit data...
dib7000m.c Loading commit data...
dib7000m.h Loading commit data...
dib7000p.c Loading commit data...
dib7000p.h Loading commit data...
dib8000.c Loading commit data...
dib8000.h Loading commit data...
dib9000.c Loading commit data...
dib9000.h Loading commit data...
dibx000_common.c Loading commit data...
dibx000_common.h Loading commit data...
drxd.h Loading commit data...
drxd_firm.c Loading commit data...
drxd_firm.h Loading commit data...
drxd_hard.c Loading commit data...
drxd_map_firm.h Loading commit data...
drxk.h Loading commit data...
drxk_hard.c Loading commit data...
drxk_hard.h Loading commit data...
drxk_map.h Loading commit data...
ds3000.c Loading commit data...
ds3000.h Loading commit data...
dvb-pll.c Loading commit data...
dvb-pll.h Loading commit data...
dvb_dummy_fe.c Loading commit data...
dvb_dummy_fe.h Loading commit data...
ec100.c Loading commit data...
ec100.h Loading commit data...
eds1547.h Loading commit data...
hd29l2.c Loading commit data...
hd29l2.h Loading commit data...
hd29l2_priv.h Loading commit data...
helene.c Loading commit data...
helene.h Loading commit data...
horus3a.c Loading commit data...
horus3a.h Loading commit data...
isl6405.c Loading commit data...
isl6405.h Loading commit data...
isl6421.c Loading commit data...
isl6421.h Loading commit data...
isl6423.c Loading commit data...
isl6423.h Loading commit data...
itd1000.c Loading commit data...
itd1000.h Loading commit data...
itd1000_priv.h Loading commit data...
ix2505v.c Loading commit data...
ix2505v.h Loading commit data...
l64781.c Loading commit data...
l64781.h Loading commit data...
lg2160.c Loading commit data...
lg2160.h Loading commit data...
lgdt3305.c Loading commit data...
lgdt3305.h Loading commit data...
lgdt3306a.c Loading commit data...
lgdt3306a.h Loading commit data...
lgdt330x.c Loading commit data...
lgdt330x.h Loading commit data...
lgdt330x_priv.h Loading commit data...
lgs8gl5.c Loading commit data...
lgs8gl5.h Loading commit data...
lgs8gxx.c Loading commit data...
lgs8gxx.h Loading commit data...
lgs8gxx_priv.h Loading commit data...
lnbh24.h Loading commit data...
lnbh25.c Loading commit data...
lnbh25.h Loading commit data...
lnbp21.c Loading commit data...
lnbp21.h Loading commit data...
lnbp22.c Loading commit data...
lnbp22.h Loading commit data...
m88ds3103.c Loading commit data...
m88ds3103.h Loading commit data...
m88ds3103_priv.h Loading commit data...
m88rs2000.c Loading commit data...
m88rs2000.h Loading commit data...
mb86a16.c Loading commit data...
mb86a16.h Loading commit data...
mb86a16_priv.h Loading commit data...
mb86a20s.c Loading commit data...
mb86a20s.h Loading commit data...
mn88472.c Loading commit data...
mn88472.h Loading commit data...
mn88472_priv.h Loading commit data...
mn88473.c Loading commit data...
mn88473.h Loading commit data...
mn88473_priv.h Loading commit data...
mt312.c Loading commit data...
mt312.h Loading commit data...
mt312_priv.h Loading commit data...
mt352.c Loading commit data...
mt352.h Loading commit data...
mt352_priv.h Loading commit data...
nxt200x.c Loading commit data...
nxt200x.h Loading commit data...
nxt6000.c Loading commit data...
nxt6000.h Loading commit data...
nxt6000_priv.h Loading commit data...
or51132.c Loading commit data...
or51132.h Loading commit data...
or51211.c Loading commit data...
or51211.h Loading commit data...
rtl2830.c Loading commit data...
rtl2830.h Loading commit data...
rtl2830_priv.h Loading commit data...
rtl2832.c Loading commit data...
rtl2832.h Loading commit data...
rtl2832_priv.h Loading commit data...
rtl2832_sdr.c Loading commit data...
rtl2832_sdr.h Loading commit data...
s5h1409.c Loading commit data...
s5h1409.h Loading commit data...
s5h1411.c Loading commit data...
s5h1411.h Loading commit data...
s5h1420.c Loading commit data...
s5h1420.h Loading commit data...
s5h1420_priv.h Loading commit data...
s5h1432.c Loading commit data...
s5h1432.h Loading commit data...
s921.c Loading commit data...
s921.h Loading commit data...
si2165.c Loading commit data...
si2165.h Loading commit data...
si2165_priv.h Loading commit data...
si2168.c Loading commit data...
si2168.h Loading commit data...
si2168_priv.h Loading commit data...
si21xx.c Loading commit data...
si21xx.h Loading commit data...
sp2.c Loading commit data...
sp2.h Loading commit data...
sp2_priv.h Loading commit data...
sp8870.c Loading commit data...
sp8870.h Loading commit data...
sp887x.c Loading commit data...
sp887x.h Loading commit data...
stb0899_algo.c Loading commit data...
stb0899_cfg.h Loading commit data...
stb0899_drv.c Loading commit data...
stb0899_drv.h Loading commit data...
stb0899_priv.h Loading commit data...
stb0899_reg.h Loading commit data...
stb6000.c Loading commit data...
stb6000.h Loading commit data...
stb6100.c Loading commit data...
stb6100.h Loading commit data...
stb6100_cfg.h Loading commit data...
stb6100_proc.h Loading commit data...
stv0288.c Loading commit data...
stv0288.h Loading commit data...
stv0297.c Loading commit data...
stv0297.h Loading commit data...
stv0299.c Loading commit data...
stv0299.h Loading commit data...
stv0367.c Loading commit data...
stv0367.h Loading commit data...
stv0367_priv.h Loading commit data...
stv0367_regs.h Loading commit data...
stv0900.h Loading commit data...
stv0900_core.c Loading commit data...
stv0900_init.h Loading commit data...
stv0900_priv.h Loading commit data...
stv0900_reg.h Loading commit data...
stv0900_sw.c Loading commit data...
stv090x.c Loading commit data...
stv090x.h Loading commit data...
stv090x_priv.h Loading commit data...
stv090x_reg.h Loading commit data...
stv6110.c Loading commit data...
stv6110.h Loading commit data...
stv6110x.c Loading commit data...
stv6110x.h Loading commit data...
stv6110x_priv.h Loading commit data...
stv6110x_reg.h Loading commit data...
tc90522.c Loading commit data...
tc90522.h Loading commit data...
tda10021.c Loading commit data...
tda10023.c Loading commit data...
tda1002x.h Loading commit data...
tda10048.c Loading commit data...
tda10048.h Loading commit data...
tda1004x.c Loading commit data...
tda1004x.h Loading commit data...
tda10071.c Loading commit data...
tda10071.h Loading commit data...
tda10071_priv.h Loading commit data...
tda10086.c Loading commit data...
tda10086.h Loading commit data...
tda18271c2dd.c Loading commit data...
tda18271c2dd.h Loading commit data...
tda18271c2dd_maps.h Loading commit data...
tda665x.c Loading commit data...
tda665x.h Loading commit data...
tda8083.c Loading commit data...
tda8083.h Loading commit data...
tda8261.c Loading commit data...
tda8261.h Loading commit data...
tda8261_cfg.h Loading commit data...
tda826x.c Loading commit data...
tda826x.h Loading commit data...
tdhd1.h Loading commit data...
ts2020.c Loading commit data...
ts2020.h Loading commit data...
tua6100.c Loading commit data...
tua6100.h Loading commit data...
ves1820.c Loading commit data...
ves1820.h Loading commit data...
ves1x93.c Loading commit data...
ves1x93.h Loading commit data...
z0194a.h Loading commit data...
zl10036.c Loading commit data...
zl10036.h Loading commit data...
zl10039.c Loading commit data...
zl10039.h Loading commit data...
zl10353.c Loading commit data...
zl10353.h Loading commit data...
zl10353_priv.h Loading commit data...