diff mbox series

mmc_cmds.c: fix build with gcc 4.9

Message ID 20190928185107.21125-1-fontaine.fabrice@gmail.com (mailing list archive)
State New, archived
Headers show
Series mmc_cmds.c: fix build with gcc 4.9 | expand

Commit Message

Fabrice Fontaine Sept. 28, 2019, 6:51 p.m. UTC
Fix following error with gcc 4.9:

mmc_cmds.c:1918:9: error: missing braces around initializer [-Werror=missing-braces]
  struct rpmb_frame frame_status = {0};

Fixes:
 - http://autobuild.buildroot.org/results/bf3b6f9f6ef39b99842b3c92495b7bf359c68158

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 mmc_cmds.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Ulf Hansson Oct. 3, 2019, 10:24 a.m. UTC | #1
+ Chris, Avri

On Sat, 28 Sep 2019 at 20:50, Fabrice Fontaine
<fontaine.fabrice@gmail.com> wrote:
>
> Fix following error with gcc 4.9:
>
> mmc_cmds.c:1918:9: error: missing braces around initializer [-Werror=missing-braces]
>   struct rpmb_frame frame_status = {0};
>
> Fixes:
>  - http://autobuild.buildroot.org/results/bf3b6f9f6ef39b99842b3c92495b7bf359c68158
>
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  mmc_cmds.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/mmc_cmds.c b/mmc_cmds.c
> index fb37189..6b09f26 100644
> --- a/mmc_cmds.c
> +++ b/mmc_cmds.c
> @@ -1915,7 +1915,9 @@ static int do_rpmb_op(int fd,
>         u_int16_t rpmb_type;
>         struct mmc_ioc_multi_cmd *mioc;
>         struct mmc_ioc_cmd *ioc;
> -       struct rpmb_frame frame_status = {0};
> +       struct rpmb_frame frame_status;
> +
> +       memset(&frame_status, 0, sizeof(frame_status));
>
>         if (!frame_in || !frame_out || !out_cnt)
>                 return -EINVAL;
> --
> 2.23.0
>
Ulf Hansson March 31, 2021, 9:40 a.m. UTC | #2
+ Avri

On Sat, 28 Sept 2019 at 20:50, Fabrice Fontaine
<fontaine.fabrice@gmail.com> wrote:
>
> Fix following error with gcc 4.9:
>
> mmc_cmds.c:1918:9: error: missing braces around initializer [-Werror=missing-braces]
>   struct rpmb_frame frame_status = {0};
>
> Fixes:
>  - http://autobuild.buildroot.org/results/bf3b6f9f6ef39b99842b3c92495b7bf359c68158
>
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Applied to git.kernel.org/pub/scm/utils/mmc/mmc-utils.git master, thanks!

Kind regards
Uffe


> ---
>  mmc_cmds.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/mmc_cmds.c b/mmc_cmds.c
> index fb37189..6b09f26 100644
> --- a/mmc_cmds.c
> +++ b/mmc_cmds.c
> @@ -1915,7 +1915,9 @@ static int do_rpmb_op(int fd,
>         u_int16_t rpmb_type;
>         struct mmc_ioc_multi_cmd *mioc;
>         struct mmc_ioc_cmd *ioc;
> -       struct rpmb_frame frame_status = {0};
> +       struct rpmb_frame frame_status;
> +
> +       memset(&frame_status, 0, sizeof(frame_status));
>
>         if (!frame_in || !frame_out || !out_cnt)
>                 return -EINVAL;
> --
> 2.23.0
>
diff mbox series

Patch

diff --git a/mmc_cmds.c b/mmc_cmds.c
index fb37189..6b09f26 100644
--- a/mmc_cmds.c
+++ b/mmc_cmds.c
@@ -1915,7 +1915,9 @@  static int do_rpmb_op(int fd,
 	u_int16_t rpmb_type;
 	struct mmc_ioc_multi_cmd *mioc;
 	struct mmc_ioc_cmd *ioc;
-	struct rpmb_frame frame_status = {0};
+	struct rpmb_frame frame_status;
+
+	memset(&frame_status, 0, sizeof(frame_status));
 
 	if (!frame_in || !frame_out || !out_cnt)
 		return -EINVAL;