staging: unisys: fix CamelCase params in responder functions
[firefly-linux-kernel-4.4.55.git] / drivers / staging / unisys / visorchipset / visorchipset_main.c
index 401cd1e0d1a579a2118555bb97b00c47fd162f66..700b35ed08cda30e2a8a7d24a9432fc1a1bb45e8 100644 (file)
@@ -96,34 +96,29 @@ static struct controlvm_message_packet g_devicechangestate_packet;
 static LIST_HEAD(bus_info_list);
 static LIST_HEAD(dev_info_list);
 
-static struct visorchannel *ControlVm_channel;
+static struct visorchannel *controlvm_channel;
 
-struct controlvm_payload_info {
+/* Manages the request payload in the controlvm channel */
+static struct controlvm_payload_info {
        u8 __iomem *ptr;        /* pointer to base address of payload pool */
        u64 offset;             /* offset from beginning of controlvm
                                 * channel to beginning of payload * pool */
        u32 bytes;              /* number of bytes in payload pool */
-};
-
-/* Manages the request payload in the controlvm channel */
-static struct controlvm_payload_info ControlVm_payload_info;
-
-static struct channel_header *Test_Vnic_channel;
+} controlvm_payload_info;
 
-struct livedump_info {
-       struct controlvm_message_header Dumpcapture_header;
-       struct controlvm_message_header Gettextdump_header;
-       struct controlvm_message_header Dumpcomplete_header;
-       BOOL Gettextdump_outstanding;
+/* Manages the info for a CONTROLVM_DUMP_CAPTURESTATE /
+ * CONTROLVM_DUMP_GETTEXTDUMP / CONTROLVM_DUMP_COMPLETE conversation.
+ */
+static struct livedump_info {
+       struct controlvm_message_header dumpcapture_header;
+       struct controlvm_message_header gettextdump_header;
+       struct controlvm_message_header dumpcomplete_header;
+       BOOL gettextdump_outstanding;
        u32 crc32;
        ulong length;
        atomic_t buffers_in_use;
        ulong destination;
-};
-/* Manages the info for a CONTROLVM_DUMP_CAPTURESTATE /
- * CONTROLVM_DUMP_GETTEXTDUMP / CONTROLVM_DUMP_COMPLETE conversation.
- */
-static struct livedump_info LiveDump_info;
+} livedump_info;
 
 /* The following globals are used to handle the scenario where we are unable to
  * offload the payload from a controlvm message due to memory requirements.  In
@@ -353,7 +348,7 @@ static ssize_t toolaction_show(struct device *dev,
 {
        u8 toolAction;
 
-       visorchannel_read(ControlVm_channel,
+       visorchannel_read(controlvm_channel,
                offsetof(struct spar_controlvm_channel_protocol,
                           tool_action), &toolAction, sizeof(u8));
        return scnprintf(buf, PAGE_SIZE, "%u\n", toolAction);
@@ -369,7 +364,7 @@ static ssize_t toolaction_store(struct device *dev,
        if (kstrtou8(buf, 10, &toolAction) != 0)
                return -EINVAL;
 
-       ret = visorchannel_write(ControlVm_channel,
+       ret = visorchannel_write(controlvm_channel,
                offsetof(struct spar_controlvm_channel_protocol, tool_action),
                &toolAction, sizeof(u8));
 
@@ -384,7 +379,7 @@ static ssize_t boottotool_show(struct device *dev,
 {
        struct efi_spar_indication efiSparIndication;
 
-       visorchannel_read(ControlVm_channel,
+       visorchannel_read(controlvm_channel,
                offsetof(struct spar_controlvm_channel_protocol,
                        efi_spar_ind), &efiSparIndication,
                sizeof(struct efi_spar_indication));
@@ -403,7 +398,7 @@ static ssize_t boottotool_store(struct device *dev,
                return -EINVAL;
 
        efiSparIndication.boot_to_tool = val;
-       ret = visorchannel_write(ControlVm_channel,
+       ret = visorchannel_write(controlvm_channel,
                        offsetof(struct spar_controlvm_channel_protocol,
                                efi_spar_ind),
                        &(efiSparIndication),
@@ -419,7 +414,7 @@ static ssize_t error_show(struct device *dev, struct device_attribute *attr,
 {
        u32 error;
 
-       visorchannel_read(ControlVm_channel, offsetof(
+       visorchannel_read(controlvm_channel, offsetof(
                struct spar_controlvm_channel_protocol, installation_error),
                &error, sizeof(u32));
        return scnprintf(buf, PAGE_SIZE, "%i\n", error);
@@ -434,7 +429,7 @@ static ssize_t error_store(struct device *dev, struct device_attribute *attr,
        if (kstrtou32(buf, 10, &error) != 0)
                return -EINVAL;
 
-       ret = visorchannel_write(ControlVm_channel,
+       ret = visorchannel_write(controlvm_channel,
                        offsetof(struct spar_controlvm_channel_protocol,
                                installation_error),
                        &error, sizeof(u32));
@@ -448,7 +443,7 @@ static ssize_t textid_show(struct device *dev, struct device_attribute *attr,
 {
        u32 textId;
 
-       visorchannel_read(ControlVm_channel, offsetof(
+       visorchannel_read(controlvm_channel, offsetof(
                struct spar_controlvm_channel_protocol, installation_text_id),
                &textId, sizeof(u32));
        return scnprintf(buf, PAGE_SIZE, "%i\n", textId);
@@ -463,7 +458,7 @@ static ssize_t textid_store(struct device *dev, struct device_attribute *attr,
        if (kstrtou32(buf, 10, &textId) != 0)
                return -EINVAL;
 
-       ret = visorchannel_write(ControlVm_channel,
+       ret = visorchannel_write(controlvm_channel,
                        offsetof(struct spar_controlvm_channel_protocol,
                                installation_text_id),
                        &textId, sizeof(u32));
@@ -472,13 +467,12 @@ static ssize_t textid_store(struct device *dev, struct device_attribute *attr,
        return count;
 }
 
-
 static ssize_t remaining_steps_show(struct device *dev,
        struct device_attribute *attr, char *buf)
 {
        u16 remainingSteps;
 
-       visorchannel_read(ControlVm_channel,
+       visorchannel_read(controlvm_channel,
                offsetof(struct spar_controlvm_channel_protocol,
                        installation_remaining_steps),
                &remainingSteps,
@@ -495,7 +489,7 @@ static ssize_t remaining_steps_store(struct device *dev,
        if (kstrtou16(buf, 10, &remainingSteps) != 0)
                return -EINVAL;
 
-       ret = visorchannel_write(ControlVm_channel,
+       ret = visorchannel_write(controlvm_channel,
                        offsetof(struct spar_controlvm_channel_protocol,
                                installation_remaining_steps),
                        &remainingSteps, sizeof(u16));
@@ -504,44 +498,11 @@ static ssize_t remaining_steps_store(struct device *dev,
        return count;
 }
 
-#if 0
 static void
-testUnicode(void)
-{
-       wchar_t unicodeString[] = { 'a', 'b', 'c', 0 };
-       char s[sizeof(unicodeString) * NLS_MAX_CHARSET_SIZE];
-       wchar_t unicode2[99];
-
-       /* NOTE: Either due to a bug, or feature I don't understand, the
-        *       kernel utf8_mbstowcs() and utf_wcstombs() do NOT copy the
-        *       trailed NUL byte!!   REALLY!!!!!    Arrrrgggghhhhh
-        */
-
-       LOGINF("sizeof(wchar_t) = %d", sizeof(wchar_t));
-       LOGINF("utf8_wcstombs=%d",
-              chrs = utf8_wcstombs(s, unicodeString, sizeof(s)));
-       if (chrs >= 0)
-               s[chrs] = '\0'; /* GRRRRRRRR */
-       LOGINF("s='%s'", s);
-       LOGINF("utf8_mbstowcs=%d", chrs = utf8_mbstowcs(unicode2, s, 100));
-       if (chrs >= 0)
-               unicode2[chrs] = 0;     /* GRRRRRRRR */
-       if (memcmp(unicodeString, unicode2, sizeof(unicodeString)) == 0)
-               LOGINF("strings match... good");
-       else
-               LOGINF("strings did not match!!");
-}
-#endif
-
-static void
-busInfo_clear(void *v)
+bus_info_clear(void *v)
 {
        struct visorchipset_bus_info *p = (struct visorchipset_bus_info *) (v);
 
-       if (p->proc_object) {
-               visor_proc_DestroyObject(p->proc_object);
-               p->proc_object = NULL;
-       }
        kfree(p->name);
        p->name = NULL;
 
@@ -553,7 +514,7 @@ busInfo_clear(void *v)
 }
 
 static void
-devInfo_clear(void *v)
+dev_info_clear(void *v)
 {
        struct visorchipset_device_info *p =
                        (struct visorchipset_device_info *)(v);
@@ -589,7 +550,7 @@ visorchipset_register_busdev_server(
                        struct ultra_vbus_deviceinfo *driver_info)
 {
        down(&notifier_lock);
-       if (notifiers == NULL) {
+       if (!notifiers) {
                memset(&BusDev_Server_Notifiers, 0,
                       sizeof(BusDev_Server_Notifiers));
                serverregistered = 0;   /* clear flag */
@@ -614,7 +575,7 @@ visorchipset_register_busdev_client(
                        struct ultra_vbus_deviceinfo *driver_info)
 {
        down(&notifier_lock);
-       if (notifiers == NULL) {
+       if (!notifiers) {
                memset(&BusDev_Client_Notifiers, 0,
                       sizeof(BusDev_Client_Notifiers));
                clientregistered = 0;   /* clear flag */
@@ -638,13 +599,13 @@ cleanup_controlvm_structures(void)
        struct visorchipset_device_info *di, *tmp_di;
 
        list_for_each_entry_safe(bi, tmp_bi, &bus_info_list, entry) {
-               busInfo_clear(bi);
+               bus_info_clear(bi);
                list_del(&bi->entry);
                kfree(bi);
        }
 
        list_for_each_entry_safe(di, tmp_di, &dev_info_list, entry) {
-               devInfo_clear(di);
+               dev_info_clear(di);
                list_del(&di->entry);
                kfree(di);
        }
@@ -660,7 +621,7 @@ chipset_init(struct controlvm_message *inmsg)
        POSTCODE_LINUX_2(CHIPSET_INIT_ENTRY_PC, POSTCODE_SEVERITY_INFO);
        if (chipset_inited) {
                rc = -CONTROLVM_RESP_ERROR_ALREADY_DONE;
-               goto Away;
+               goto cleanup;
        }
        chipset_inited = 1;
        POSTCODE_LINUX_2(CHIPSET_INIT_EXIT_PC, POSTCODE_SEVERITY_INFO);
@@ -675,7 +636,7 @@ chipset_init(struct controlvm_message *inmsg)
         * features-aware driver. */
        features |= ULTRA_CHIPSET_FEATURE_REPLY;
 
-Away:
+cleanup:
        if (rc < 0)
                cleanup_controlvm_structures();
        if (inmsg->hdr.flags.response_expected)
@@ -714,7 +675,7 @@ controlvm_respond(struct controlvm_message_header *msgHdr, int response)
        if (outmsg.hdr.flags.test_message == 1)
                return;
 
-       if (!visorchannel_signalinsert(ControlVm_channel,
+       if (!visorchannel_signalinsert(controlvm_channel,
                                       CONTROLVM_QUEUE_REQUEST, &outmsg)) {
                return;
        }
@@ -729,7 +690,7 @@ controlvm_respond_chipset_init(struct controlvm_message_header *msgHdr,
 
        controlvm_init_response(&outmsg, msgHdr, response);
        outmsg.cmd.init_chipset.features = features;
-       if (!visorchannel_signalinsert(ControlVm_channel,
+       if (!visorchannel_signalinsert(controlvm_channel,
                                       CONTROLVM_QUEUE_REQUEST, &outmsg)) {
                return;
        }
@@ -744,7 +705,7 @@ static void controlvm_respond_physdev_changestate(
        controlvm_init_response(&outmsg, msgHdr, response);
        outmsg.cmd.device_change_state.state = state;
        outmsg.cmd.device_change_state.flags.phys_device = 1;
-       if (!visorchannel_signalinsert(ControlVm_channel,
+       if (!visorchannel_signalinsert(controlvm_channel,
                                       CONTROLVM_QUEUE_REQUEST, &outmsg)) {
                return;
        }
@@ -754,39 +715,39 @@ void
 visorchipset_save_message(struct controlvm_message *msg,
                          enum crash_obj_type type)
 {
-       u32 localSavedCrashMsgOffset;
-       u16 localSavedCrashMsgCount;
+       u32 crash_msg_offset;
+       u16 crash_msg_count;
 
        /* get saved message count */
-       if (visorchannel_read(ControlVm_channel,
+       if (visorchannel_read(controlvm_channel,
                              offsetof(struct spar_controlvm_channel_protocol,
                                       saved_crash_message_count),
-                             &localSavedCrashMsgCount, sizeof(u16)) < 0) {
+                             &crash_msg_count, sizeof(u16)) < 0) {
                POSTCODE_LINUX_2(CRASH_DEV_CTRL_RD_FAILURE_PC,
                                 POSTCODE_SEVERITY_ERR);
                return;
        }
 
-       if (localSavedCrashMsgCount != CONTROLVM_CRASHMSG_MAX) {
+       if (crash_msg_count != CONTROLVM_CRASHMSG_MAX) {
                POSTCODE_LINUX_3(CRASH_DEV_COUNT_FAILURE_PC,
-                                localSavedCrashMsgCount,
+                                crash_msg_count,
                                 POSTCODE_SEVERITY_ERR);
                return;
        }
 
        /* get saved crash message offset */
-       if (visorchannel_read(ControlVm_channel,
+       if (visorchannel_read(controlvm_channel,
                              offsetof(struct spar_controlvm_channel_protocol,
                                       saved_crash_message_offset),
-                             &localSavedCrashMsgOffset, sizeof(u32)) < 0) {
+                             &crash_msg_offset, sizeof(u32)) < 0) {
                POSTCODE_LINUX_2(CRASH_DEV_CTRL_RD_FAILURE_PC,
                                 POSTCODE_SEVERITY_ERR);
                return;
        }
 
        if (type == CRASH_BUS) {
-               if (visorchannel_write(ControlVm_channel,
-                                      localSavedCrashMsgOffset,
+               if (visorchannel_write(controlvm_channel,
+                                      crash_msg_offset,
                                       msg,
                                       sizeof(struct controlvm_message)) < 0) {
                        POSTCODE_LINUX_2(SAVE_MSG_BUS_FAILURE_PC,
@@ -794,8 +755,8 @@ visorchipset_save_message(struct controlvm_message *msg,
                        return;
                }
        } else {
-               if (visorchannel_write(ControlVm_channel,
-                                      localSavedCrashMsgOffset +
+               if (visorchannel_write(controlvm_channel,
+                                      crash_msg_offset +
                                       sizeof(struct controlvm_message), msg,
                                       sizeof(struct controlvm_message)) < 0) {
                        POSTCODE_LINUX_2(SAVE_MSG_DEV_FAILURE_PC,
@@ -807,62 +768,62 @@ visorchipset_save_message(struct controlvm_message *msg,
 EXPORT_SYMBOL_GPL(visorchipset_save_message);
 
 static void
-bus_responder(enum controlvm_id cmdId, ulong busNo, int response)
+bus_responder(enum controlvm_id cmd_id, ulong bus_no, int response)
 {
        struct visorchipset_bus_info *p = NULL;
        BOOL need_clear = FALSE;
 
-       p = findbus(&bus_info_list, busNo);
+       p = findbus(&bus_info_list, bus_no);
        if (!p)
                return;
 
        if (response < 0) {
-               if ((cmdId == CONTROLVM_BUS_CREATE) &&
+               if ((cmd_id == CONTROLVM_BUS_CREATE) &&
                    (response != (-CONTROLVM_RESP_ERROR_ALREADY_DONE)))
                        /* undo the row we just created... */
-                       delbusdevices(&dev_info_list, busNo);
+                       delbusdevices(&dev_info_list, bus_no);
        } else {
-               if (cmdId == CONTROLVM_BUS_CREATE)
+               if (cmd_id == CONTROLVM_BUS_CREATE)
                        p->state.created = 1;
-               if (cmdId == CONTROLVM_BUS_DESTROY)
+               if (cmd_id == CONTROLVM_BUS_DESTROY)
                        need_clear = TRUE;
        }
 
        if (p->pending_msg_hdr.id == CONTROLVM_INVALID)
                return;         /* no controlvm response needed */
-       if (p->pending_msg_hdr.id != (u32) cmdId)
+       if (p->pending_msg_hdr.id != (u32) cmd_id)
                return;
        controlvm_respond(&p->pending_msg_hdr, response);
        p->pending_msg_hdr.id = CONTROLVM_INVALID;
        if (need_clear) {
-               busInfo_clear(p);
-               delbusdevices(&dev_info_list, busNo);
+               bus_info_clear(p);
+               delbusdevices(&dev_info_list, bus_no);
        }
 }
 
 static void
-device_changestate_responder(enum controlvm_id cmdId,
-                            ulong busNo, ulong devNo, int response,
-                            struct spar_segment_state responseState)
+device_changestate_responder(enum controlvm_id cmd_id,
+                            ulong bus_no, ulong dev_no, int response,
+                            struct spar_segment_state response_state)
 {
        struct visorchipset_device_info *p = NULL;
        struct controlvm_message outmsg;
 
-       p = finddevice(&dev_info_list, busNo, devNo);
+       p = finddevice(&dev_info_list, bus_no, dev_no);
        if (!p)
                return;
        if (p->pending_msg_hdr.id == CONTROLVM_INVALID)
                return;         /* no controlvm response needed */
-       if (p->pending_msg_hdr.id != cmdId)
+       if (p->pending_msg_hdr.id != cmd_id)
                return;
 
        controlvm_init_response(&outmsg, &p->pending_msg_hdr, response);
 
-       outmsg.cmd.device_change_state.bus_no = busNo;
-       outmsg.cmd.device_change_state.dev_no = devNo;
-       outmsg.cmd.device_change_state.state = responseState;
+       outmsg.cmd.device_change_state.bus_no = bus_no;
+       outmsg.cmd.device_change_state.dev_no = dev_no;
+       outmsg.cmd.device_change_state.state = response_state;
 
-       if (!visorchannel_signalinsert(ControlVm_channel,
+       if (!visorchannel_signalinsert(controlvm_channel,
                                       CONTROLVM_QUEUE_REQUEST, &outmsg))
                return;
 
@@ -870,32 +831,32 @@ device_changestate_responder(enum controlvm_id cmdId,
 }
 
 static void
-device_responder(enum controlvm_id cmdId, ulong busNo, ulong devNo,
+device_responder(enum controlvm_id cmd_id, ulong bus_no, ulong dev_no,
                 int response)
 {
        struct visorchipset_device_info *p = NULL;
        BOOL need_clear = FALSE;
 
-       p = finddevice(&dev_info_list, busNo, devNo);
+       p = finddevice(&dev_info_list, bus_no, dev_no);
        if (!p)
                return;
        if (response >= 0) {
-               if (cmdId == CONTROLVM_DEVICE_CREATE)
+               if (cmd_id == CONTROLVM_DEVICE_CREATE)
                        p->state.created = 1;
-               if (cmdId == CONTROLVM_DEVICE_DESTROY)
+               if (cmd_id == CONTROLVM_DEVICE_DESTROY)
                        need_clear = TRUE;
        }
 
        if (p->pending_msg_hdr.id == CONTROLVM_INVALID)
                return;         /* no controlvm response needed */
 
-       if (p->pending_msg_hdr.id != (u32) cmdId)
+       if (p->pending_msg_hdr.id != (u32) cmd_id)
                return;
 
        controlvm_respond(&p->pending_msg_hdr, response);
        p->pending_msg_hdr.id = CONTROLVM_INVALID;
        if (need_clear)
-               devInfo_clear(p);
+               dev_info_clear(p);
 }
 
 static void
@@ -1077,7 +1038,7 @@ bus_create(struct controlvm_message *inmsg)
                goto Away;
        }
        pBusInfo = kzalloc(sizeof(struct visorchipset_bus_info), GFP_KERNEL);
-       if (pBusInfo == NULL) {
+       if (!pBusInfo) {
                POSTCODE_LINUX_3(BUS_CREATE_FAILURE_PC, busNo,
                                 POSTCODE_SEVERITY_ERR);
                rc = -CONTROLVM_RESP_ERROR_KMALLOC_FAILED;
@@ -1211,7 +1172,7 @@ my_device_create(struct controlvm_message *inmsg)
                goto Away;
        }
        pDevInfo = kzalloc(sizeof(struct visorchipset_device_info), GFP_KERNEL);
-       if (pDevInfo == NULL) {
+       if (!pDevInfo) {
                POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, devNo, busNo,
                                 POSTCODE_SEVERITY_ERR);
                rc = -CONTROLVM_RESP_ERROR_KMALLOC_FAILED;
@@ -1321,7 +1282,7 @@ initialize_controlvm_payload_info(HOSTADDRESS phys_addr, u64 offset, u32 bytes,
        u8 __iomem *payload = NULL;
        int rc = CONTROLVM_RESP_SUCCESS;
 
-       if (info == NULL) {
+       if (!info) {
                rc = -CONTROLVM_RESP_ERROR_PAYLOAD_INVALID;
                goto Away;
        }
@@ -1331,7 +1292,7 @@ initialize_controlvm_payload_info(HOSTADDRESS phys_addr, u64 offset, u32 bytes,
                goto Away;
        }
        payload = ioremap_cache(phys_addr + offset, bytes);
-       if (payload == NULL) {
+       if (!payload) {
                rc = -CONTROLVM_RESP_ERROR_IOREMAP_FAILED;
                goto Away;
        }
@@ -1363,11 +1324,11 @@ destroy_controlvm_payload_info(struct controlvm_payload_info *info)
 static void
 initialize_controlvm_payload(void)
 {
-       HOSTADDRESS phys_addr = visorchannel_get_physaddr(ControlVm_channel);
+       HOSTADDRESS phys_addr = visorchannel_get_physaddr(controlvm_channel);
        u64 payloadOffset = 0;
        u32 payloadBytes = 0;
 
-       if (visorchannel_read(ControlVm_channel,
+       if (visorchannel_read(controlvm_channel,
                              offsetof(struct spar_controlvm_channel_protocol,
                                       request_payload_offset),
                              &payloadOffset, sizeof(payloadOffset)) < 0) {
@@ -1375,7 +1336,7 @@ initialize_controlvm_payload(void)
                                 POSTCODE_SEVERITY_ERR);
                return;
        }
-       if (visorchannel_read(ControlVm_channel,
+       if (visorchannel_read(controlvm_channel,
                              offsetof(struct spar_controlvm_channel_protocol,
                                       request_payload_bytes),
                              &payloadBytes, sizeof(payloadBytes)) < 0) {
@@ -1385,7 +1346,7 @@ initialize_controlvm_payload(void)
        }
        initialize_controlvm_payload_info(phys_addr,
                                          payloadOffset, payloadBytes,
-                                         &ControlVm_payload_info);
+                                         &controlvm_payload_info);
 }
 
 /*  Send ACTION=online for DEVPATH=/sys/devices/platform/visorchipset.
@@ -1468,7 +1429,7 @@ chipset_notready(struct controlvm_message_header *msgHdr)
 static BOOL
 read_controlvm_event(struct controlvm_message *msg)
 {
-       if (visorchannel_signalremove(ControlVm_channel,
+       if (visorchannel_signalremove(controlvm_channel,
                                      CONTROLVM_QUEUE_EVENT, msg)) {
                /* got a message */
                if (msg->hdr.flags.test_message == 1)
@@ -1525,7 +1486,7 @@ parahotplug_request_create(struct controlvm_message *msg)
        struct parahotplug_request *req;
 
        req = kmalloc(sizeof(*req), GFP_KERNEL|__GFP_NORETRY);
-       if (req == NULL)
+       if (!req)
                return NULL;
 
        req->id = parahotplug_next_id();
@@ -1650,7 +1611,7 @@ parahotplug_process_message(struct controlvm_message *inmsg)
 
        req = parahotplug_request_create(inmsg);
 
-       if (req == NULL)
+       if (!req)
                return;
 
        if (inmsg->cmd.device_change_state.state.active) {
@@ -1727,8 +1688,8 @@ handle_command(struct controlvm_message inmsg, HOSTADDRESS channel_addr)
        if (!isLocalAddr) {
                controlvm_init_response(&ackmsg, &inmsg.hdr,
                                        CONTROLVM_RESP_SUCCESS);
-               if (ControlVm_channel)
-                       visorchannel_signalinsert(ControlVm_channel,
+               if (controlvm_channel)
+                       visorchannel_signalinsert(controlvm_channel,
                                                  CONTROLVM_QUEUE_ACK,
                                                  &ackmsg);
        }
@@ -1784,7 +1745,7 @@ handle_command(struct controlvm_message inmsg, HOSTADDRESS channel_addr)
                break;
        }
 
-       if (parser_ctx != NULL) {
+       if (parser_ctx) {
                parser_done(parser_ctx);
                parser_ctx = NULL;
        }
@@ -1838,10 +1799,10 @@ controlvm_periodic_work(struct work_struct *work)
                }
        }
 
-       while (visorchannel_signalremove(ControlVm_channel,
+       while (visorchannel_signalremove(controlvm_channel,
                                         CONTROLVM_QUEUE_RESPONSE,
-                                        &inmsg)) {
-       }
+                                        &inmsg))
+               ;
        if (!gotACommand) {
                if (ControlVm_Pending_Msg_Valid) {
                        /* we throttled processing of a prior
@@ -1860,7 +1821,7 @@ controlvm_periodic_work(struct work_struct *work)
                most_recent_message_jiffies = jiffies;
                if (handle_command(inmsg,
                                   visorchannel_get_physaddr
-                                  (ControlVm_channel)))
+                                  (controlvm_channel)))
                        gotACommand = read_controlvm_event(&inmsg);
                else {
                        /* this is a scenario where throttling
@@ -1900,7 +1861,6 @@ Away:
 static void
 setup_crash_devices_work_queue(struct work_struct *work)
 {
-
        struct controlvm_message localCrashCreateBusMsg;
        struct controlvm_message localCrashCreateDevMsg;
        struct controlvm_message msg;
@@ -1927,7 +1887,7 @@ setup_crash_devices_work_queue(struct work_struct *work)
        chipset_init(&msg);
 
        /* get saved message count */
-       if (visorchannel_read(ControlVm_channel,
+       if (visorchannel_read(controlvm_channel,
                              offsetof(struct spar_controlvm_channel_protocol,
                                       saved_crash_message_count),
                              &localSavedCrashMsgCount, sizeof(u16)) < 0) {
@@ -1944,7 +1904,7 @@ setup_crash_devices_work_queue(struct work_struct *work)
        }
 
        /* get saved crash message offset */
-       if (visorchannel_read(ControlVm_channel,
+       if (visorchannel_read(controlvm_channel,
                              offsetof(struct spar_controlvm_channel_protocol,
                                       saved_crash_message_offset),
                              &localSavedCrashMsgOffset, sizeof(u32)) < 0) {
@@ -1954,7 +1914,7 @@ setup_crash_devices_work_queue(struct work_struct *work)
        }
 
        /* read create device message for storage bus offset */
-       if (visorchannel_read(ControlVm_channel,
+       if (visorchannel_read(controlvm_channel,
                              localSavedCrashMsgOffset,
                              &localCrashCreateBusMsg,
                              sizeof(struct controlvm_message)) < 0) {
@@ -1964,7 +1924,7 @@ setup_crash_devices_work_queue(struct work_struct *work)
        }
 
        /* read create device message for storage device */
-       if (visorchannel_read(ControlVm_channel,
+       if (visorchannel_read(controlvm_channel,
                              localSavedCrashMsgOffset +
                              sizeof(struct controlvm_message),
                              &localCrashCreateDevMsg,
@@ -2029,7 +1989,6 @@ device_destroy_response(ulong busNo, ulong devNo, int response)
 void
 visorchipset_device_pause_response(ulong bus_no, ulong dev_no, int response)
 {
-
        device_changestate_responder(CONTROLVM_DEVICE_CHANGESTATE,
                                     bus_no, dev_no, response,
                                     segment_state_standby);
@@ -2196,9 +2155,9 @@ visorchipset_init(void)
 
        memset(&BusDev_Server_Notifiers, 0, sizeof(BusDev_Server_Notifiers));
        memset(&BusDev_Client_Notifiers, 0, sizeof(BusDev_Client_Notifiers));
-       memset(&ControlVm_payload_info, 0, sizeof(ControlVm_payload_info));
-       memset(&LiveDump_info, 0, sizeof(LiveDump_info));
-       atomic_set(&LiveDump_info.buffers_in_use, 0);
+       memset(&controlvm_payload_info, 0, sizeof(controlvm_payload_info));
+       memset(&livedump_info, 0, sizeof(livedump_info));
+       atomic_set(&livedump_info.buffers_in_use, 0);
 
        if (visorchipset_testvnic) {
                POSTCODE_LINUX_3(CHIPSET_INIT_FAILURE_PC, x, DIAG_SEVERITY_ERR);
@@ -2208,17 +2167,17 @@ visorchipset_init(void)
 
        addr = controlvm_get_channel_address();
        if (addr != 0) {
-               ControlVm_channel =
+               controlvm_channel =
                    visorchannel_create_with_lock
                    (addr,
                     sizeof(struct spar_controlvm_channel_protocol),
                     spar_controlvm_channel_protocol_uuid);
                if (SPAR_CONTROLVM_CHANNEL_OK_CLIENT(
-                               visorchannel_get_header(ControlVm_channel))) {
+                               visorchannel_get_header(controlvm_channel))) {
                        initialize_controlvm_payload();
                } else {
-                       visorchannel_destroy(ControlVm_channel);
-                       ControlVm_channel = NULL;
+                       visorchannel_destroy(controlvm_channel);
+                       controlvm_channel = NULL;
                        return -ENODEV;
                }
        } else {
@@ -2226,7 +2185,7 @@ visorchipset_init(void)
        }
 
        MajorDev = MKDEV(visorchipset_major, 0);
-       rc = visorchipset_file_init(MajorDev, &ControlVm_channel);
+       rc = visorchipset_file_init(MajorDev, &controlvm_channel);
        if (rc < 0) {
                POSTCODE_LINUX_2(CHIPSET_INIT_FAILURE_PC, DIAG_SEVERITY_ERR);
                goto Away;
@@ -2258,7 +2217,7 @@ visorchipset_init(void)
                periodic_controlvm_workqueue =
                    create_singlethread_workqueue("visorchipset_controlvm");
 
-               if (periodic_controlvm_workqueue == NULL) {
+               if (!periodic_controlvm_workqueue) {
                        POSTCODE_LINUX_2(CREATE_WORKQUEUE_FAILED_PC,
                                         DIAG_SEVERITY_ERR);
                        rc = -ENOMEM;
@@ -2273,7 +2232,6 @@ visorchipset_init(void)
                                         DIAG_SEVERITY_ERR);
                        goto Away;
                }
-
        }
 
        Visorchipset_platform_device.dev.devt = MajorDev;
@@ -2304,9 +2262,8 @@ visorchipset_exit(void)
                flush_workqueue(periodic_controlvm_workqueue);
                destroy_workqueue(periodic_controlvm_workqueue);
                periodic_controlvm_workqueue = NULL;
-               destroy_controlvm_payload_info(&ControlVm_payload_info);
+               destroy_controlvm_payload_info(&controlvm_payload_info);
        }
-       Test_Vnic_channel = NULL;
        if (Putfile_buffer_list_pool) {
                kmem_cache_destroy(Putfile_buffer_list_pool);
                Putfile_buffer_list_pool = NULL;
@@ -2320,7 +2277,7 @@ visorchipset_exit(void)
 
        memset(&g_del_dump_msg_hdr, 0, sizeof(struct controlvm_message_header));
 
-       visorchannel_destroy(ControlVm_channel);
+       visorchannel_destroy(controlvm_channel);
 
        visorchipset_file_cleanup();
        POSTCODE_LINUX_2(DRIVER_EXIT_PC, POSTCODE_SEVERITY_INFO);