Separate the declaraction and assignment for some variables.
This is a prep patch for a Coccinelle script that converts
mallloc+memset(,0,) to calloc.
Part of this patch was created using the Coccinelle script below.
@@
identifier x;
expression y;
statement s;
type T;
@@
-T x = malloc(y);
+T x;
+x = malloc(y);
(
if (!x) s
|
if (x == NULL) s
|
)
memset(x, 0, y);
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
static struct null_data *null_init(struct thread_data *td)
{
- struct null_data *nd = malloc(sizeof(*nd));
+ struct null_data *nd;
+ nd = malloc(sizeof(*nd));
memset(nd, 0, sizeof(*nd));
static int fio_posixaio_init(struct thread_data *td)
{
- struct posixaio_data *pd = malloc(sizeof(*pd));
+ struct posixaio_data *pd;
+ pd = malloc(sizeof(*pd));
memset(pd, 0, sizeof(*pd));
pd->aio_events = malloc(td->o.iodepth * sizeof(struct io_u *));
static int fio_solarisaio_init(struct thread_data *td)
{
unsigned int max_depth;
- struct solarisaio_data *sd = malloc(sizeof(*sd));
+ struct solarisaio_data *sd;
+ sd = malloc(sizeof(*sd));
memset(sd, 0, sizeof(*sd));
max_depth = td->o.iodepth;