diff mbox

acpi: pmtt: fix incorrect assignment on passed

Message ID 1469478336-47985-1-git-send-email-colin.king@canonical.com
State Accepted
Headers show

Commit Message

Colin Ian King July 25, 2016, 8:25 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

Ensure we assign *passed rather than passed, fixes error found with
cppcheck:

[src/acpi/pmtt/pmtt.c:134]: (error) Boolean value assigned to pointer.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/acpi/pmtt/pmtt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alex Hung Aug. 17, 2016, 9:55 a.m. UTC | #1
On 2016-07-26 04:25 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Ensure we assign *passed rather than passed, fixes error found with
> cppcheck:
>
> [src/acpi/pmtt/pmtt.c:134]: (error) Boolean value assigned to pointer.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/acpi/pmtt/pmtt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/acpi/pmtt/pmtt.c b/src/acpi/pmtt/pmtt.c
> index ce1a752..18cb45c 100644
> --- a/src/acpi/pmtt/pmtt.c
> +++ b/src/acpi/pmtt/pmtt.c
> @@ -131,7 +131,7 @@ static void pmmt_controller_test(fwts_framework *fw, fwts_acpi_table_pmtt_contro
>
>  	offset = sizeof(fwts_acpi_table_pmtt_controller);
>  	if (entry->header.length < offset + sizeof(fwts_acpi_table_pmtt_domain) * entry->domain_count) {
> -		passed = false;
> +		*passed = false;
>  		fwts_failed(fw, LOG_LEVEL_HIGH,
>  			"PMTTOutOfBound",
>  			"PMTT's length is too small to contain all fields");
>

Thanks for catching this.  It was a silly copy & paste error.

Acked-by: Alex Hung <alex.hung@canonical.com>
Ivan Hu Aug. 18, 2016, 2:27 a.m. UTC | #2
On 2016年07月26日 04:25, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Ensure we assign *passed rather than passed, fixes error found with
> cppcheck:
>
> [src/acpi/pmtt/pmtt.c:134]: (error) Boolean value assigned to pointer.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/acpi/pmtt/pmtt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/acpi/pmtt/pmtt.c b/src/acpi/pmtt/pmtt.c
> index ce1a752..18cb45c 100644
> --- a/src/acpi/pmtt/pmtt.c
> +++ b/src/acpi/pmtt/pmtt.c
> @@ -131,7 +131,7 @@ static void pmmt_controller_test(fwts_framework *fw, fwts_acpi_table_pmtt_contro
>
>  	offset = sizeof(fwts_acpi_table_pmtt_controller);
>  	if (entry->header.length < offset + sizeof(fwts_acpi_table_pmtt_domain) * entry->domain_count) {
> -		passed = false;
> +		*passed = false;
>  		fwts_failed(fw, LOG_LEVEL_HIGH,
>  			"PMTTOutOfBound",
>  			"PMTT's length is too small to contain all fields");
>

Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff mbox

Patch

diff --git a/src/acpi/pmtt/pmtt.c b/src/acpi/pmtt/pmtt.c
index ce1a752..18cb45c 100644
--- a/src/acpi/pmtt/pmtt.c
+++ b/src/acpi/pmtt/pmtt.c
@@ -131,7 +131,7 @@  static void pmmt_controller_test(fwts_framework *fw, fwts_acpi_table_pmtt_contro
 
 	offset = sizeof(fwts_acpi_table_pmtt_controller);
 	if (entry->header.length < offset + sizeof(fwts_acpi_table_pmtt_domain) * entry->domain_count) {
-		passed = false;
+		*passed = false;
 		fwts_failed(fw, LOG_LEVEL_HIGH,
 			"PMTTOutOfBound",
 			"PMTT's length is too small to contain all fields");