fio: replace malloc+memset with calloc
Clean up the code base by replacing malloc+memset with calloc. This
patch was generated from the Coccinelle script below.
The script below is inspired by similar scripts used elsewhere:
https://lore.kernel.org/linux-btrfs/cover.
1443546000.git.silvio.fricke@gmail.com/
https://github.com/coccinelle/coccinellery/blob/master/simple_kzalloc/simple_kzalloc1.cocci
@@
expression x,y;
statement s;
type T;
@@
-x = malloc(y * sizeof(T));
+x = calloc(y, sizeof(T));
(
if (!x) s
|
if (x == NULL) s
|
)
-memset(x, 0, y * sizeof(T));
@@
expression x,y,z;
statement s;
@@
-x = malloc(y * sizeof(z));
+x = calloc(y, sizeof(z));
(
if (!x) s
|
if (x == NULL) s
|
)
-memset(x, 0, y * sizeof(z));
@@
expression e,x;
statement s;
@@
-x = malloc(e);
+x = calloc(1, e);
(
if (!x) s
|
if (x == NULL) s
|
)
-memset(x, 0, e);
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>