staging: unisys: fix CamelCase params in responder functions
[firefly-linux-kernel-4.4.55.git] / drivers / staging / unisys / visorchipset / visorchipset_main.c
index 381d3050b048db55c4d8ed1843f0cb85c089b068..700b35ed08cda30e2a8a7d24a9432fc1a1bb45e8 100644 (file)
@@ -75,17 +75,17 @@ static struct controlvm_message_header g_del_dump_msg_hdr;
 static const uuid_le spar_diag_pool_channel_protocol_uuid =
        SPAR_DIAG_POOL_CHANNEL_PROTOCOL_UUID;
 /* 0xffffff is an invalid Bus/Device number */
-static ulong g_diagpoolBusNo = 0xffffff;
-static ulong g_diagpoolDevNo = 0xffffff;
-static struct controlvm_message_packet g_DeviceChangeStatePacket;
+static ulong g_diagpool_bus_no = 0xffffff;
+static ulong g_diagpool_dev_no = 0xffffff;
+static struct controlvm_message_packet g_devicechangestate_packet;
 
 /* Only VNIC and VHBA channels are sent to visorclientbus (aka
  * "visorhackbus")
  */
 #define FOR_VISORHACKBUS(channel_type_guid) \
        (((uuid_le_cmp(channel_type_guid,\
-                      spar_vnic_channel_protocol_uuid) == 0)\
-       || (uuid_le_cmp(channel_type_guid,\
+                      spar_vnic_channel_protocol_uuid) == 0) ||\
+       (uuid_le_cmp(channel_type_guid,\
                        spar_vhba_channel_protocol_uuid) == 0)))
 #define FOR_VISORBUS(channel_type_guid) (!(FOR_VISORHACKBUS(channel_type_guid)))
 
@@ -93,37 +93,32 @@ static struct controlvm_message_packet g_DeviceChangeStatePacket;
        (uuid_le_cmp(channel_type_guid,\
                     spar_diag_pool_channel_protocol_uuid) == 0)
 
-static LIST_HEAD(BusInfoList);
-static LIST_HEAD(DevInfoList);
+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;
+} controlvm_payload_info;
 
-static struct channel_header *Test_Vnic_channel;
-
-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 */
@@ -637,14 +598,14 @@ cleanup_controlvm_structures(void)
        struct visorchipset_bus_info *bi, *tmp_bi;
        struct visorchipset_device_info *di, *tmp_di;
 
-       list_for_each_entry_safe(bi, tmp_bi, &BusInfoList, entry) {
-               busInfo_clear(bi);
+       list_for_each_entry_safe(bi, tmp_bi, &bus_info_list, entry) {
+               bus_info_clear(bi);
                list_del(&bi->entry);
                kfree(bi);
        }
 
-       list_for_each_entry_safe(di, tmp_di, &DevInfoList, entry) {
-               devInfo_clear(di);
+       list_for_each_entry_safe(di, tmp_di, &dev_info_list, entry) {
+               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)
@@ -705,16 +666,16 @@ controlvm_respond(struct controlvm_message_header *msgHdr, int response)
        controlvm_init_response(&outmsg, msgHdr, response);
        /* For DiagPool channel DEVICE_CHANGESTATE, we need to send
        * back the deviceChangeState structure in the packet. */
-       if (msgHdr->id == CONTROLVM_DEVICE_CHANGESTATE
-           && g_DeviceChangeStatePacket.device_change_state.bus_no ==
-           g_diagpoolBusNo
-           && g_DeviceChangeStatePacket.device_change_state.dev_no ==
-           g_diagpoolDevNo)
-               outmsg.cmd = g_DeviceChangeStatePacket;
+       if (msgHdr->id == CONTROLVM_DEVICE_CHANGESTATE &&
+           g_devicechangestate_packet.device_change_state.bus_no ==
+           g_diagpool_bus_no &&
+           g_devicechangestate_packet.device_change_state.dev_no ==
+           g_diagpool_dev_no)
+               outmsg.cmd = g_devicechangestate_packet;
        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(&BusInfoList, 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(&DevInfoList, 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(&DevInfoList, 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(&DevInfoList, 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(&DevInfoList, 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
@@ -905,7 +866,7 @@ bus_epilog(u32 busNo,
 {
        BOOL notified = FALSE;
 
-       struct visorchipset_bus_info *pBusInfo = findbus(&BusInfoList, busNo);
+       struct visorchipset_bus_info *pBusInfo = findbus(&bus_info_list, busNo);
 
        if (!pBusInfo)
                return;
@@ -973,7 +934,7 @@ device_epilog(u32 busNo, u32 devNo, struct spar_segment_state state, u32 cmd,
        BOOL notified = FALSE;
 
        struct visorchipset_device_info *pDevInfo =
-               finddevice(&DevInfoList, busNo, devNo);
+               finddevice(&dev_info_list, busNo, devNo);
        char *envp[] = {
                "SPARSP_DIAGPOOL_PAUSED_STATE = 1",
                NULL
@@ -1030,8 +991,8 @@ device_epilog(u32 busNo, u32 devNo, struct spar_segment_state state, u32 cmd,
                                /* this is lite pause where channel is
                                 * still valid just 'pause' of it
                                 */
-                               if (busNo == g_diagpoolBusNo
-                                   && devNo == g_diagpoolDevNo) {
+                               if (busNo == g_diagpool_bus_no &&
+                                   devNo == g_diagpool_dev_no) {
                                        /* this will trigger the
                                         * diag_shutdown.sh script in
                                         * the visorchipset hotplug */
@@ -1069,7 +1030,7 @@ bus_create(struct controlvm_message *inmsg)
        struct visorchipset_bus_info *pBusInfo = NULL;
 
 
-       pBusInfo = findbus(&BusInfoList, busNo);
+       pBusInfo = findbus(&bus_info_list, busNo);
        if (pBusInfo && (pBusInfo->state.created == 1)) {
                POSTCODE_LINUX_3(BUS_CREATE_FAILURE_PC, busNo,
                                 POSTCODE_SEVERITY_ERR);
@@ -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;
@@ -1102,7 +1063,7 @@ bus_create(struct controlvm_message *inmsg)
                        cmd->create_bus.bus_data_type_uuid;
        pBusInfo->chan_info.channel_inst_uuid = cmd->create_bus.bus_inst_uuid;
 
-       list_add(&pBusInfo->entry, &BusInfoList);
+       list_add(&pBusInfo->entry, &bus_info_list);
 
        POSTCODE_LINUX_3(BUS_CREATE_EXIT_PC, busNo, POSTCODE_SEVERITY_INFO);
 
@@ -1119,7 +1080,7 @@ bus_destroy(struct controlvm_message *inmsg)
        struct visorchipset_bus_info *pBusInfo;
        int rc = CONTROLVM_RESP_SUCCESS;
 
-       pBusInfo = findbus(&BusInfoList, busNo);
+       pBusInfo = findbus(&bus_info_list, busNo);
        if (!pBusInfo) {
                rc = -CONTROLVM_RESP_ERROR_BUS_INVALID;
                goto Away;
@@ -1147,7 +1108,7 @@ bus_configure(struct controlvm_message *inmsg,
        busNo = cmd->configure_bus.bus_no;
        POSTCODE_LINUX_3(BUS_CONFIGURE_ENTRY_PC, busNo, POSTCODE_SEVERITY_INFO);
 
-       pBusInfo = findbus(&BusInfoList, busNo);
+       pBusInfo = findbus(&bus_info_list, busNo);
        if (!pBusInfo) {
                POSTCODE_LINUX_3(BUS_CONFIGURE_FAILURE_PC, busNo,
                                 POSTCODE_SEVERITY_ERR);
@@ -1190,14 +1151,14 @@ my_device_create(struct controlvm_message *inmsg)
        struct visorchipset_bus_info *pBusInfo = NULL;
        int rc = CONTROLVM_RESP_SUCCESS;
 
-       pDevInfo = finddevice(&DevInfoList, busNo, devNo);
+       pDevInfo = finddevice(&dev_info_list, busNo, devNo);
        if (pDevInfo && (pDevInfo->state.created == 1)) {
                POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, devNo, busNo,
                                 POSTCODE_SEVERITY_ERR);
                rc = -CONTROLVM_RESP_ERROR_ALREADY_DONE;
                goto Away;
        }
-       pBusInfo = findbus(&BusInfoList, busNo);
+       pBusInfo = findbus(&bus_info_list, busNo);
        if (!pBusInfo) {
                POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, devNo, busNo,
                                 POSTCODE_SEVERITY_ERR);
@@ -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;
@@ -1234,15 +1195,15 @@ my_device_create(struct controlvm_message *inmsg)
        pDevInfo->chan_info.channel_type_uuid =
                        cmd->create_device.data_type_uuid;
        pDevInfo->chan_info.intr = cmd->create_device.intr;
-       list_add(&pDevInfo->entry, &DevInfoList);
+       list_add(&pDevInfo->entry, &dev_info_list);
        POSTCODE_LINUX_4(DEVICE_CREATE_EXIT_PC, devNo, busNo,
                         POSTCODE_SEVERITY_INFO);
 Away:
        /* get the bus and devNo for DiagPool channel */
        if (pDevInfo &&
            is_diagpool_channel(pDevInfo->chan_info.channel_type_uuid)) {
-               g_diagpoolBusNo = busNo;
-               g_diagpoolDevNo = devNo;
+               g_diagpool_bus_no = busNo;
+               g_diagpool_dev_no = devNo;
        }
        device_epilog(busNo, devNo, segment_state_running,
                      CONTROLVM_DEVICE_CREATE, &inmsg->hdr, rc,
@@ -1260,7 +1221,7 @@ my_device_changestate(struct controlvm_message *inmsg)
        struct visorchipset_device_info *pDevInfo = NULL;
        int rc = CONTROLVM_RESP_SUCCESS;
 
-       pDevInfo = finddevice(&DevInfoList, busNo, devNo);
+       pDevInfo = finddevice(&dev_info_list, busNo, devNo);
        if (!pDevInfo) {
                POSTCODE_LINUX_4(DEVICE_CHANGESTATE_FAILURE_PC, devNo, busNo,
                                 POSTCODE_SEVERITY_ERR);
@@ -1290,7 +1251,7 @@ my_device_destroy(struct controlvm_message *inmsg)
        struct visorchipset_device_info *pDevInfo = NULL;
        int rc = CONTROLVM_RESP_SUCCESS;
 
-       pDevInfo = finddevice(&DevInfoList, busNo, devNo);
+       pDevInfo = finddevice(&dev_info_list, busNo, devNo);
        if (!pDevInfo) {
                rc = -CONTROLVM_RESP_ERROR_DEVICE_INVALID;
                goto Away;
@@ -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);
        }
@@ -1756,7 +1717,7 @@ handle_command(struct controlvm_message inmsg, HOSTADDRESS channel_addr)
                        /* when sending back the response to Command */
                        my_device_changestate(&inmsg);
                        g_diag_msg_hdr = inmsg.hdr;
-                       g_DeviceChangeStatePacket = inmsg.cmd;
+                       g_devicechangestate_packet = inmsg.cmd;
                        break;
                }
                break;
@@ -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;
        }
@@ -1828,8 +1789,8 @@ controlvm_periodic_work(struct work_struct *work)
        /* Check events to determine if response to CHIPSET_READY
         * should be sent
         */
-       if (visorchipset_holdchipsetready
-           && (g_chipset_msg_hdr.id != CONTROLVM_INVALID)) {
+       if (visorchipset_holdchipsetready &&
+           (g_chipset_msg_hdr.id != CONTROLVM_INVALID)) {
                if (check_chipset_events() == 1) {
                        controlvm_respond(&g_chipset_msg_hdr, 0);
                        clear_chipset_events();
@@ -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);
@@ -2047,7 +2006,7 @@ device_resume_response(ulong busNo, ulong devNo, int response)
 BOOL
 visorchipset_get_bus_info(ulong bus_no, struct visorchipset_bus_info *bus_info)
 {
-       void *p = findbus(&BusInfoList, bus_no);
+       void *p = findbus(&bus_info_list, bus_no);
 
        if (!p)
                return FALSE;
@@ -2059,7 +2018,7 @@ EXPORT_SYMBOL_GPL(visorchipset_get_bus_info);
 BOOL
 visorchipset_set_bus_context(ulong bus_no, void *context)
 {
-       struct visorchipset_bus_info *p = findbus(&BusInfoList, bus_no);
+       struct visorchipset_bus_info *p = findbus(&bus_info_list, bus_no);
 
        if (!p)
                return FALSE;
@@ -2072,7 +2031,7 @@ BOOL
 visorchipset_get_device_info(ulong bus_no, ulong dev_no,
                             struct visorchipset_device_info *dev_info)
 {
-       void *p = finddevice(&DevInfoList, bus_no, dev_no);
+       void *p = finddevice(&dev_info_list, bus_no, dev_no);
 
        if (!p)
                return FALSE;
@@ -2085,7 +2044,7 @@ BOOL
 visorchipset_set_device_context(ulong bus_no, ulong dev_no, void *context)
 {
        struct visorchipset_device_info *p =
-                       finddevice(&DevInfoList, bus_no, dev_no);
+                       finddevice(&dev_info_list, bus_no, dev_no);
 
        if (!p)
                return FALSE;
@@ -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);