Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Giulio Benetti <giulio.benetti@benettiengineering.com>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH] package/mmc-utils: fix build failure due to a warning and -Werror enabled
Date: Sun, 18 Sep 2022 17:37:10 +0200	[thread overview]
Message-ID: <20220918153710.GC1127102@scaer> (raw)
In-Reply-To: <20220918125309.1128650-1-giulio.benetti@benettiengineering.com>

Giulio, All,

On 2022-09-18 14:53 +0200, Giulio Benetti spake thusly:
> Add patch to fix warning that is treated like error:
> ```
> In function '__bswap_32',
>     inlined from 'do_rpmb_write_block' at mmc_cmds.c:2293:27:
> /home/autobuild/autobuild/instance-15/output-1/host/aarch64-buildroot-linux-gnu/sysroot/usr/include/bits/byteswap.h:52:10: error: 'cnt' may be used uninitialized [-Werror=maybe-uninitialized]
>    52 |   return __builtin_bswap32 (__bsx);
>       |          ^~~~~~~~~~~~~~~~~~~~~~~~~
> mmc_cmds.c: In function 'do_rpmb_write_block':
> mmc_cmds.c:2270:22: note: 'cnt' was declared here
>  2270 |         unsigned int cnt;
>       |                      ^~~
> cc1: all warnings being treated as errors
> ```
> Patch is pending upstream:
> https://patchwork.kernel.org/project/linux-mmc/patch/20220918124210.1127345-1-giulio.benetti@benettiengineering.com/

Arnd requested a different fix, arguing the one you proposed is hiding a
compiler warning without fixing the root cause.

Regards,
Yann E. MORIN.

> http://autobuild.buildroot.net/results/18c4fce5416e5d1ccd95900ccef87d4c045a361e/
> 
> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> ---
>  ...ds.c-fix-warning-on-uninitialized-cn.patch | 27 +++++++++++++++++++
>  1 file changed, 27 insertions(+)
>  create mode 100644 package/mmc-utils/0002-mmc-utils-mmc_cmds.c-fix-warning-on-uninitialized-cn.patch
> 
> diff --git a/package/mmc-utils/0002-mmc-utils-mmc_cmds.c-fix-warning-on-uninitialized-cn.patch b/package/mmc-utils/0002-mmc-utils-mmc_cmds.c-fix-warning-on-uninitialized-cn.patch
> new file mode 100644
> index 0000000000..e2f74879a6
> --- /dev/null
> +++ b/package/mmc-utils/0002-mmc-utils-mmc_cmds.c-fix-warning-on-uninitialized-cn.patch
> @@ -0,0 +1,27 @@
> +From bf783bbc2da0348591dd317ccd53bbfc5a57f2f8 Mon Sep 17 00:00:00 2001
> +From: Giulio Benetti <giulio.benetti@benettiengineering.com>
> +Date: Sun, 18 Sep 2022 14:10:29 +0200
> +Subject: [PATCH] mmc-utils: mmc_cmds.c: fix warning on uninitialized 'cnt'
> +
> +Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> +[Upstream status: https://patchwork.kernel.org/project/linux-mmc/patch/20220918124210.1127345-1-giulio.benetti@benettiengineering.com/]
> +---
> + mmc_cmds.c | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/mmc_cmds.c b/mmc_cmds.c
> +index 12b7802..777d649 100644
> +--- a/mmc_cmds.c
> ++++ b/mmc_cmds.c
> +@@ -2436,7 +2436,7 @@ int do_rpmb_write_block(int nargs, char **argv)
> + 	int ret, dev_fd, key_fd, data_fd;
> + 	unsigned char key[32];
> + 	uint16_t addr;
> +-	unsigned int cnt;
> ++	unsigned int cnt = 0;
> + 	struct rpmb_frame frame_in = {
> + 		.req_resp    = htobe16(MMC_RPMB_WRITE),
> + 		.block_count = htobe16(1)
> +-- 
> +2.34.1
> +
> -- 
> 2.34.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2022-09-18 15:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-18 12:53 [Buildroot] [PATCH] package/mmc-utils: fix build failure due to a warning and -Werror enabled Giulio Benetti
2022-09-18 15:37 ` Yann E. MORIN [this message]
2022-09-18 16:22   ` Giulio Benetti
2022-09-18 16:23     ` Giulio Benetti
2022-09-18 16:31   ` [Buildroot] [PATCH v2] " Giulio Benetti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220918153710.GC1127102@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=giulio.benetti@benettiengineering.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox