]> git.karo-electronics.de Git - linux-beck.git/commitdiff
mmc_test: fix display of .5 KiB
authorAdrian Hunter <adrian.hunter@nokia.com>
Thu, 23 Sep 2010 11:51:36 +0000 (14:51 +0300)
committerChris Ball <cjb@laptop.org>
Sat, 23 Oct 2010 13:11:13 +0000 (21:11 +0800)
Append .5 to KiB display when there are an odd number of sectors.

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/card/mmc_test.c

index 5874040b37028e0702eb0a6efd4b605966ea263a..c38a3a84a455b0afba20f824bf8cd24d31137921 100644 (file)
@@ -539,7 +539,7 @@ static void mmc_test_print_rate(struct mmc_test_card *test, uint64_t bytes,
        printk(KERN_INFO "%s: Transfer of %u sectors (%u%s KiB) took %lu.%09lu "
                         "seconds (%u kB/s, %u KiB/s)\n",
                         mmc_hostname(test->card->host), sectors, sectors >> 1,
-                        (sectors == 1 ? ".5" : ""), (unsigned long)ts.tv_sec,
+                        (sectors & 1 ? ".5" : ""), (unsigned long)ts.tv_sec,
                         (unsigned long)ts.tv_nsec, rate / 1000, rate / 1024);
 
        mmc_test_save_transfer_result(test, 1, sectors, ts, rate);
@@ -563,7 +563,7 @@ static void mmc_test_print_avg_rate(struct mmc_test_card *test, uint64_t bytes,
        printk(KERN_INFO "%s: Transfer of %u x %u sectors (%u x %u%s KiB) took "
                         "%lu.%09lu seconds (%u kB/s, %u KiB/s)\n",
                         mmc_hostname(test->card->host), count, sectors, count,
-                        sectors >> 1, (sectors == 1 ? ".5" : ""),
+                        sectors >> 1, (sectors & 1 ? ".5" : ""),
                         (unsigned long)ts.tv_sec, (unsigned long)ts.tv_nsec,
                         rate / 1000, rate / 1024);