1
0
Fork 0
alistair23-linux/drivers
Linus Torvalds 194dc870a5 Add braces to avoid "ambiguous ‘else’" compiler warnings
Some of our "for_each_xyz()" macro constructs make gcc unhappy about
lack of braces around if-statements inside or outside the loop, because
the loop construct itself has a "if-then-else" statement inside of it.

The resulting warnings look something like this:

  drivers/gpu/drm/i915/i915_debugfs.c: In function ‘i915_dump_lrc’:
  drivers/gpu/drm/i915/i915_debugfs.c:2103:6: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wparentheses]
     if (ctx != dev_priv->kernel_context)
        ^

even if the code itself is fine.

Since the warning is fairly easy to avoid by adding a braces around the
if-statement near the for_each_xyz() construct, do so, rather than
disabling the otherwise potentially useful warning.

(The if-then-else statements used in the "for_each_xyz()" constructs are
designed to be inherently safe even with no braces, but in this case
it's quite understandable that gcc isn't really able to tell that).

This finally leaves the standard "allmodconfig" build with just a
handful of remaining warnings, so new and valid warnings hopefully will
stand out.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-07-27 20:03:31 -07:00
..
accessibility
acpi xen: features and fixes for 4.8-rc0 2016-07-27 11:35:37 -07:00
amba
android
ata New LED class driver: 2016-07-27 14:03:52 -07:00
atm drivers: atm: nicstar: Use the correct function to free some resources 2016-07-19 11:30:26 -07:00
auxdisplay
base Merge branch 'akpm' (patches from Andrew) 2016-07-26 19:55:54 -07:00
bcma wireless-drivers-next patches for 4.8 2016-07-25 11:09:19 -07:00
block xen: features and fixes for 4.8-rc0 2016-07-27 11:35:37 -07:00
bluetooth Bluetooth: btmrvl: reset is_suspending flag in failure path 2016-07-18 10:13:02 +02:00
bus
cdrom cdrom: support read sub-channel command in LBA format 2016-07-12 08:24:50 -07:00
char A number of improvements for the /dev/random driver; the most 2016-07-27 15:11:55 -07:00
clk clk: at91: fix clk_programmable_set_parent() 2016-07-18 17:45:41 -07:00
clocksource clocksource/drivers/time-armada-370-xp: Fix return value check 2016-07-12 17:33:22 +02:00
connector connector: make cn_proc explicitly non-modular 2016-07-05 11:40:47 -07:00
cpufreq Power management material for v4.8-rc1 2016-07-26 17:29:07 -07:00
cpuidle cpuidle: introduce CPU_PM_CPU_IDLE_ENTER macro for ARM{32, 64} 2016-07-21 23:29:38 +02:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2016-07-26 13:40:17 -07:00
dax
dca
devfreq PM / devfreq: exynos-bus: add missing of_node_put after calling of_parse_phandle 2016-07-06 13:11:24 +09:00
dio
dma dmaengine: hsu: Export hsu_dma_get_status() 2016-06-25 14:30:42 -07:00
dma-buf
edac * Altera Arria10 ethernet FIFO buffer support (Thor Thayer) 2016-07-27 13:40:47 -07:00
eisa
extcon extcon: adc-jack: add suspend/resume support 2016-07-02 14:31:34 +09:00
firewire
firmware xen: features and fixes for 4.8-rc0 2016-07-27 11:35:37 -07:00
fmc
fpga
gpio This is the bulk of GPIO changes for the v4.8 kernel cycle. 2016-07-26 19:16:01 -07:00
gpu Add braces to avoid "ambiguous ‘else’" compiler warnings 2016-07-27 20:03:31 -07:00
hid HID: multitouch: enable palm rejection for Windows Precision Touchpad 2016-06-28 13:24:14 +02:00
hsi HSI: omap_ssi: drop pm_runtime_irq_safe 2016-06-28 00:40:08 +02:00
hv random: add interrupt callback to VMBus IRQ handler 2016-06-13 11:54:33 -04:00
hwmon Merge branch 'i2c/for-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2016-07-27 14:19:25 -07:00
hwspinlock
hwtracing intel_th: Fixes -stable 2016-07-15 14:19:11 +09:00
i2c Merge branch 'i2c/for-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2016-07-27 14:19:25 -07:00
ide New LED class driver: 2016-07-27 14:03:52 -07:00
idle intel_idle: correct BXT support 2016-07-09 01:05:30 +02:00
iio Third set of IIO new device support, features and cleanups for the 4.8 cycle. 2016-07-14 12:05:29 +09:00
infiniband Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-07-24 00:53:32 -04:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2016-07-27 14:30:41 -07:00
iommu Add braces to avoid "ambiguous ‘else’" compiler warnings 2016-07-27 20:03:31 -07:00
ipack
irqchip Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-07-25 21:35:03 -07:00
isdn isdn: eicon: fix old-style declarations 2016-06-16 22:06:30 -07:00
leds leds: is31fl32xx: define complete i2c_device_id table 2016-07-19 13:58:42 +02:00
lguest
lightnvm block: get rid of bio_rw and READA 2016-07-20 17:37:01 -06:00
macintosh powerpc: use the new LED disk activity trigger 2016-06-27 08:58:40 +02:00
mailbox
mcb mcb: Acquire reference to carrier module in core 2016-06-13 18:49:30 -07:00
md - initially based on Jens' 'for-4.8/core' (given all the flag churn) and 2016-07-26 17:12:11 -07:00
media media updates for v4.8-rc1 2016-07-27 14:58:31 -07:00
memory memory: omap-gpmc: Fix omap gpmc EXTRADELAY timing 2016-06-16 11:43:48 +03:00
memstick memstick: don't allow REQ_TYPE_BLOCK_PC requests 2016-07-20 17:38:27 -06:00
message
mfd Merge remote-tracking branches 'regulator/topic/qcom-spmi', 'regulator/topic/rn5t618', 'regulator/topic/tps65218' and 'regulator/topic/twl' into regulator-next 2016-07-20 18:02:08 +01:00
misc Merge branch 'i2c/for-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2016-07-27 14:19:25 -07:00
mmc Merge branch 'for-4.8/drivers' of git://git.kernel.dk/linux-block 2016-07-26 15:37:51 -07:00
mtd Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2016-07-27 12:03:20 -07:00
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2016-07-27 12:03:20 -07:00
nfc NFC 4.8 pull request 2016-07-20 23:39:36 -07:00
ntb
nubus
nvdimm Merge branch 'for-4.8/drivers' of git://git.kernel.dk/linux-block 2016-07-26 15:37:51 -07:00
nvme Merge branch 'for-4.8/drivers' of git://git.kernel.dk/linux-block 2016-07-26 15:37:51 -07:00
nvmem nvmem: imx-ocotp: Fix assignment warning. 2016-06-25 07:42:55 -07:00
of Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2016-07-27 12:03:20 -07:00
oprofile
parisc
parport
pci Power management material for v4.8-rc1 2016-07-26 17:29:07 -07:00
pcmcia
perf drivers/perf: arm-pmu: Handle per-interrupt affinity mask 2016-07-08 17:39:55 +01:00
phy Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2016-07-27 12:03:20 -07:00
pinctrl This is the bulk of GPIO changes for the v4.8 kernel cycle. 2016-07-26 19:16:01 -07:00
platform platform-drivers-x86 for 4.8-1 2016-07-26 17:23:08 -07:00
pnp PNP material for v4.8-rc1 2016-07-26 18:27:20 -07:00
power power supply and reset changes for the v4.8 series 2016-07-26 19:49:09 -07:00
powercap powercap / RAPL: Add support for Ivy Bridge server 2016-06-25 03:00:58 +02:00
pps pps: do not crash when failed to register 2016-07-23 10:25:54 +09:00
ps3
ptp
pwm pwm: atmel-hlcdc: Fix default PWM polarity 2016-06-14 10:51:45 +02:00
rapidio
ras
regulator Merge remote-tracking branches 'regulator/topic/qcom-spmi', 'regulator/topic/rn5t618', 'regulator/topic/tps65218' and 'regulator/topic/twl' into regulator-next 2016-07-20 18:02:08 +01:00
remoteproc
reset
rpmsg
rtc
s390 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2016-07-27 12:03:20 -07:00
sbus
scsi SCSI misc on 20160727 2016-07-27 14:48:37 -07:00
sfi
sh
sn
soc
spi spi: Updates for v4.8 2016-07-27 14:11:43 -07:00
spmi
ssb
staging Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2016-07-27 12:03:20 -07:00
target Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2016-07-27 12:03:20 -07:00
tc
thermal Merge branch 'x86/cpu' into x86/platform, to avoid conflict 2016-06-14 12:25:07 +02:00
thunderbolt
tty mm: oom: add memcg to oom_control 2016-07-26 16:19:19 -07:00
uio
usb media updates for v4.8-rc1 2016-07-26 18:59:59 -07:00
uwb
vfio
vhost tun: switch to use skb array for tx 2016-07-01 05:32:17 -04:00
video fbmon: remove unused function argument 2016-07-26 16:19:19 -07:00
virt
virtio mm: fix build warnings in <linux/compaction.h> 2016-07-26 16:19:19 -07:00
vlynq
vme
w1
watchdog watchdog: ebc-c384_wdt: Allow build for X86_64 2016-06-17 20:21:12 -07:00
xen xen: features and fixes for 4.8-rc0 2016-07-27 11:35:37 -07:00
zorro
Kconfig
Makefile HSI changes for the v4.8 series 2016-07-27 15:18:53 -07:00