test: cmocka: src: avoid NULL comparison

Replace NULL comparison with boolean negation. Issue found using
Coccinelle.

Signed-off-by: Payal Kshirsagar <payalskshirsagar1234@gmail.com>
This commit is contained in:
Payal Kshirsagar 2020-03-23 18:10:39 +05:30 committed by Janusz Jankowski
parent e197132dad
commit 22be53b98a
5 changed files with 5 additions and 5 deletions

View File

@ -22,7 +22,7 @@ static int setup(void **state)
pipeline_posn_init(sof_get());
if (pipeline_data == NULL)
if (!pipeline_data)
return -1;
struct sof_ipc_pipe_new pipe_desc = { .core = 1, .priority = 2 };

View File

@ -23,7 +23,7 @@ static int setup(void **state)
{
struct test_data *data = malloc(sizeof(struct test_data));
if (data == NULL)
if (!data)
return -1;
data->head = malloc(sizeof(struct list_item));

View File

@ -23,7 +23,7 @@ static int setup(void **state)
{
struct test_data *data = malloc(sizeof(struct test_data));
if (data == NULL)
if (!data)
return -1;
data->head = malloc(sizeof(struct list_item));

View File

@ -23,7 +23,7 @@ static int setup(void **state)
{
struct test_data *data = malloc(sizeof(struct test_data));
if (data == NULL)
if (!data)
return -1;
data->head = malloc(sizeof(struct list_item));

View File

@ -23,7 +23,7 @@ static int setup(void **state)
{
struct test_data *data = malloc(sizeof(struct test_data));
if (data == NULL)
if (!data)
return -1;
data->head = malloc(sizeof(struct list_item));