From: Jeffrey <Jeffrey.Brown@xxxxxxxxxx> Fixed all alignment issues in visorchipset_main.c, kept the 80 character warnings in mind when doing so, and if there are any warnings coming from this patch it is most likely that there was an 80 character warning at the line before I fixed the alignment Signed-off-by: Jeffrey Brown <Jeffrey.Brown@xxxxxxxxxx> --- .../unisys/visorchipset/visorchipset_main.c | 166 +++++++++++---------- 1 file changed, 89 insertions(+), 77 deletions(-) diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c index 003b6f3..73cd0a3 100644 --- a/drivers/staging/unisys/visorchipset/visorchipset_main.c +++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c @@ -253,45 +253,52 @@ static dev_t MajorDev = -1; /**< indicates major num for device */ /* prototypes for attributes */ static ssize_t toolaction_show(struct device *dev, - struct device_attribute *attr, char *buf); + struct device_attribute *attr, + char *buf); static ssize_t toolaction_store(struct device *dev, - struct device_attribute *attr, const char *buf, size_t count); + struct device_attribute *attr, + const char *buf, size_t count); static DEVICE_ATTR_RW(toolaction); static ssize_t boottotool_show(struct device *dev, - struct device_attribute *attr, char *buf); + struct device_attribute *attr, char *buf); static ssize_t boottotool_store(struct device *dev, - struct device_attribute *attr, const char *buf, size_t count); + struct device_attribute *attr, + const char *buf, size_t count); static DEVICE_ATTR_RW(boottotool); static ssize_t error_show(struct device *dev, struct device_attribute *attr, - char *buf); + char *buf); static ssize_t error_store(struct device *dev, struct device_attribute *attr, - const char *buf, size_t count); + const char *buf, size_t count); static DEVICE_ATTR_RW(error); static ssize_t textid_show(struct device *dev, struct device_attribute *attr, - char *buf); + char *buf); static ssize_t textid_store(struct device *dev, struct device_attribute *attr, - const char *buf, size_t count); + const char *buf, size_t count); static DEVICE_ATTR_RW(textid); static ssize_t remaining_steps_show(struct device *dev, - struct device_attribute *attr, char *buf); + struct device_attribute *attr, char *buf); static ssize_t remaining_steps_store(struct device *dev, - struct device_attribute *attr, const char *buf, size_t count); + struct device_attribute *attr, + const char *buf, size_t count); static DEVICE_ATTR_RW(remaining_steps); static ssize_t chipsetready_store(struct device *dev, - struct device_attribute *attr, const char *buf, size_t count); + struct device_attribute *attr, + const char *buf, size_t count); static DEVICE_ATTR_WO(chipsetready); static ssize_t devicedisabled_store(struct device *dev, - struct device_attribute *attr, const char *buf, size_t count); + struct device_attribute *attr, + const char *buf, size_t count); static DEVICE_ATTR_WO(devicedisabled); static ssize_t deviceenabled_store(struct device *dev, - struct device_attribute *attr, const char *buf, size_t count); + struct device_attribute *attr, + const char *buf, size_t count); static DEVICE_ATTR_WO(deviceenabled); static struct attribute *visorchipset_install_attrs[] = { @@ -360,8 +367,8 @@ static ssize_t toolaction_show(struct device *dev, u8 toolAction; visorchannel_read(ControlVm_channel, - offsetof(struct spar_controlvm_channel_protocol, - tool_action), &toolAction, sizeof(u8)); + offsetof(struct spar_controlvm_channel_protocol, + tool_action), &toolAction, sizeof(u8)); return scnprintf(buf, PAGE_SIZE, "%u\n", toolAction); } @@ -376,8 +383,9 @@ static ssize_t toolaction_store(struct device *dev, return -EINVAL; ret = visorchannel_write(ControlVm_channel, - offsetof(struct spar_controlvm_channel_protocol, tool_action), - &toolAction, sizeof(u8)); + offsetof(struct spar_controlvm_channel_protocol, + tool_action), + &toolAction, sizeof(u8)); if (ret) return ret; @@ -391,9 +399,9 @@ static ssize_t boottotool_show(struct device *dev, struct efi_spar_indication efiSparIndication; visorchannel_read(ControlVm_channel, - offsetof(struct spar_controlvm_channel_protocol, - efi_spar_ind), &efiSparIndication, - sizeof(struct efi_spar_indication)); + offsetof(struct spar_controlvm_channel_protocol, + efi_spar_ind), &efiSparIndication, + sizeof(struct efi_spar_indication)); return scnprintf(buf, PAGE_SIZE, "%u\n", efiSparIndication.boot_to_tool); } @@ -410,10 +418,9 @@ static ssize_t boottotool_store(struct device *dev, efiSparIndication.boot_to_tool = val; ret = visorchannel_write(ControlVm_channel, - offsetof(struct spar_controlvm_channel_protocol, - efi_spar_ind), - &(efiSparIndication), - sizeof(struct efi_spar_indication)); + offsetof(struct spar_controlvm_channel_protocol, + efi_spar_ind), &(efiSparIndication), + sizeof(struct efi_spar_indication)); if (ret) return ret; @@ -421,18 +428,18 @@ static ssize_t boottotool_store(struct device *dev, } static ssize_t error_show(struct device *dev, struct device_attribute *attr, - char *buf) + char *buf) { u32 error; - visorchannel_read(ControlVm_channel, offsetof( - struct spar_controlvm_channel_protocol, installation_error), - &error, sizeof(u32)); + visorchannel_read(ControlVm_channel, + offsetof(struct spar_controlvm_channel_protocol, + installation_error), &error, sizeof(u32)); return scnprintf(buf, PAGE_SIZE, "%i\n", error); } static ssize_t error_store(struct device *dev, struct device_attribute *attr, - const char *buf, size_t count) + const char *buf, size_t count) { u32 error; int ret; @@ -441,16 +448,16 @@ static ssize_t error_store(struct device *dev, struct device_attribute *attr, return -EINVAL; ret = visorchannel_write(ControlVm_channel, - offsetof(struct spar_controlvm_channel_protocol, - installation_error), - &error, sizeof(u32)); + offsetof(struct spar_controlvm_channel_protocol, + installation_error), + &error, sizeof(u32)); if (ret) return ret; return count; } static ssize_t textid_show(struct device *dev, struct device_attribute *attr, - char *buf) + char *buf) { u32 textId; @@ -461,7 +468,7 @@ static ssize_t textid_show(struct device *dev, struct device_attribute *attr, } static ssize_t textid_store(struct device *dev, struct device_attribute *attr, - const char *buf, size_t count) + const char *buf, size_t count) { u32 textId; int ret; @@ -470,9 +477,9 @@ static ssize_t textid_store(struct device *dev, struct device_attribute *attr, return -EINVAL; ret = visorchannel_write(ControlVm_channel, - offsetof(struct spar_controlvm_channel_protocol, - installation_text_id), - &textId, sizeof(u32)); + offsetof(struct spar_controlvm_channel_protocol, + installation_text_id), + &textId, sizeof(u32)); if (ret) return ret; return count; @@ -480,20 +487,20 @@ static ssize_t textid_store(struct device *dev, struct device_attribute *attr, static ssize_t remaining_steps_show(struct device *dev, - struct device_attribute *attr, char *buf) + struct device_attribute *attr, char *buf) { u16 remainingSteps; visorchannel_read(ControlVm_channel, - offsetof(struct spar_controlvm_channel_protocol, - installation_remaining_steps), - &remainingSteps, - sizeof(u16)); + offsetof(struct spar_controlvm_channel_protocol, + installation_remaining_steps), + &remainingSteps, sizeof(u16)); return scnprintf(buf, PAGE_SIZE, "%hu\n", remainingSteps); } static ssize_t remaining_steps_store(struct device *dev, - struct device_attribute *attr, const char *buf, size_t count) + struct device_attribute *attr, + const char *buf, size_t count) { u16 remainingSteps; int ret; @@ -502,9 +509,9 @@ static ssize_t remaining_steps_store(struct device *dev, return -EINVAL; ret = visorchannel_write(ControlVm_channel, - offsetof(struct spar_controlvm_channel_protocol, - installation_remaining_steps), - &remainingSteps, sizeof(u16)); + offsetof(struct spar_controlvm_channel_protocol, + installation_remaining_steps), + &remainingSteps, sizeof(u16)); if (ret) return ret; return count; @@ -607,7 +614,7 @@ visorchipset_register_busdev_server( *responders = BusDev_Responders; if (driver_info) bus_device_info_init(driver_info, "chipset", "visorchipset", - VERSION, NULL); + VERSION, NULL); up(&NotifierLock); } @@ -1070,7 +1077,7 @@ device_epilog(u32 busNo, u32 devNo, struct spar_segment_state state, u32 cmd, if (busNo == g_diagpoolBusNo && devNo == g_diagpoolDevNo) { LOGINF("DEVICE_CHANGESTATE(DiagpoolChannel busNo=%d devNo=%d is pausing...)", - busNo, devNo); + busNo, devNo); /* this will trigger the * diag_shutdown.sh script in * the visorchipset hotplug */ @@ -1170,7 +1177,7 @@ bus_destroy(struct controlvm_message *inmsg) } if (pBusInfo->state.created == 0) { LOGERR("CONTROLVM_BUS_DESTROY Failed: bus %lu already destroyed", - busNo); + busNo); rc = -CONTROLVM_RESP_ERROR_ALREADY_DONE; goto Away; } @@ -1203,7 +1210,7 @@ bus_configure(struct controlvm_message *inmsg, PARSER_CONTEXT *parser_ctx) } if (pBusInfo->state.created == 0) { LOGERR("CONTROLVM_BUS_CONFIGURE Failed: Invalid bus %lu - not created yet", - busNo); + busNo); POSTCODE_LINUX_3(BUS_CONFIGURE_FAILURE_PC, busNo, POSTCODE_SEVERITY_ERR); rc = -CONTROLVM_RESP_ERROR_BUS_INVALID; @@ -1212,7 +1219,7 @@ bus_configure(struct controlvm_message *inmsg, PARSER_CONTEXT *parser_ctx) /* TBD - add this check to other commands also... */ if (pBusInfo->pending_msg_hdr.id != CONTROLVM_INVALID) { LOGERR("CONTROLVM_BUS_CONFIGURE Failed: bus %lu MsgId=%u outstanding", - busNo, (uint) pBusInfo->pending_msg_hdr.id); + busNo, (uint) pBusInfo->pending_msg_hdr.id); POSTCODE_LINUX_3(BUS_CONFIGURE_FAILURE_PC, busNo, POSTCODE_SEVERITY_ERR); rc = -CONTROLVM_RESP_ERROR_MESSAGE_ID_INVALID_FOR_CLIENT; @@ -1244,7 +1251,7 @@ my_device_create(struct controlvm_message *inmsg) pDevInfo = finddevice(&DevInfoList, busNo, devNo); if (pDevInfo && (pDevInfo->state.created == 1)) { LOGERR("CONTROLVM_DEVICE_CREATE Failed: busNo=%lu, devNo=%lu already exists", - busNo, devNo); + busNo, devNo); POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, devNo, busNo, POSTCODE_SEVERITY_ERR); rc = -CONTROLVM_RESP_ERROR_ALREADY_DONE; @@ -1253,7 +1260,7 @@ my_device_create(struct controlvm_message *inmsg) pBusInfo = findbus(&BusInfoList, busNo); if (!pBusInfo) { LOGERR("CONTROLVM_DEVICE_CREATE Failed: Invalid bus %lu - out of range", - busNo); + busNo); POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, devNo, busNo, POSTCODE_SEVERITY_ERR); rc = -CONTROLVM_RESP_ERROR_BUS_INVALID; @@ -1261,7 +1268,7 @@ my_device_create(struct controlvm_message *inmsg) } if (pBusInfo->state.created == 0) { LOGERR("CONTROLVM_DEVICE_CREATE Failed: Invalid bus %lu - not created yet", - busNo); + busNo); POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, devNo, busNo, POSTCODE_SEVERITY_ERR); rc = -CONTROLVM_RESP_ERROR_BUS_INVALID; @@ -1270,7 +1277,7 @@ my_device_create(struct controlvm_message *inmsg) pDevInfo = kzalloc(sizeof(struct visorchipset_device_info), GFP_KERNEL); if (pDevInfo == NULL) { LOGERR("CONTROLVM_DEVICE_CREATE Failed: busNo=%lu, devNo=%lu kmaloc failed", - busNo, devNo); + busNo, devNo); POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, devNo, busNo, POSTCODE_SEVERITY_ERR); rc = -CONTROLVM_RESP_ERROR_KMALLOC_FAILED; @@ -1303,7 +1310,7 @@ Away: g_diagpoolBusNo = busNo; g_diagpoolDevNo = devNo; LOGINF("CONTROLVM_DEVICE_CREATE for DiagPool channel: busNo=%lu, devNo=%lu", - g_diagpoolBusNo, g_diagpoolDevNo); + g_diagpoolBusNo, g_diagpoolDevNo); } device_epilog(busNo, devNo, segment_state_running, CONTROLVM_DEVICE_CREATE, &inmsg->hdr, rc, @@ -1324,7 +1331,7 @@ my_device_changestate(struct controlvm_message *inmsg) pDevInfo = finddevice(&DevInfoList, busNo, devNo); if (!pDevInfo) { LOGERR("CONTROLVM_DEVICE_CHANGESTATE Failed: busNo=%lu, devNo=%lu invalid (doesn't exist)", - busNo, devNo); + busNo, devNo); POSTCODE_LINUX_4(DEVICE_CHANGESTATE_FAILURE_PC, devNo, busNo, POSTCODE_SEVERITY_ERR); rc = -CONTROLVM_RESP_ERROR_DEVICE_INVALID; @@ -1332,7 +1339,7 @@ my_device_changestate(struct controlvm_message *inmsg) } if (pDevInfo->state.created == 0) { LOGERR("CONTROLVM_DEVICE_CHANGESTATE Failed: busNo=%lu, devNo=%lu invalid (not created)", - busNo, devNo); + busNo, devNo); POSTCODE_LINUX_4(DEVICE_CHANGESTATE_FAILURE_PC, devNo, busNo, POSTCODE_SEVERITY_ERR); rc = -CONTROLVM_RESP_ERROR_DEVICE_INVALID; @@ -1358,13 +1365,13 @@ my_device_destroy(struct controlvm_message *inmsg) pDevInfo = finddevice(&DevInfoList, busNo, devNo); if (!pDevInfo) { LOGERR("CONTROLVM_DEVICE_DESTROY Failed: busNo=%lu, devNo=%lu invalid", - busNo, devNo); + busNo, devNo); rc = -CONTROLVM_RESP_ERROR_DEVICE_INVALID; goto Away; } if (pDevInfo->state.created == 0) { LOGERR("CONTROLVM_DEVICE_DESTROY Failed: busNo=%lu, devNo=%lu already destroyed", - busNo, devNo); + busNo, devNo); rc = -CONTROLVM_RESP_ERROR_ALREADY_DONE; } @@ -1392,21 +1399,21 @@ initialize_controlvm_payload_info(HOSTADDRESS phys_addr, u64 offset, u32 bytes, if (info == NULL) { LOGERR("HUH ? CONTROLVM_PAYLOAD_INIT Failed : Programmer check at %s:%d", - __FILE__, __LINE__); + __FILE__, __LINE__); rc = -CONTROLVM_RESP_ERROR_PAYLOAD_INVALID; goto Away; } memset(info, 0, sizeof(CONTROLVM_PAYLOAD_INFO)); if ((offset == 0) || (bytes == 0)) { LOGERR("CONTROLVM_PAYLOAD_INIT Failed: request_payload_offset=%llu request_payload_bytes=%llu!", - (u64)offset, (u64)bytes); + (u64)offset, (u64)bytes); rc = -CONTROLVM_RESP_ERROR_PAYLOAD_INVALID; goto Away; } payload = ioremap_cache(phys_addr + offset, bytes); if (payload == NULL) { LOGERR("CONTROLVM_PAYLOAD_INIT Failed: ioremap_cache %llu for %llu bytes failed", - (u64)offset, (u64)bytes); + (u64)offset, (u64)bytes); rc = -CONTROLVM_RESP_ERROR_IOREMAP_FAILED; goto Away; } @@ -1756,8 +1763,10 @@ parahotplug_process_message(struct controlvm_message *inmsg) */ parahotplug_request_kickoff(req); controlvm_respond_physdev_changestate(&inmsg->hdr, - CONTROLVM_RESP_SUCCESS, inmsg->cmd. - device_change_state.state); + CONTROLVM_RESP_SUCCESS, + inmsg->cmd. + device_change_state. + state); parahotplug_request_destroy(req); } else { /* For disable messages, add the request to the @@ -1865,15 +1874,15 @@ handle_command(struct controlvm_message inmsg, HOSTADDRESS channel_addr) case CONTROLVM_DEVICE_CHANGESTATE: if (cmd->device_change_state.flags.phys_device) { LOGINF("DEVICE_CHANGESTATE for physical device (%lu,%lu, active=%lu)", - (ulong)cmd->device_change_state.bus_no, - (ulong)cmd->device_change_state.dev_no, - (ulong)cmd->device_change_state.state.active); + (ulong)cmd->device_change_state.bus_no, + (ulong)cmd->device_change_state.dev_no, + (ulong)cmd->device_change_state.state.active); parahotplug_process_message(&inmsg); } else { LOGINF("DEVICE_CHANGESTATE for virtual device (%lu,%lu, state.Alive=0x%lx)", - (ulong)cmd->device_change_state.bus_no, - (ulong)cmd->device_change_state.dev_no, - (ulong)cmd->device_change_state.state.alive); + (ulong)cmd->device_change_state.bus_no, + (ulong)cmd->device_change_state.dev_no, + (ulong)cmd->device_change_state.state.alive); /* save the hdr and cmd structures for later use */ /* when sending back the response to Command */ my_device_changestate(&inmsg); @@ -1982,9 +1991,9 @@ controlvm_periodic_work(struct work_struct *work) &inmsg)) { if (inmsg.hdr.payload_max_bytes != 0) { LOGERR("Payload of size %lu returned @%lu with unexpected message id %d.", - (ulong)inmsg.hdr.payload_max_bytes, - (ulong)inmsg.hdr.payload_vm_offset, - inmsg.hdr.id); + (ulong)inmsg.hdr.payload_max_bytes, + (ulong)inmsg.hdr.payload_vm_offset, + inmsg.hdr.id); } } if (!gotACommand) { @@ -2304,7 +2313,8 @@ visorchipset_cache_free(struct kmem_cache *pool, void *p, char *fn, int ln) } static ssize_t chipsetready_store(struct device *dev, - struct device_attribute *attr, const char *buf, size_t count) + struct device_attribute *attr, + const char *buf, size_t count) { char msgtype[64]; @@ -2326,7 +2336,8 @@ static ssize_t chipsetready_store(struct device *dev, * and then passed back when the device has been removed. */ static ssize_t devicedisabled_store(struct device *dev, - struct device_attribute *attr, const char *buf, size_t count) + struct device_attribute *attr, + const char *buf, size_t count) { uint id; @@ -2342,7 +2353,8 @@ static ssize_t devicedisabled_store(struct device *dev, * and then passed back when the device has been brought back up. */ static ssize_t deviceenabled_store(struct device *dev, - struct device_attribute *attr, const char *buf, size_t count) + struct device_attribute *attr, + const char *buf, size_t count) { uint id; -- 1.8.4 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel