ACK: [PATCH] uefi: uefirttime: constify static array dayofmonth

Alex Hung alex.hung at canonical.com
Tue Sep 5 05:31:34 UTC 2017


On 2017-09-04 06:16 AM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
> 
> The static and read-only array can also be made const
> 
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>   src/uefi/uefirttime/uefirttime.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/uefi/uefirttime/uefirttime.c b/src/uefi/uefirttime/uefirttime.c
> index 621f53b6..7998f7fd 100644
> --- a/src/uefi/uefirttime/uefirttime.c
> +++ b/src/uefi/uefirttime/uefirttime.c
> @@ -36,7 +36,7 @@
>   		((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
>   
>   static int fd;
> -static uint32_t dayofmonth[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
> +static const uint32_t dayofmonth[12] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
>   
>   static bool dayvalid(EFI_TIME *Time)
>   {
> 


Acked-by: Alex Hung <alex.hung at canonical.com>



More information about the fwts-devel mailing list