ACK: [PATCH 16/27] sbbr: fadt: add in missing const to fix build warnings

ivanhu ivan.hu at canonical.com
Thu Aug 16 09:17:06 UTC 2018



On 08/15/2018 09:11 PM, Colin King wrote:
> From: Colin Ian King <colin.king at 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 at canonical.com>
> ---
>  src/sbbr/fadt/fadt.c | 32 ++++++++++++++++----------------
>  1 file changed, 16 insertions(+), 16 deletions(-)
>
> diff --git a/src/sbbr/fadt/fadt.c b/src/sbbr/fadt/fadt.c
> index 430e39da..f7e16d9a 100644
> --- a/src/sbbr/fadt/fadt.c
> +++ b/src/sbbr/fadt/fadt.c
> @@ -264,64 +264,64 @@ static int fadt_sbbr_reduced_hw_test2(fwts_framework *fw)
>  		fwts_log_warning(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_warning(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_warning(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_warning(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_warning(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_warning(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_warning(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_warning(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_warning(fw,
Acked-by: Ivan Hu <ivan.hu at canonical.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/fwts-devel/attachments/20180816/004793ae/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/fwts-devel/attachments/20180816/004793ae/attachment.sig>


More information about the fwts-devel mailing list