• Marek Vasut's avatar
    cmd: disk: Fix unused variable warning · 04681cb3
    Marek Vasut authored
    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: 's avatarMarek Vasut <marex@denx.de>
    Cc: Simon Glass <sjg@chromium.org>
    Cc: Tom Rini <trini@konsulko.com>
    Reviewed-by: 's avatarSimon Glass <sjg@chromium.org>
    Reviewed-by: 's avatarTom Rini <trini@konsulko.com>
    04681cb3
disk.c 3.15 KB