From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] spl: mmc: Fix compiler warning
Date: Sat, 5 Dec 2015 22:04:16 +0100 [thread overview]
Message-ID: <201512052204.16824.marex@denx.de> (raw)
In-Reply-To: <20151205210256.GA9551@bill-the-cat>
On Saturday, December 05, 2015 at 10:02:56 PM, Tom Rini wrote:
> On Sat, Dec 05, 2015 at 09:42:35PM +0100, Marek Vasut wrote:
> > Fix the following warning:
> > common/spl/spl_mmc.c: In function 'spl_mmc_load_image':
> > common/spl/spl_mmc.c:31:24: warning: 'mmc' may be used uninitialized in
> > this function [-Wmaybe-uninitialized]
> >
> > count = mmc->block_dev.block_read(0, sector, 1, header);
> >
> > ^
> >
> > common/spl/spl_mmc.c:251:14: note: 'mmc' was declared here
> >
> > struct mmc *mmc;
> >
> > ^
> >
> > The fix is as simple as initializing the struct mmc *mmc to NULL,
> > so the subsequent functions can check if the variable is set or
> > not.
> >
> > Signed-off-by: Marek Vasut <marex@denx.de>
> > Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
> > Cc: Tom Rini <trini@konsulko.com>
> > Cc: Simon Glass <sjg@chromium.org>
>
> I'm glad we're all grabbing gcc-5.x now. I am however going to grab
> Simon's patch for this shortly. Thanks!
This popped up with gcc 4.9 though ;-)
Thanks anyway.
Best regards,
Marek Vasut
prev parent reply other threads:[~2015-12-05 21:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-05 20:42 [U-Boot] [PATCH] spl: mmc: Fix compiler warning Marek Vasut
2015-12-05 21:02 ` Tom Rini
2015-12-05 21:04 ` Marek Vasut [this message]
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=201512052204.16824.marex@denx.de \
--to=marex@denx.de \
--cc=u-boot@lists.denx.de \
/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