software/memtest: fix bandwidth computation
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Wed, 17 Jul 2013 11:08:40 +0000 (13:08 +0200)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Wed, 17 Jul 2013 11:08:40 +0000 (13:08 +0200)
software/memtest/main.c

index 8e7bcdd9826d7a4f8b485eae0363aeb04c68aaf0..3e03b129fd0a928d893648ded305a5309aee5081 100644 (file)
@@ -20,9 +20,9 @@ static void membw_service(void)
                nr = lasmicon_bandwidth_nreads_read();
                nw = lasmicon_bandwidth_nwrites_read();
                f = identifier_frequency_read();
-               rdb = nr*f >> (24 - 7);
-               wrb = nw*f >> (24 - 7);
-               printf("read:%4dMbps  write:%4dMbps  all:%4dMbps\n", rdb/1000000, wrb/1000000, (rdb + wrb)/1000000);
+               rdb = (nr*f >> (24 - 7))/1000000ULL;
+               wrb = (nw*f >> (24 - 7))/1000000ULL;
+               printf("read:%5dMbps  write:%5dMbps  all:%5dMbps\n", rdb, wrb, rdb + wrb);
        }
 }