diff mbox series

[15/27] acpi: fadt: add in missing const to fix build warnings

Message ID 20180815131129.24146-16-colin.king@canonical.com
State Accepted
Headers show
Series [01/27] lib: fwts_framework: ensure src pointer is const | expand

Commit Message

Colin Ian King Aug. 15, 2018, 1:11 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

Add in missing const, cleans up warnings such as:
cast discards ‘const’ qualifier from pointer target type

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/acpi/fadt/fadt.c | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

Comments

Alex Hung Aug. 15, 2018, 6:10 p.m. UTC | #1
On 2018-08-15 06:11 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Add in missing const, cleans up warnings such as:
> cast discards ‘const’ qualifier from pointer target type
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/acpi/fadt/fadt.c | 32 ++++++++++++++++----------------
>   1 file changed, 16 insertions(+), 16 deletions(-)
> 
> diff --git a/src/acpi/fadt/fadt.c b/src/acpi/fadt/fadt.c
> index 6304d14c..dd31c8a0 100644
> --- a/src/acpi/fadt/fadt.c
> +++ b/src/acpi/fadt/fadt.c
> @@ -596,64 +596,64 @@ static void acpi_table_check_fadt_reduced_hardware(fwts_framework *fw)
>   		fwts_log_info(fw, "CENTURY is non-zero: 0x%x",
>   			      fadt->century);
>   	}
> -	if (memcmp((void *)&fadt->x_pm1a_evt_blk,
> -		   (void *)&null_gas,
> +	if (memcmp((const void *)&fadt->x_pm1a_evt_blk,
> +		   (const void *)&null_gas,
>   		   sizeof(fwts_acpi_gas))) {
>   		passed = false;
>   		fwts_log_info(fw,
>   			      "X_PM1A_EVT_BLK is a non-zero general "
>   			      "address structure.");
>   	}
> -	if (memcmp((void *)&fadt->x_pm1b_evt_blk,
> -		   (void *)&null_gas,
> +	if (memcmp((const void *)&fadt->x_pm1b_evt_blk,
> +		   (const void *)&null_gas,
>   		   sizeof(fwts_acpi_gas))) {
>   		passed = false;
>   		fwts_log_info(fw,
>   			      "X_PM1B_EVT_BLK is a non-zero general "
>   			      "address structure.");
>   	}
> -	if (memcmp((void *)&fadt->x_pm1a_cnt_blk,
> -		   (void *)&null_gas,
> +	if (memcmp((const void *)&fadt->x_pm1a_cnt_blk,
> +		   (const void *)&null_gas,
>   		   sizeof(fwts_acpi_gas))) {
>   		passed = false;
>   		fwts_log_info(fw,
>   			      "X_PM1A_CNT_BLK is a non-zero general "
>   			      "address structure.");
>   	}
> -	if (memcmp((void *)&fadt->x_pm1b_cnt_blk,
> -		   (void *)&null_gas,
> +	if (memcmp((const void *)&fadt->x_pm1b_cnt_blk,
> +		   (const void *)&null_gas,
>   		   sizeof(fwts_acpi_gas))) {
>   		passed = false;
>   		fwts_log_info(fw,
>   			      "X_PM1B_CNT_BLK is a non-zero general "
>   			      "address structure.");
>   	}
> -	if (memcmp((void *)&fadt->x_pm2_cnt_blk,
> -		   (void *)&null_gas,
> +	if (memcmp((const void *)&fadt->x_pm2_cnt_blk,
> +		   (const void *)&null_gas,
>   		   sizeof(fwts_acpi_gas))) {
>   		passed = false;
>   		fwts_log_info(fw,
>   			      "X_PM2_CNT_BLK is a non-zero general "
>   			      "address structure.");
>   	}
> -	if (memcmp((void *)&fadt->x_pm_tmr_blk,
> -		   (void *)&null_gas,
> +	if (memcmp((const void *)&fadt->x_pm_tmr_blk,
> +		   (const void *)&null_gas,
>   		   sizeof(fwts_acpi_gas))) {
>   		passed = false;
>   		fwts_log_info(fw,
>   			      "X_PM_TMR_BLK is a non-zero general "
>   			      "address structure.");
>   	}
> -	if (memcmp((void *)&fadt->x_gpe0_blk,
> -		   (void *)&null_gas,
> +	if (memcmp((const void *)&fadt->x_gpe0_blk,
> +		   (const void *)&null_gas,
>   		   sizeof(fwts_acpi_gas))) {
>   		passed = false;
>   		fwts_log_info(fw,
>   			      "X_GPE0_BLK is a non-zero general "
>   			      "address structure.");
>   	}
> -	if (memcmp((void *)&fadt->x_gpe1_blk,
> -		   (void *)&null_gas,
> +	if (memcmp((const void *)&fadt->x_gpe1_blk,
> +		   (const void *)&null_gas,
>   		   sizeof(fwts_acpi_gas))) {
>   		passed = false;
>   		fwts_log_info(fw,
> 



Acked-by: Alex Hung <alex.hung@canonical.com>
Ivan Hu Aug. 16, 2018, 9:16 a.m. UTC | #2
On 08/15/2018 09:11 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Add in missing const, cleans up warnings such as:
> cast discards ‘const’ qualifier from pointer target type
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/acpi/fadt/fadt.c | 32 ++++++++++++++++----------------
>  1 file changed, 16 insertions(+), 16 deletions(-)
>
> diff --git a/src/acpi/fadt/fadt.c b/src/acpi/fadt/fadt.c
> index 6304d14c..dd31c8a0 100644
> --- a/src/acpi/fadt/fadt.c
> +++ b/src/acpi/fadt/fadt.c
> @@ -596,64 +596,64 @@ static void acpi_table_check_fadt_reduced_hardware(fwts_framework *fw)
>  		fwts_log_info(fw, "CENTURY is non-zero: 0x%x",
>  			      fadt->century);
>  	}
> -	if (memcmp((void *)&fadt->x_pm1a_evt_blk,
> -		   (void *)&null_gas,
> +	if (memcmp((const void *)&fadt->x_pm1a_evt_blk,
> +		   (const void *)&null_gas,
>  		   sizeof(fwts_acpi_gas))) {
>  		passed = false;
>  		fwts_log_info(fw,
>  			      "X_PM1A_EVT_BLK is a non-zero general "
>  			      "address structure.");
>  	}
> -	if (memcmp((void *)&fadt->x_pm1b_evt_blk,
> -		   (void *)&null_gas,
> +	if (memcmp((const void *)&fadt->x_pm1b_evt_blk,
> +		   (const void *)&null_gas,
>  		   sizeof(fwts_acpi_gas))) {
>  		passed = false;
>  		fwts_log_info(fw,
>  			      "X_PM1B_EVT_BLK is a non-zero general "
>  			      "address structure.");
>  	}
> -	if (memcmp((void *)&fadt->x_pm1a_cnt_blk,
> -		   (void *)&null_gas,
> +	if (memcmp((const void *)&fadt->x_pm1a_cnt_blk,
> +		   (const void *)&null_gas,
>  		   sizeof(fwts_acpi_gas))) {
>  		passed = false;
>  		fwts_log_info(fw,
>  			      "X_PM1A_CNT_BLK is a non-zero general "
>  			      "address structure.");
>  	}
> -	if (memcmp((void *)&fadt->x_pm1b_cnt_blk,
> -		   (void *)&null_gas,
> +	if (memcmp((const void *)&fadt->x_pm1b_cnt_blk,
> +		   (const void *)&null_gas,
>  		   sizeof(fwts_acpi_gas))) {
>  		passed = false;
>  		fwts_log_info(fw,
>  			      "X_PM1B_CNT_BLK is a non-zero general "
>  			      "address structure.");
>  	}
> -	if (memcmp((void *)&fadt->x_pm2_cnt_blk,
> -		   (void *)&null_gas,
> +	if (memcmp((const void *)&fadt->x_pm2_cnt_blk,
> +		   (const void *)&null_gas,
>  		   sizeof(fwts_acpi_gas))) {
>  		passed = false;
>  		fwts_log_info(fw,
>  			      "X_PM2_CNT_BLK is a non-zero general "
>  			      "address structure.");
>  	}
> -	if (memcmp((void *)&fadt->x_pm_tmr_blk,
> -		   (void *)&null_gas,
> +	if (memcmp((const void *)&fadt->x_pm_tmr_blk,
> +		   (const void *)&null_gas,
>  		   sizeof(fwts_acpi_gas))) {
>  		passed = false;
>  		fwts_log_info(fw,
>  			      "X_PM_TMR_BLK is a non-zero general "
>  			      "address structure.");
>  	}
> -	if (memcmp((void *)&fadt->x_gpe0_blk,
> -		   (void *)&null_gas,
> +	if (memcmp((const void *)&fadt->x_gpe0_blk,
> +		   (const void *)&null_gas,
>  		   sizeof(fwts_acpi_gas))) {
>  		passed = false;
>  		fwts_log_info(fw,
>  			      "X_GPE0_BLK is a non-zero general "
>  			      "address structure.");
>  	}
> -	if (memcmp((void *)&fadt->x_gpe1_blk,
> -		   (void *)&null_gas,
> +	if (memcmp((const void *)&fadt->x_gpe1_blk,
> +		   (const void *)&null_gas,
>  		   sizeof(fwts_acpi_gas))) {
>  		passed = false;
>  		fwts_log_info(fw,
Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff mbox series

Patch

diff --git a/src/acpi/fadt/fadt.c b/src/acpi/fadt/fadt.c
index 6304d14c..dd31c8a0 100644
--- a/src/acpi/fadt/fadt.c
+++ b/src/acpi/fadt/fadt.c
@@ -596,64 +596,64 @@  static void acpi_table_check_fadt_reduced_hardware(fwts_framework *fw)
 		fwts_log_info(fw, "CENTURY is non-zero: 0x%x",
 			      fadt->century);
 	}
-	if (memcmp((void *)&fadt->x_pm1a_evt_blk,
-		   (void *)&null_gas,
+	if (memcmp((const void *)&fadt->x_pm1a_evt_blk,
+		   (const void *)&null_gas,
 		   sizeof(fwts_acpi_gas))) {
 		passed = false;
 		fwts_log_info(fw,
 			      "X_PM1A_EVT_BLK is a non-zero general "
 			      "address structure.");
 	}
-	if (memcmp((void *)&fadt->x_pm1b_evt_blk,
-		   (void *)&null_gas,
+	if (memcmp((const void *)&fadt->x_pm1b_evt_blk,
+		   (const void *)&null_gas,
 		   sizeof(fwts_acpi_gas))) {
 		passed = false;
 		fwts_log_info(fw,
 			      "X_PM1B_EVT_BLK is a non-zero general "
 			      "address structure.");
 	}
-	if (memcmp((void *)&fadt->x_pm1a_cnt_blk,
-		   (void *)&null_gas,
+	if (memcmp((const void *)&fadt->x_pm1a_cnt_blk,
+		   (const void *)&null_gas,
 		   sizeof(fwts_acpi_gas))) {
 		passed = false;
 		fwts_log_info(fw,
 			      "X_PM1A_CNT_BLK is a non-zero general "
 			      "address structure.");
 	}
-	if (memcmp((void *)&fadt->x_pm1b_cnt_blk,
-		   (void *)&null_gas,
+	if (memcmp((const void *)&fadt->x_pm1b_cnt_blk,
+		   (const void *)&null_gas,
 		   sizeof(fwts_acpi_gas))) {
 		passed = false;
 		fwts_log_info(fw,
 			      "X_PM1B_CNT_BLK is a non-zero general "
 			      "address structure.");
 	}
-	if (memcmp((void *)&fadt->x_pm2_cnt_blk,
-		   (void *)&null_gas,
+	if (memcmp((const void *)&fadt->x_pm2_cnt_blk,
+		   (const void *)&null_gas,
 		   sizeof(fwts_acpi_gas))) {
 		passed = false;
 		fwts_log_info(fw,
 			      "X_PM2_CNT_BLK is a non-zero general "
 			      "address structure.");
 	}
-	if (memcmp((void *)&fadt->x_pm_tmr_blk,
-		   (void *)&null_gas,
+	if (memcmp((const void *)&fadt->x_pm_tmr_blk,
+		   (const void *)&null_gas,
 		   sizeof(fwts_acpi_gas))) {
 		passed = false;
 		fwts_log_info(fw,
 			      "X_PM_TMR_BLK is a non-zero general "
 			      "address structure.");
 	}
-	if (memcmp((void *)&fadt->x_gpe0_blk,
-		   (void *)&null_gas,
+	if (memcmp((const void *)&fadt->x_gpe0_blk,
+		   (const void *)&null_gas,
 		   sizeof(fwts_acpi_gas))) {
 		passed = false;
 		fwts_log_info(fw,
 			      "X_GPE0_BLK is a non-zero general "
 			      "address structure.");
 	}
-	if (memcmp((void *)&fadt->x_gpe1_blk,
-		   (void *)&null_gas,
+	if (memcmp((const void *)&fadt->x_gpe1_blk,
+		   (const void *)&null_gas,
 		   sizeof(fwts_acpi_gas))) {
 		passed = false;
 		fwts_log_info(fw,