X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=cmd%2Fsf.c;h=738ef0e46dc14fde1ae1550b0873a2a818b7abb6;hb=d5974af7f7626777b5c41894f75c813ff35c1793;hp=f971eec781cc88978f181a9a24ec9d37dff6b11d;hpb=433647a7ef9241b963b4636e7f8c3a2159d156f0;p=oweals%2Fu-boot.git diff --git a/cmd/sf.c b/cmd/sf.c index f971eec781..738ef0e46d 100644 --- a/cmd/sf.c +++ b/cmd/sf.c @@ -1,9 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Command for accessing SPI flash. * * Copyright (C) 2008 Atmel Corporation - * - * SPDX-License-Identifier: GPL-2.0+ */ #include @@ -287,7 +286,7 @@ static int do_spi_flash_read_write(int argc, char * const argv[]) } buf = map_physmem(addr, len, MAP_WRBACK); - if (!buf) { + if (!buf && addr) { puts("Failed to map physical memory\n"); return 1; } @@ -414,7 +413,7 @@ static void show_time(struct test_info *test, int stage) do_div(speed, test->time_ms[stage] * 1024); bps = speed * 8; - printf("%d %s: %d ticks, %d KiB/s %d.%03d Mbps\n", stage, + printf("%d %s: %u ticks, %d KiB/s %d.%03d Mbps\n", stage, stage_name[stage], test->time_ms[stage], (int)speed, bps / 1000, bps % 1000); }