Skip to contentSkip to conversation

ACPI/CPPC: signedness bug in register_pcc_channel()

PATCH Applied Dan Carpenter 3 participants 3 messages Oct 22, 2015 – Oct 28, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI/CPPC: signedness bug in register_pcc_channel()

The "pcc_subspace_idx" is -1 if it hasn't been initialized yet. We need it to be signed.

Fixes 337aadff8e45 ('ACPI: Introduce CPU performance controls using CPPC')
drivers/acpi/cppc_acpi.c +1 -1
index 0bbf84b..2ed5516 100644
@@ -302,7 +302,7 @@ err_ret:
 }
 EXPORT_SYMBOL_GPL(acpi_get_psd_map);
 
-static int register_pcc_channel(unsigned pcc_subspace_idx)
+static int register_pcc_channel(int pcc_subspace_idx)
 {
 	struct acpi_pcct_subspace *cppc_ss;
 	unsigned int len;
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Dan Carpenter

The "pcc_subspace_idx" is -1 if it hasn't been initialized yet. We need it to be signed.

Fixes 337aadff8e45 ('ACPI: Introduce CPU performance controls using CPPC')
drivers/acpi/cppc_acpi.c +0 -0
index 0bbf84b..2ed5516 100644

drivers/acpi/cppc_acpi.c err_ret: · line 308

Quoted 8 lines
drivers/acpi/cppc_acpi.c +1 -1
@@ -302,7 +302,7 @@ err_ret:
 }
 EXPORT_SYMBOL_GPL(acpi_get_psd_map);
 
-static int register_pcc_channel(unsigned pcc_subspace_idx)
+static int register_pcc_channel(int pcc_subspace_idx)
 {
        struct acpi_pcct_subspace *cppc_ss;
        unsigned int len;

Thanks,
Ashwin.

#2 lore raw
Quoted 15 lines · Ashwin Chaugule
Quoted 14 lines · Dan Carpenter

The "pcc_subspace_idx" is -1 if it hasn't been initialized yet. We need it to be signed.

Fixes 337aadff8e45 ('ACPI: Introduce CPU performance controls using CPPC')
drivers/acpi/cppc_acpi.c +0 -0
index 0bbf84b..2ed5516 100644
@@ -302,7 +302,7 @@ err_ret:
 }
 EXPORT_SYMBOL_GPL(acpi_get_psd_map);
 
Quoted 7 lines

drivers/acpi/cppc_acpi.c err_ret: · line 308

Quoted 5 lines
drivers/acpi/cppc_acpi.c +1 -1
-static int register_pcc_channel(unsigned pcc_subspace_idx)
+static int register_pcc_channel(int pcc_subspace_idx)
 {
        struct acpi_pcct_subspace *cppc_ss;
        unsigned int len;

Applied, thanks!

Rafael