aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-03-17 10:57:09 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2023-03-17 10:57:09 -0700
commitabb02a824555c160dccc316971cbb802b3ebf4f7 (patch)
tree2848e3352123ce69bd8659a66fd9d377177233f2 /tools
parentba9c77919045943af677c03f04c778a1c16ae680 (diff)
parentf36cc6cd65204352815640a34e37ef39e56fbd42 (diff)
Merge tag 'acpi-6.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI fixes from Rafael Wysocki: "These add some new quirks, fix PPTT handling, fix an ACPI utility and correct a mistake in the ACPI documentation. Specifics: - Fix ACPI PPTT handling to avoid sleep in the atomic context when it is not present (Sudeep Holla) - Add 'backlight=native' DMI quirk for Dell Vostro 15 3535 to the ACPI video driver (Chia-Lin Kao) - Add ACPI quirks for I2C device enumeration on Lenovo Yoga Book X90 and Acer Iconia One 7 B1-750 (Hans de Goede) - Fix handling of invalid command line option values in the ACPI pfrut utility (Chen Yu) - Fix references to I2C device data type in the ACPI documentation for device enumeration (Andy Shevchenko)" * tag 'acpi-6.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: tools: pfrut: Check if the input of level and type is in the right numeric range ACPI: PPTT: Fix to avoid sleep in the atomic context when PPTT is absent ACPI: x86: Add skip i2c clients quirk for Lenovo Yoga Book X90 ACPI: x86: Add skip i2c clients quirk for Acer Iconia One 7 B1-750 ACPI: x86: Introduce an acpi_quirk_skip_gpio_event_handlers() helper ACPI: video: Add backlight=native DMI quirk for Dell Vostro 15 3535 ACPI: docs: enumeration: Correct reference to the I²C device data type
Diffstat (limited to 'tools')
-rw-r--r--tools/power/acpi/tools/pfrut/pfrut.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/tools/power/acpi/tools/pfrut/pfrut.c b/tools/power/acpi/tools/pfrut/pfrut.c
index 52aa0351533c..388c9e3ad040 100644
--- a/tools/power/acpi/tools/pfrut/pfrut.c
+++ b/tools/power/acpi/tools/pfrut/pfrut.c
@@ -97,7 +97,7 @@ static struct option long_options[] = {
static void parse_options(int argc, char **argv)
{
int option_index = 0;
- char *pathname;
+ char *pathname, *endptr;
int opt;
pathname = strdup(argv[0]);
@@ -125,11 +125,23 @@ static void parse_options(int argc, char **argv)
log_getinfo = 1;
break;
case 'T':
- log_type = atoi(optarg);
+ log_type = strtol(optarg, &endptr, 0);
+ if (*endptr || (log_type != 0 && log_type != 1)) {
+ printf("Number expected: type(0:execution, 1:history) - Quit.\n");
+ exit(1);
+ }
+
set_log_type = 1;
break;
case 'L':
- log_level = atoi(optarg);
+ log_level = strtol(optarg, &endptr, 0);
+ if (*endptr ||
+ (log_level != 0 && log_level != 1 &&
+ log_level != 2 && log_level != 4)) {
+ printf("Number expected: level(0, 1, 2, 4) - Quit.\n");
+ exit(1);
+ }
+
set_log_level = 1;
break;
case 'R':