kernel_optimize_test/drivers
Arnd Bergmann bb9bd87808 drivers/media/dvb-frontends/cxd2841er.c: avoid misleading gcc warning
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.de
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Abylay 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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-08-04 08:50:07 -04:00
..
accessibility
acpi Merge branch 'akpm' (patches from Andrew) 2016-08-02 21:08:07 -04:00
amba
android
ata
atm
auxdisplay
base firmware: support loading into a pre-allocated buffer 2016-08-02 19:35:10 -04:00
bcma
block Merge branch 'akpm' (patches from Andrew) 2016-08-02 21:08:07 -04:00
bluetooth
bus
cdrom
char
clk treewide: replace obsolete _refok by __ref 2016-08-02 17:31:41 -04:00
clocksource
connector
cpufreq
cpuidle
crypto
dax
dca
devfreq
dio
dma
dma-buf
edac
eisa
extcon
firewire
firmware tree-wide: replace config_enabled() with IS_ENABLED() 2016-08-04 08:50:07 -04:00
fmc
fpga drivers/fpga/Kconfig: fix build failure 2016-08-04 08:50:07 -04:00
gpio
gpu dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
hid
hsi
hv
hwmon
hwspinlock
hwtracing
i2c
ide
idle
iio
infiniband dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
input
iommu dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
ipack
irqchip tree-wide: replace config_enabled() with IS_ENABLED() 2016-08-04 08:50:07 -04:00
isdn
leds
lguest
lightnvm
macintosh
mailbox
mcb
md
media drivers/media/dvb-frontends/cxd2841er.c: avoid misleading gcc warning 2016-08-04 08:50:07 -04:00
memory
memstick memstick: don't allocate unused major for ms_block 2016-08-02 17:31:41 -04:00
message
mfd
misc dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
mmc
mtd tree-wide: replace config_enabled() with IS_ENABLED() 2016-08-04 08:50:07 -04:00
net tree-wide: replace config_enabled() with IS_ENABLED() 2016-08-04 08:50:07 -04:00
nfc
ntb
nubus
nvdimm
nvme PCI changes for the v4.8 merge window: 2016-08-02 17:12:29 -04:00
nvmem
of
oprofile
parisc dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
parport
pci tree-wide: replace config_enabled() with IS_ENABLED() 2016-08-04 08:50:07 -04:00
pcmcia
perf
phy
pinctrl
platform
pnp
power
powercap
pps
ps3
ptp
pwm
rapidio rapidio/switches: add driver for IDT gen3 switches 2016-08-02 19:35:38 -04:00
ras
regulator
remoteproc dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
reset
rpmsg
rtc
s390
sbus
scsi PCI changes for the v4.8 merge window: 2016-08-02 17:12:29 -04:00
sfi
sh
sn
soc
spi
spmi
ssb
staging
target
tc
thermal
thunderbolt
tty tree-wide: replace config_enabled() with IS_ENABLED() 2016-08-04 08:50:07 -04:00
uio
usb PCI changes for the v4.8 merge window: 2016-08-02 17:12:29 -04:00
uwb
vfio
vhost
video dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
virt
virtio
vlynq
vme
w1 w1:omap_hdq: fix regression 2016-08-02 19:35:40 -04:00
watchdog
xen dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
zorro
Kconfig
Makefile