Skip to content

Commit

Permalink
ACPI / sysfs: Treat the count field of counter_show() as unsigned
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nan Li authored and Rafael J. Wysocki committed Mar 10, 2015
1 parent 9eccca0 commit 7b1a132
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/acpi/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ static ssize_t counter_show(struct kobject *kobj,
acpi_irq_not_handled;
all_counters[num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_GPE].count =
acpi_gpe_count;
size = sprintf(buf, "%8d", all_counters[index].count);
size = sprintf(buf, "%8u", all_counters[index].count);

/* "gpe_all" or "sci" */
if (index >= num_gpes + ACPI_NUM_FIXED_EVENTS)
Expand Down

0 comments on commit 7b1a132

Please sign in to comment.