diff mbox series

[5/7] lib: fwts_coreboot_cbmem.c: initialize all fields in array of structs

Message ID 20180730183059.28039-6-colin.king@canonical.com
State Accepted
Headers show
Series abstract _Pragmas and minor changes to build with gcc and clang | expand

Commit Message

Colin Ian King July 30, 2018, 6:30 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

This gcc'ism needs to be changed so that clang will cleanly build
without warnings.

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

Comments

Alex Hung July 31, 2018, 12:12 a.m. UTC | #1
On 2018-07-30 11:30 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> This gcc'ism needs to be changed so that clang will cleanly build
> without warnings.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/lib/src/fwts_coreboot_cbmem.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/lib/src/fwts_coreboot_cbmem.c b/src/lib/src/fwts_coreboot_cbmem.c
> index ae9276d9..3add0871 100644
> --- a/src/lib/src/fwts_coreboot_cbmem.c
> +++ b/src/lib/src/fwts_coreboot_cbmem.c
> @@ -267,7 +267,7 @@ static ssize_t memconsole_coreboot_read(struct cbmem_console *con, char *buf, si
>   	struct seg {	/* describes ring buffer segments in logical order */
>   		uint32_t phys;	/* physical offset from start of mem buffer */
>   		uint32_t len;	/* length of segment */
> -	} seg[2] = { {0}, {0} };
> +	} seg[2] = { { 0, 0 }, { 0, 0 } };
>   	size_t done = 0;
>   	unsigned int i;
>   
> 


Acked-by: Alex Hung <alex.hung@canonical.com>
Ivan Hu July 31, 2018, 7:50 a.m. UTC | #2
On 07/31/2018 02:30 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> This gcc'ism needs to be changed so that clang will cleanly build
> without warnings.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/lib/src/fwts_coreboot_cbmem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/lib/src/fwts_coreboot_cbmem.c b/src/lib/src/fwts_coreboot_cbmem.c
> index ae9276d9..3add0871 100644
> --- a/src/lib/src/fwts_coreboot_cbmem.c
> +++ b/src/lib/src/fwts_coreboot_cbmem.c
> @@ -267,7 +267,7 @@ static ssize_t memconsole_coreboot_read(struct cbmem_console *con, char *buf, si
>  	struct seg {	/* describes ring buffer segments in logical order */
>  		uint32_t phys;	/* physical offset from start of mem buffer */
>  		uint32_t len;	/* length of segment */
> -	} seg[2] = { {0}, {0} };
> +	} seg[2] = { { 0, 0 }, { 0, 0 } };
>  	size_t done = 0;
>  	unsigned int i;
>  
Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff mbox series

Patch

diff --git a/src/lib/src/fwts_coreboot_cbmem.c b/src/lib/src/fwts_coreboot_cbmem.c
index ae9276d9..3add0871 100644
--- a/src/lib/src/fwts_coreboot_cbmem.c
+++ b/src/lib/src/fwts_coreboot_cbmem.c
@@ -267,7 +267,7 @@  static ssize_t memconsole_coreboot_read(struct cbmem_console *con, char *buf, si
 	struct seg {	/* describes ring buffer segments in logical order */
 		uint32_t phys;	/* physical offset from start of mem buffer */
 		uint32_t len;	/* length of segment */
-	} seg[2] = { {0}, {0} };
+	} seg[2] = { { 0, 0 }, { 0, 0 } };
 	size_t done = 0;
 	unsigned int i;