[U-Boot] cmd: disk: Fix unused variable warning

Tom Rini trini at konsulko.com
Mon May 30 19:56:16 CEST 2016


On Sun, May 01, 2016 at 12:35:54AM +0200, Marek Vasut wrote:

> If serial support is not compiled into U-Boot, which may be the case
> for some SPL builds, the following warning will be generated in disk.c:
> 
> cmd/disk.c: In function 'common_diskboot':
> cmd/disk.c:16:6: warning: variable 'dev' set but not used [-Wunused-but-set-variable]
>   int dev, part;
>       ^
> The warning is a result of printf() calls being optimized away, and
> thus the whole dev variable becomes indeed unused. Mark the variable
> as __maybe_unused .
> 
> Signed-off-by: Marek Vasut <marex at denx.de>
> Cc: Simon Glass <sjg at chromium.org>
> Cc: Tom Rini <trini at konsulko.com>
> Reviewed-by: Simon Glass <sjg at chromium.org>
> Reviewed-by: Tom Rini <trini at konsulko.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160530/fbc3c74c/attachment.sig>


More information about the U-Boot mailing list