staging: unisys: visorbus: remove unused initializations
authorSameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Thu, 3 Nov 2016 15:44:17 +0000 (11:44 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Nov 2016 09:56:39 +0000 (10:56 +0100)
Removed intializations from visorchipset_open(), visorchipset_init()
and moved the memset in initialize_controlvm_payload_info() down in
case of early returns from the function.

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/unisys/visorbus/visorchipset.c

index 8e67c1754f05586a3f20edf2ad29be40878aa4ce..0cd4ae2570e34ca5aa53ed9186f631098117d955 100644 (file)
@@ -57,7 +57,6 @@ visorchipset_open(struct inode *inode, struct file *file)
 
        if (minor_number)
                return -ENODEV;
-       file->private_data = NULL;
        return 0;
 }
 
@@ -1075,7 +1074,6 @@ initialize_controlvm_payload_info(u64 phys_addr, u64 offset, u32 bytes,
        if (!info)
                return -CONTROLVM_RESP_ERROR_PAYLOAD_INVALID;
 
-       memset(info, 0, sizeof(struct visor_controlvm_payload_info));
        if ((offset == 0) || (bytes == 0))
                return -CONTROLVM_RESP_ERROR_PAYLOAD_INVALID;
 
@@ -1083,6 +1081,7 @@ initialize_controlvm_payload_info(u64 phys_addr, u64 offset, u32 bytes,
        if (!payload)
                return -CONTROLVM_RESP_ERROR_IOREMAP_FAILED;
 
+       memset(info, 0, sizeof(struct visor_controlvm_payload_info));
        info->offset = offset;
        info->bytes = bytes;
        info->ptr = payload;
@@ -2119,8 +2118,6 @@ visorchipset_init(struct acpi_device *acpi_device)
        if (!addr)
                goto error;
 
-       memset(&controlvm_payload_info, 0, sizeof(controlvm_payload_info));
-
        controlvm_channel = visorchannel_create_with_lock(addr, 0,
                                                          GFP_KERNEL, uuid);
        if (!controlvm_channel)