btrfs-progs: crypto: fix printf warnings in hash-speedtest

With explicit width the default alignment is to the right, using space
is a gnu extension. Fix the following warnings:

  crypto/hash-speedtest.c: In function ‘main’:
  crypto/hash-speedtest.c:152:15: warning: ' ' flag used with ‘%s’ gnu_printf format [-Wformat=]
    152 |   printf("% 12s: ", c->name);
	|               ^
  crypto/hash-speedtest.c:172:21: warning: ' ' flag used with ‘%u’ gnu_printf format [-Wformat=]
    172 |   printf("%s: % 12llu, %s/i % 8llu",
	|                     ^
  crypto/hash-speedtest.c:172:34: warning: ' ' flag used with ‘%u’ gnu_printf format [-Wformat=]
    172 |   printf("%s: % 12llu, %s/i % 8llu",
	|                                  ^

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2021-05-27 10:58:38 +02:00
parent 133dd6c6c3
commit 5734073b15

View File

@ -149,7 +149,7 @@ int main(int argc, char **argv) {
u64 tstart, tend;
u64 total;
printf("% 12s: ", c->name);
printf("%12s: ", c->name);
fflush(stdout);
tstart = get_time();
@ -169,7 +169,7 @@ int main(int argc, char **argv) {
if (units == 1)
total = c->time;
printf("%s: % 12llu, %s/i % 8llu",
printf("%s: %12llu, %s/i %8llu",
units_to_str(units), total,
units_to_str(units), total / iterations);
if (idx > 0) {
@ -178,7 +178,7 @@ int main(int argc, char **argv) {
t = (float)c->time / 1000 / 1000 / 1000;
mb = blocksize * iterations / 1024 / 1024;
printf(", % 12.3f MiB/s", mb / t);
printf(", %12.3f MiB/s", mb / t);
}
putchar('\n');
}