Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ACPI / sysfs: Treat the count field of counter_show() as unsigned

The count field is an unsigned 32bit value, and the
counter_show() function should also treat it as a unsigned
value.

Otherwise the counter may show negative number as we found on a
machine:
...
gpe23: 0 invalid
gpe24: -2071733 enabled
gpe25: 0 invalid
...
gpe_all: -2070980
sci: -2070949

Signed-off-by: Nan Li <nli@suse.com>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Nan Li and committed by
Rafael J. Wysocki
7b1a1322 9eccca08

+1 -1
+1 -1
drivers/acpi/sysfs.c
··· 527 527 acpi_irq_not_handled; 528 528 all_counters[num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_GPE].count = 529 529 acpi_gpe_count; 530 - size = sprintf(buf, "%8d", all_counters[index].count); 530 + size = sprintf(buf, "%8u", all_counters[index].count); 531 531 532 532 /* "gpe_all" or "sci" */ 533 533 if (index >= num_gpes + ACPI_NUM_FIXED_EVENTS)