X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=t%2Flfsr-test.c;h=ea8c8ddbde9a3429624ddde9cb9615a24c7b8c9b;hb=HEAD;hp=abdbafb5991ddb22053a95dc8022ba6cc7df4eff;hpb=ec2ea18e87fad6c42d6875cd4ee1bb25ef9b4627;p=fio.git diff --git a/t/lfsr-test.c b/t/lfsr-test.c index abdbafb5..632de383 100644 --- a/t/lfsr-test.c +++ b/t/lfsr-test.c @@ -6,8 +6,9 @@ #include "../lib/lfsr.h" #include "../gettime.h" #include "../fio_time.h" +#include "../compiler/compiler.h" -void usage() +static void usage(void) { printf("Usage: lfsr-test 0x [seed] [spin] [verify]\n"); printf("-------------------------------------------------------------\n"); @@ -39,9 +40,12 @@ int main(int argc, char *argv[]) /* Read arguments */ switch (argc) { case 5: if (strncmp(argv[4], "verify", 7) == 0) - verify = 1; + verify = 1; + fio_fallthrough; case 4: spin = atoi(argv[3]); + fio_fallthrough; case 3: seed = atol(argv[2]); + fio_fallthrough; case 2: numbers = strtol(argv[1], NULL, 16); break; default: usage(); @@ -74,8 +78,7 @@ int main(int argc, char *argv[]) /* Create verification table */ if (verify) { v_size = numbers * sizeof(uint8_t); - v = malloc(v_size); - memset(v, 0, v_size); + v = calloc(1, v_size); printf("\nVerification table is %lf KiB\n", (double)(v_size) / 1024); } v_start = v;