ACK: [PATCH] uefi: uefirtmisc: make arrays flag static const

ivanhu ivan.hu at canonical.com
Wed Sep 6 08:21:45 UTC 2017



On 09/04/2017 09:13 PM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
> 
> The arrays are read-only and hence can be make static const
> 
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>   src/uefi/uefirtmisc/uefirtmisc.c | 24 ++++++++++++++----------
>   1 file changed, 14 insertions(+), 10 deletions(-)
> 
> diff --git a/src/uefi/uefirtmisc/uefirtmisc.c b/src/uefi/uefirtmisc/uefirtmisc.c
> index 70068c9d..b107a915 100644
> --- a/src/uefi/uefirtmisc/uefirtmisc.c
> +++ b/src/uefi/uefirtmisc/uefirtmisc.c
> @@ -153,11 +153,13 @@ static int uefirtmisc_test1(fwts_framework *fw)
>   	uint32_t multitesttime = 1;
>   	uint32_t i;
>   
> -	uint32_t flag[] = { 0,
> -			    CAPSULE_FLAGS_PERSIST_ACROSS_RESET,
> -			    CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE,
> -			    CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_INITIATE_RESET,
> -			    CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE | CAPSULE_FLAGS_INITIATE_RESET};
> +	static const uint32_t flag[] = {
> +		0,
> +		CAPSULE_FLAGS_PERSIST_ACROSS_RESET,
> +		CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE,
> +		CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_INITIATE_RESET,
> +		CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE | CAPSULE_FLAGS_INITIATE_RESET
> +	};
>   
>   	fwts_log_info(fw, "Testing UEFI runtime service GetNextHighMonotonicCount interface.");
>   	ret = getnexthighmonotoniccount_test(fw, multitesttime);
> @@ -186,11 +188,13 @@ static int uefirtmisc_test2(fwts_framework *fw)
>   	uint32_t multitesttime = 512;
>   	uint32_t i;
>   
> -	uint32_t flag[] = { 0,
> -			    CAPSULE_FLAGS_PERSIST_ACROSS_RESET,
> -			    CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE,
> -			    CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_INITIATE_RESET,
> -			    CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE | CAPSULE_FLAGS_INITIATE_RESET};
> +	static const uint32_t flag[] = {
> +		0,
> +		CAPSULE_FLAGS_PERSIST_ACROSS_RESET,
> +		CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE,
> +		CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_INITIATE_RESET,
> +		CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE | CAPSULE_FLAGS_INITIATE_RESET
> +	};
>   
>   	fwts_log_info(fw, "Stress testing for UEFI runtime service GetNextHighMonotonicCount interface.");
>   	ret = getnexthighmonotoniccount_test(fw, multitesttime);
> 

Acked-by: Ivan Hu <ivan.hu at canonical.com>



More information about the fwts-devel mailing list