diff mbox series

[1/3] fix missing field initializer warnings

Message ID 20211119090401.664993-1-dominique.martinet@atmark-techno.com
State Accepted
Headers show
Series [1/3] fix missing field initializer warnings | expand

Commit Message

Dominique Martinet Nov. 19, 2021, 9:03 a.m. UTC
fixes warnings with -Wmissing-field-initializers:
 - hnd_priv missing partlists init, could also have added a final
   LIST_HEAD_INITIALIZER() but it's easier to maintain by naming the only
   field that's actually set
 - commands was missing usage callback

With this one can compile with -Wall -Wextra -Wno-sign-compare
(there are too many sign-compare warnings for me to fix right now,
but a quick glance saw nothing too horrible)

Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
---
 handlers/diskpart_handler.c | 4 +++-
 tools/swupdate-ipc.c        | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

Comments

Stefano Babic Nov. 21, 2021, 10:43 a.m. UTC | #1
Hi Dominique,

On 19.11.21 10:03, Dominique Martinet wrote:
> fixes warnings with -Wmissing-field-initializers:
>   - hnd_priv missing partlists init, could also have added a final
>     LIST_HEAD_INITIALIZER() but it's easier to maintain by naming the only
>     field that's actually set
>   - commands was missing usage callback
> 
> With this one can compile with -Wall -Wextra -Wno-sign-compare
> (there are too many sign-compare warnings for me to fix right now,
> but a quick glance saw nothing too horrible)
> 
> Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
> ---
>   handlers/diskpart_handler.c | 4 +++-
>   tools/swupdate-ipc.c        | 2 +-
>   2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/handlers/diskpart_handler.c b/handlers/diskpart_handler.c
> index aeae1ad5f423..268ae6f54ee4 100644
> --- a/handlers/diskpart_handler.c
> +++ b/handlers/diskpart_handler.c
> @@ -760,7 +760,9 @@ static int diskpart(struct img_type *img,
>   	int ret = 0;
>   	unsigned long i;
>   	unsigned long hybrid = 0;
> -	struct hnd_priv priv =  {FDISK_DISKLABEL_DOS, false, false};
> +	struct hnd_priv priv =  {
> +		.labeltype = FDISK_DISKLABEL_DOS,
> +	};
>   	struct create_table *createtable = NULL;
>   
>   	if (!lbtype || (strcmp(lbtype, "gpt") && strcmp(lbtype, "dos"))) {
> diff --git a/tools/swupdate-ipc.c b/tools/swupdate-ipc.c
> index de1e1e111bf1..b70d78fa7df3 100644
> --- a/tools/swupdate-ipc.c
> +++ b/tools/swupdate-ipc.c
> @@ -596,7 +596,7 @@ cmd_t commands[] = {
>   	{"hawkbitcfg", hawkbitcfg, usage_hawkbitcfg},
>   	{"gethawkbit", gethawkbitstatus, usage_gethawkbitstatus},
>   	{"sysrestart", sysrestart, usage_sysrestart},
> -	{NULL, NULL}
> +	{NULL, NULL, NULL}
>   };
>   
>   /*
> 

Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/handlers/diskpart_handler.c b/handlers/diskpart_handler.c
index aeae1ad5f423..268ae6f54ee4 100644
--- a/handlers/diskpart_handler.c
+++ b/handlers/diskpart_handler.c
@@ -760,7 +760,9 @@  static int diskpart(struct img_type *img,
 	int ret = 0;
 	unsigned long i;
 	unsigned long hybrid = 0;
-	struct hnd_priv priv =  {FDISK_DISKLABEL_DOS, false, false};
+	struct hnd_priv priv =  {
+		.labeltype = FDISK_DISKLABEL_DOS,
+	};
 	struct create_table *createtable = NULL;
 
 	if (!lbtype || (strcmp(lbtype, "gpt") && strcmp(lbtype, "dos"))) {
diff --git a/tools/swupdate-ipc.c b/tools/swupdate-ipc.c
index de1e1e111bf1..b70d78fa7df3 100644
--- a/tools/swupdate-ipc.c
+++ b/tools/swupdate-ipc.c
@@ -596,7 +596,7 @@  cmd_t commands[] = {
 	{"hawkbitcfg", hawkbitcfg, usage_hawkbitcfg},
 	{"gethawkbit", gethawkbitstatus, usage_gethawkbitstatus},
 	{"sysrestart", sysrestart, usage_sysrestart},
-	{NULL, NULL}
+	{NULL, NULL, NULL}
 };
 
 /*