summaryrefslogtreecommitdiffstats
path: root/drivers/staging/unisys/visorbus/visorchipset.c
diff options
context:
space:
mode:
authorDavid Binder2016-12-22 17:09:00 +0100
committerGreg Kroah-Hartman2017-01-03 15:17:02 +0100
commit3e4273db10ee7bd1000a088f4c647cb993fc009c (patch)
tree6e8d480eb5c19b2252d6ae2c07670a8007eeee88 /drivers/staging/unisys/visorbus/visorchipset.c
parentstaging: unisys: visorbus: Use switch statement instead of conditionals (diff)
downloadkernel-qcow2-linux-3e4273db10ee7bd1000a088f4c647cb993fc009c.tar.gz
kernel-qcow2-linux-3e4273db10ee7bd1000a088f4c647cb993fc009c.tar.xz
kernel-qcow2-linux-3e4273db10ee7bd1000a088f4c647cb993fc009c.zip
staging: unisys: visorbus: Remove unneeded checks for valid variable addr
The 'retry' variable created in handle_command() is statically allocated, and its address is never set to NULL. Therefore conditionals to verify the validity of the retry variable's address are unnecessary. Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: David Binder <david.binder@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/unisys/visorbus/visorchipset.c')
-rw-r--r--drivers/staging/unisys/visorbus/visorchipset.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c
index 275653ac6a68..b6f1ccf03d60 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -1852,8 +1852,7 @@ parser_init_byte_stream(u64 addr, u32 bytes, bool local, bool *retry)
int allocbytes = sizeof(struct parser_context) + bytes;
struct parser_context *ctx;
- if (retry)
- *retry = false;
+ *retry = false;
/*
* alloc an 0 extra byte to ensure payload is
@@ -1862,14 +1861,12 @@ parser_init_byte_stream(u64 addr, u32 bytes, bool local, bool *retry)
allocbytes++;
if ((controlvm_payload_bytes_buffered + bytes)
> MAX_CONTROLVM_PAYLOAD_BYTES) {
- if (retry)
- *retry = true;
+ *retry = true;
return NULL;
}
ctx = kzalloc(allocbytes, GFP_KERNEL | __GFP_NORETRY);
if (!ctx) {
- if (retry)
- *retry = true;
+ *retry = true;
return NULL;
}