From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH master 3/5] imx-bbu-nand-fcb: suppress compiler warning about uninitialized use
Date: Mon, 3 Jan 2022 12:57:16 +0100 [thread overview]
Message-ID: <20220103115718.1723730-4-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20220103115718.1723730-1-a.fatoum@pengutronix.de>
fw_orig_len is selectively initialized in read_firmware_all. In case
it's left uninitialized, fw_orig will keep it's initial value of NULL.
fw_orig is checked before fw_orig_len use, so there is no use of an
uninitialized variable in practice, but GCC 11.1.1 warns about it
anyway. Give it an initial value of 0 to silence the warning.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
common/imx-bbu-nand-fcb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/imx-bbu-nand-fcb.c b/common/imx-bbu-nand-fcb.c
index 3b07d539ee6e..bde0b227f81c 100644
--- a/common/imx-bbu-nand-fcb.c
+++ b/common/imx-bbu-nand-fcb.c
@@ -1155,7 +1155,7 @@ static int imx_bbu_nand_update(struct bbu_handler *handler, struct bbu_data *dat
enum filetype filetype;
unsigned num_blocks_fw, fw_size;
int used = 0;
- int fw_orig_len;
+ int fw_orig_len = 0;
int used_refresh = 0, unused_refresh = 0;
if (data->image) {
--
2.30.2
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2022-01-03 11:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-03 11:57 [PATCH master 0/5] misc fixes Ahmad Fatoum
2022-01-03 11:57 ` [PATCH master 1/5] pwm: atmel: point MMIO accesses at correct address Ahmad Fatoum
2022-01-03 16:11 ` Sam Ravnborg
2022-01-03 16:18 ` Sam Ravnborg
2022-01-03 11:57 ` [PATCH master 2/5] clk: fixed: record parent name in clk_register_fixed_rate Ahmad Fatoum
2022-01-03 11:57 ` Ahmad Fatoum [this message]
2022-01-03 11:57 ` [PATCH master 4/5] regulator: fix broken reference counting on disable Ahmad Fatoum
2022-01-03 11:57 ` [PATCH master 5/5] regulator: respect "regulator-always-on" property Ahmad Fatoum
2022-01-05 7:28 ` [PATCH master 0/5] misc fixes Sascha Hauer
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=20220103115718.1723730-4-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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