From: Marek Vasut Date: Sat, 30 Apr 2016 22:35:54 +0000 (+0200) Subject: cmd: disk: Fix unused variable warning X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=04681cb3a4d2ef5351f94132e325fb8841d37961;p=u-boot.git 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 Cc: Simon Glass Cc: Tom Rini Reviewed-by: Simon Glass Reviewed-by: Tom Rini --- diff --git a/cmd/disk.c b/cmd/disk.c index fcc4123127..92de3af8a5 100644 --- a/cmd/disk.c +++ b/cmd/disk.c @@ -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;