Commit e4a3dd33 authored by Erik Arfvidson's avatar Erik Arfvidson Committed by Greg Kroah-Hartman

staging: unisys: fix comparison to NULL in visorchipset.c

This patch fixes the following type of check patch warnings:
Comparison to NULL could be written
Signed-off-by: default avatarErik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: default avatarBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8c395e74
...@@ -438,7 +438,7 @@ parser_id_get(struct parser_context *ctx) ...@@ -438,7 +438,7 @@ parser_id_get(struct parser_context *ctx)
{ {
struct spar_controlvm_parameters_header *phdr = NULL; struct spar_controlvm_parameters_header *phdr = NULL;
if (ctx == NULL) if (!ctx)
return NULL_UUID_LE; return NULL_UUID_LE;
phdr = (struct spar_controlvm_parameters_header *)(ctx->data); phdr = (struct spar_controlvm_parameters_header *)(ctx->data);
return phdr->id; return phdr->id;
...@@ -461,7 +461,7 @@ parser_param_start(struct parser_context *ctx, ...@@ -461,7 +461,7 @@ parser_param_start(struct parser_context *ctx,
{ {
struct spar_controlvm_parameters_header *phdr = NULL; struct spar_controlvm_parameters_header *phdr = NULL;
if (ctx == NULL) if (!ctx)
goto Away; goto Away;
phdr = (struct spar_controlvm_parameters_header *)(ctx->data); phdr = (struct spar_controlvm_parameters_header *)(ctx->data);
switch (which_string) { switch (which_string) {
...@@ -522,7 +522,7 @@ parser_string_get(struct parser_context *ctx) ...@@ -522,7 +522,7 @@ parser_string_get(struct parser_context *ctx)
if (value_length < 0) /* '\0' was not included in the length */ if (value_length < 0) /* '\0' was not included in the length */
value_length = nscan; value_length = nscan;
value = kmalloc(value_length + 1, GFP_KERNEL | __GFP_NORETRY); value = kmalloc(value_length + 1, GFP_KERNEL | __GFP_NORETRY);
if (value == NULL) if (!value)
return NULL; return NULL;
if (value_length > 0) if (value_length > 0)
memcpy(value, pscan, value_length); memcpy(value, pscan, value_length);
...@@ -875,7 +875,7 @@ bus_responder(enum controlvm_id cmd_id, ...@@ -875,7 +875,7 @@ bus_responder(enum controlvm_id cmd_id,
struct controlvm_message_header *pending_msg_hdr, struct controlvm_message_header *pending_msg_hdr,
int response) int response)
{ {
if (pending_msg_hdr == NULL) if (!pending_msg_hdr)
return; /* no controlvm response needed */ return; /* no controlvm response needed */
if (pending_msg_hdr->id != (u32)cmd_id) if (pending_msg_hdr->id != (u32)cmd_id)
...@@ -893,7 +893,7 @@ device_changestate_responder(enum controlvm_id cmd_id, ...@@ -893,7 +893,7 @@ device_changestate_responder(enum controlvm_id cmd_id,
u32 bus_no = p->chipset_bus_no; u32 bus_no = p->chipset_bus_no;
u32 dev_no = p->chipset_dev_no; u32 dev_no = p->chipset_dev_no;
if (p->pending_msg_hdr == NULL) if (!p->pending_msg_hdr)
return; /* no controlvm response needed */ return; /* no controlvm response needed */
if (p->pending_msg_hdr->id != cmd_id) if (p->pending_msg_hdr->id != cmd_id)
return; return;
...@@ -914,7 +914,7 @@ device_responder(enum controlvm_id cmd_id, ...@@ -914,7 +914,7 @@ device_responder(enum controlvm_id cmd_id,
struct controlvm_message_header *pending_msg_hdr, struct controlvm_message_header *pending_msg_hdr,
int response) int response)
{ {
if (pending_msg_hdr == NULL) if (!pending_msg_hdr)
return; /* no controlvm response needed */ return; /* no controlvm response needed */
if (pending_msg_hdr->id != (u32)cmd_id) if (pending_msg_hdr->id != (u32)cmd_id)
...@@ -1180,7 +1180,7 @@ bus_configure(struct controlvm_message *inmsg, ...@@ -1180,7 +1180,7 @@ bus_configure(struct controlvm_message *inmsg,
POSTCODE_LINUX_3(BUS_CONFIGURE_FAILURE_PC, bus_no, POSTCODE_LINUX_3(BUS_CONFIGURE_FAILURE_PC, bus_no,
POSTCODE_SEVERITY_ERR); POSTCODE_SEVERITY_ERR);
rc = -CONTROLVM_RESP_ERROR_BUS_INVALID; rc = -CONTROLVM_RESP_ERROR_BUS_INVALID;
} else if (bus_info->pending_msg_hdr != NULL) { } else if (bus_info->pending_msg_hdr) {
POSTCODE_LINUX_3(BUS_CONFIGURE_FAILURE_PC, bus_no, POSTCODE_LINUX_3(BUS_CONFIGURE_FAILURE_PC, bus_no,
POSTCODE_SEVERITY_ERR); POSTCODE_SEVERITY_ERR);
rc = -CONTROLVM_RESP_ERROR_MESSAGE_ID_INVALID_FOR_CLIENT; rc = -CONTROLVM_RESP_ERROR_MESSAGE_ID_INVALID_FOR_CLIENT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment