android_kernel_google_msm/drivers
Julia Lawall 3a8ca95e9d drivers/misc: elide a non-zero test on a result that is never 0
The function thermal_cooling_device_register always returns either a valid
pointer or a value made with ERR_PTR, so a test for non-zero on the result
will always succeed.

The problem was found using the following semantic match.
(http://www.emn.fr/x-info/coccinelle/)

//<smpl>
@a@
expression E, E1;
statement S,S1;
position p;
@@

E = thermal_cooling_device_register(...)
... when != E = E1
if@p (E) S else S1

@n@
position a.p;
expression E,E1;
statement S,S1;
@@

E = NULL
... when != E = E1
if@p (E) S else S1

@depends on !n@
expression E;
statement S,S1;
position a.p;
@@

* if@p (E)
  S else S1
//</smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: Thomas Sujith <sujith.thomas@intel.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-29 08:06:04 -07:00
..
acorn/char
acpi [CPUFREQ] change cpu freq tables to per_cpu variables 2008-04-28 15:05:44 -04:00
amba
ata typo in sata_fsl 2008-04-28 10:03:31 -07:00
atm drivers: atm, char fix integer as NULL pointer warnings 2008-04-28 17:29:18 -07:00
auxdisplay
base
block drivers/block/floppy.c: replace init_module&cleanup_module with module_init&module_exit 2008-04-29 08:06:03 -07:00
bluetooth
cdrom
char sysrq: add show-backtrace-on-all-cpus function 2008-04-29 08:06:03 -07:00
clocksource
connector
cpufreq [CPUFREQ] fix show_trans_table 2008-04-28 15:05:44 -04:00
cpuidle
crypto
dca
dio
dma
edac
eisa
firewire
firmware firmware: replace remaining __FUNCTION__ occurrences 2008-04-29 08:06:03 -07:00
gpio gpiochip_reserve() 2008-04-28 08:58:34 -07:00
hid usbhid endianness annotations and fixes 2008-04-28 10:03:31 -07:00
hwmon
i2c
ide siimage: coding style cleanup (take 2) 2008-04-28 23:44:44 +02:00
ieee1394 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 2008-04-25 12:24:06 -07:00
infiniband
input usb input endianness annotations and fixes 2008-04-28 10:03:31 -07:00
isdn isdn: rename CONFIG_AVMB1_COMPAT to not look like a Kconfig variable 2008-04-28 08:58:34 -07:00
leds leds: Add default-on trigger 2008-04-25 00:06:52 +01:00
lguest
macintosh mac-hid: fix build after lockdep annotation 2008-04-25 18:57:09 -07:00
mca remove mca_is_adapter_used() 2008-04-29 08:06:01 -07:00
md drivers/md: use time_before, time_before_eq, etc 2008-04-28 08:58:42 -07:00
media media: fix integer as NULL pointer warnings 2008-04-28 17:31:13 -07:00
memstick
message
mfd mfd: use shorter set_current_state() 2008-04-28 08:58:32 -07:00
misc drivers/misc: elide a non-zero test on a result that is never 0 2008-04-29 08:06:04 -07:00
mmc
mtd drivers: fix integer as NULL pointer warnings 2008-04-28 17:31:13 -07:00
net Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus 2008-04-28 10:51:43 -07:00
nubus
of
oprofile oprofile: change cpu_buffer from array to per_cpu variable 2008-04-28 08:58:31 -07:00
parisc
parport
pci drivers: fix integer as NULL pointer warnings 2008-04-28 17:31:13 -07:00
pcmcia ARM: always select HAVE_IDE 2008-04-28 23:44:43 +02:00
pnp PNP: use dev_printk for quirk messages 2008-04-28 08:58:43 -07:00
power power: replace remaining __FUNCTION__ occurrences 2008-04-29 08:05:58 -07:00
ps3
rapidio
rtc rtc: replace remaining __FUNCTION__ occurrences 2008-04-28 08:58:17 -07:00
s390 return pfn from direct_access, for XIP 2008-04-28 08:58:23 -07:00
sbus
scsi scsi: fix integer as NULL pointer warnings 2008-04-28 17:31:13 -07:00
serial Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus 2008-04-28 10:51:43 -07:00
sh
sn
spi spi: spi_imx updates 2008-04-28 08:58:31 -07:00
ssb
tc
telephony
thermal
uio
usb drivers/usb annotations and fixes 2008-04-28 10:03:31 -07:00
video Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 2008-04-28 09:45:57 -07:00
virtio
w1
watchdog
xen xen: add balloon driver 2008-04-24 23:57:33 +02:00
zorro
Kconfig xen: add balloon driver 2008-04-24 23:57:33 +02:00
Makefile