WSL2-Linux-Kernel/drivers/acpi
Arnd Bergmann fe8c470ab8 ACPI / power: Avoid maybe-uninitialized warning
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)
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-04-19 22:46:10 +02:00
..
acpica Revert "ACPICA: Resources: Not a valid resource if buffer length too long" 2017-04-13 18:23:46 +02:00
apei ACPI / APEI: Add missing synchronize_rcu() on NOTIFY_SCI removal 2017-03-28 23:43:42 +02:00
arm64
dptf
nfit acpi, nfit, libnvdimm: fix interleave set cookie calculation (64-bit comparison) 2017-03-27 21:53:38 -07:00
pmic
Kconfig
Makefile ACPI: Fix incompatibility with mcount-based function graph tracing 2017-03-28 23:54:43 +02:00
ac.c
acpi_amba.c
acpi_apd.c
acpi_cmos_rtc.c
acpi_configfs.c
acpi_dbg.c
acpi_extlog.c
acpi_ipmi.c
acpi_lpat.c
acpi_lpss.c pwm: Changes for v4.11-rc1 2017-03-01 09:46:02 -08:00
acpi_memhotplug.c
acpi_pad.c sched/headers: Prepare for new header dependencies before moving code to <uapi/linux/sched/types.h> 2017-03-02 08:42:27 +01:00
acpi_platform.c ACPI: Do not create a platform_device for IOAPIC/IOxAPIC 2017-03-28 23:37:19 +02:00
acpi_pnp.c
acpi_processor.c acpi/processor: Check for duplicate processor ids at hotplug time 2017-03-11 14:41:20 +01:00
acpi_video.c
acpi_watchdog.c
battery.c
battery.h
bgrt.c
blacklist.c
bus.c Revert "x86/acpi: Set persistent cpuid <-> nodeid mapping when booting" 2017-03-11 14:41:18 +01:00
button.c
cm_sbs.c
container.c
cppc_acpi.c
custom_method.c
debugfs.c
device_pm.c
device_sysfs.c
dock.c
ec.c
ec_sys.c
event.c
evged.c
fan.c
glue.c ACPI / scan: Prefer devices without _HID for _ADR matching 2017-04-01 00:55:22 +02:00
hed.c
internal.h x86/ioapic: Split IOAPIC hot-removal into two steps 2017-03-01 10:51:41 +01:00
ioapic.c ACPI: ioapic: Clear on-stack resource before using it 2017-03-28 23:31:45 +02:00
irq.c
numa.c
nvs.c
osi.c
osl.c
pci_irq.c
pci_link.c
pci_mcfg.c
pci_root.c x86/ioapic: Split IOAPIC hot-removal into two steps 2017-03-01 10:51:41 +01:00
pci_slot.c
power.c ACPI / power: Avoid maybe-uninitialized warning 2017-04-19 22:46:10 +02:00
proc.c
processor_core.c Revert"x86/acpi: Enable MADT APIs to return disabled apicids" 2017-03-11 14:41:18 +01:00
processor_driver.c
processor_idle.c
processor_pdc.c
processor_perflib.c
processor_thermal.c
processor_throttling.c
property.c
reboot.c
resource.c scripts/spelling.txt: add "overrided" pattern and fix typo instances 2017-02-27 18:43:47 -08:00
sbs.c
sbshc.c
sbshc.h
scan.c ACPI / scan: Set the visited flag for all enumerated devices 2017-04-13 04:42:18 +02:00
sleep.c
sleep.h
spcr.c tty: acpi/spcr: QDF2400 E44 checks for wrong OEM revision 2017-03-14 10:48:54 +08:00
sysfs.c
tables.c
thermal.c
utils.c
video_detect.c
wakeup.c