mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 15:14:43 +00:00
cmd: disk: Fix unused variable warning
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@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
parent
90a7417602
commit
04681cb3a4
1 changed files with 2 additions and 1 deletions
|
@ -13,7 +13,8 @@
|
|||
int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int argc,
|
||||
char *const argv[])
|
||||
{
|
||||
int dev, part;
|
||||
__maybe_unused int dev;
|
||||
int part;
|
||||
ulong addr = CONFIG_SYS_LOAD_ADDR;
|
||||
ulong cnt;
|
||||
disk_partition_t info;
|
||||
|
|
Loading…
Reference in a new issue