linux-imx/drivers/acpi
Arnd Bergmann 555caacaef ACPI / power: Avoid maybe-uninitialized warning
commit fe8c470ab8 upstream.

gcc -O2 cannot always prove that the loop in acpi_power_get_inferred_state()
is enterered at least once, so it assumes that cur_state might not get
initialized:

drivers/acpi/power.c: In function 'acpi_power_get_inferred_state':
drivers/acpi/power.c:222:9: error: 'cur_state' may be used uninitialized in this function [-Werror=maybe-uninitialized]

This sets the variable to zero at the start of the loop, to ensure that
there is well-defined behavior even for an empty list. This gets rid of
the warning.

The warning first showed up when the -Os flag got removed in a bug fix
patch in linux-4.11-rc5.

I would suggest merging this addon patch on top of that bug fix to avoid
introducing a new warning in the stable kernels.

Fixes: 61b79e16c6 (ACPI: Fix incompatibility with mcount-based function graph tracing)
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
2017-05-09 08:19:37 +02:00
..
acpica ACPICA: acpi_get_sleep_type_data: Reduce warnings 2016-10-07 10:54:59 +02:00
apei ACPI / APEI: Fix incorrect return value of ghes_proc() 2016-11-24 16:23:49 +01:00
ac.c ACPI: Remove the old /proc/acpi/event interface 2013-07-15 13:56:36 +02:00
acpi_cmos_rtc.c ACPI / RTC: Fix CMOS RTC opregion handler accesses to wrong addresses 2014-10-13 15:41:04 +02:00
acpi_ipmi.c ACPI / IPMI: Fix atomic context requirement of ipmi_msg_handler() 2013-09-25 03:12:05 +02:00
acpi_lpss.c Revert "ACPI: Add BayTrail SoC GPIO and LPSS ACPI IDs" 2014-01-25 08:49:28 -08:00
acpi_memhotplug.c ACPI / memhotplug: add parameter to disable memory hotplug 2014-06-27 10:25:16 +02:00
acpi_pad.c PTR_RET() is a weird name, and led to some confusing usage. We ended 2013-09-04 17:31:11 -07:00
acpi_platform.c ACPI / scan: Drop unnecessary label from acpi_create_platform_device() 2013-08-07 01:11:33 +02:00
acpi_processor.c ACPI / processor: do not mark present at boot but not onlined CPU as onlined 2014-06-09 15:53:52 +02:00
battery.c ACPI / battery: Retry to get battery information if failed during probing 2014-07-18 15:51:31 +02:00
bgrt.c acpi: bgrt: fix build error due to attribute change 2013-08-22 08:34:39 -07:00
blacklist.c ACPI: blacklist win8 OSI for Dell Inspiron 7737 2014-06-09 15:53:52 +02:00
bus.c ACPI: Fix conflict between customized DSDT and DSDT local copy 2014-07-02 12:06:25 +02:00
button.c ACPI / button: Add ACPI Button event via netlink routine 2014-05-05 14:24:36 +02:00
cm_sbs.c
container.c Merge branch 'acpi-assorted' 2013-04-28 01:54:08 +02:00
custom_method.c The sweeping change is to make add_taint() explicitly indicate whether to disable 2013-02-25 15:41:43 -08:00
debugfs.c acpi: add export.h to files using THIS_MODULE/EXPORT_SYMBOL 2011-10-31 19:30:34 -04:00
device_pm.c ACPI / PM: Drop two functions that are not used any more 2013-10-17 15:44:48 +02:00
dock.c Merge branch 'acpi-assorted' 2013-08-27 01:29:04 +02:00
ec_sys.c ACPI / EC: access user space with get_user()/put_user() 2013-06-19 23:29:20 +02:00
ec.c ACPI / EC: Fix regression due to conflicting firmware behavior between Samsung and Acer. 2014-11-05 10:03:18 +01:00
event.c ACPI: Remove the old /proc/acpi/event interface 2013-07-15 13:56:36 +02:00
fan.c ACPI / PM: Use ACPI_STATE_D3_COLD instead of ACPI_STATE_D3 everywhere 2013-07-30 14:36:20 +02:00
glue.c ACPI / bind: Prefer device objects with _STA to those without it 2013-09-09 23:07:47 +02:00
hed.c ACPI: Remove useless type argument of driver .remove() operation 2013-01-26 00:37:24 +01:00
internal.h Merge back earlier 'acpi-assorted' material 2013-08-14 23:22:45 +02:00
Kconfig ACPI: remove /proc/acpi/event from ACPI_BUTTON help 2013-10-16 00:31:47 +02:00
Makefile ACPI: Fix incompatibility with mcount-based function graph tracing 2017-04-07 14:59:31 +02:00
numa.c ACPI / numa: Fix __init attribute location in slit_valid() 2013-08-13 12:35:42 +02:00
nvs.c ACPI / PM: print physical addresses consistently with other parts of kernel 2012-03-30 02:46:57 -04:00
osl.c ACPI / PNP: Reserve ACPI resources at the fs_initcall_sync stage 2017-04-11 08:04:33 +02:00
pci_irq.c ACPI / PCI: Fix memory leak in acpi_pci_irq_enable() 2014-03-05 17:13:47 +01:00
pci_link.c ACPI: Set length even for TYPE_END_TAG acpi resource 2013-03-24 01:00:38 +01:00
pci_root.c ACPI / hotplug: Fix conflicted PCI bridge notify handlers 2013-12-04 11:05:40 -08:00
pci_slot.c ACPI / PCI: Make bus registration and unregistration symmetric 2013-07-23 03:58:42 +02:00
power.c ACPI / power: Avoid maybe-uninitialized warning 2017-05-09 08:19:37 +02:00
proc.c ACPI / PM: Walk physical_node_list under physical_node_lock 2013-08-06 02:26:22 +02:00
processor_core.c Merge back earlier 'acpi-assorted' material 2013-08-14 23:22:45 +02:00
processor_driver.c Merge branch 'acpi-processor' 2013-08-27 01:29:24 +02:00
processor_idle.c ACPI / cpuidle: fix deadlock between cpuidle_lock and cpu_hotplug.lock 2014-09-17 16:55:09 +02:00
processor_perflib.c ACPI: introduce helper function acpi_has_method() 2013-07-15 01:33:10 +02:00
processor_thermal.c ACPI / processor: Remove acpi_processor_get_limit_info() 2013-08-13 12:11:22 +02:00
processor_throttling.c ACPI / processor: Rework processor throttling with work_on_cpu() 2014-03-05 17:13:48 +01:00
reboot.c Revert "ACPI: ignore FADT reset-reg-sup flag" 2012-04-20 11:19:35 -07:00
resource.c ACPI / PNP: Reserve ACPI resources at the fs_initcall_sync stage 2017-04-11 08:04:33 +02:00
sbs.c ACPI: Remove the old /proc/acpi/event interface 2013-07-15 13:56:36 +02:00
sbshc.c ACPI: Remove useless type argument of driver .remove() operation 2013-01-26 00:37:24 +01:00
sbshc.h
scan.c ACPI: Run fixed event device notifications in process context 2015-04-09 14:13:33 +02:00
sleep.c ACPI / sleep: remove panic in case hardware has changed after S4 2014-05-05 14:21:49 +02:00
sleep.h ACPI: Drop power resources driver 2013-01-17 14:11:06 +01:00
sysfs.c ACPI / sysfs: fix error code in get_status() 2016-09-23 09:29:23 +02:00
tables.c ACPICA: Cleanup table handler naming conflicts. 2013-01-11 13:10:16 +01:00
thermal.c Merge branch 'acpi-assorted' 2013-08-30 14:13:50 +02:00
utils.c ACPI: introduce two helper functions for _EJ0 and _LCK 2013-07-15 01:33:10 +02:00
video_detect.c Merge branch 'acpi-cleanup' 2013-08-27 01:25:28 +02:00
video.c ACPI / video: skip evaluating _DOD when it does not exist 2017-04-07 09:17:45 +02:00
wakeup.c ACPI / Wakeup: Enable button GPEs unconditionally during initialization 2011-02-12 01:39:53 +01:00