diff --git a/drivers/staging/unisys/visorbus/controlvmchannel.h b/drivers/staging/unisys/visorbus/controlvmchannel.h index f0bfc4ded892..10dfac448035 100644 --- a/drivers/staging/unisys/visorbus/controlvmchannel.h +++ b/drivers/staging/unisys/visorbus/controlvmchannel.h @@ -484,56 +484,55 @@ struct spar_controlvm_parameters_header { /* General Errors------------------------------------------------------[0-99] */ #define CONTROLVM_RESP_SUCCESS 0 -#define CONTROLVM_RESP_ERROR_ALREADY_DONE 1 -#define CONTROLVM_RESP_ERROR_IOREMAP_FAILED 2 -#define CONTROLVM_RESP_ERROR_KMALLOC_FAILED 3 -#define CONTROLVM_RESP_ERROR_MESSAGE_ID_UNKNOWN 4 -#define CONTROLVM_RESP_ERROR_MESSAGE_ID_INVALID_FOR_CLIENT 5 +#define CONTROLVM_RESP_ALREADY_DONE 1 +#define CONTROLVM_RESP_IOREMAP_FAILED 2 +#define CONTROLVM_RESP_KMALLOC_FAILED 3 +#define CONTROLVM_RESP_ID_UNKNOWN 4 +#define CONTROLVM_RESP_ID_INVALID_FOR_CLIENT 5 /* CONTROLVM_INIT_CHIPSET-------------------------------------------[100-199] */ -#define CONTROLVM_RESP_ERROR_CLIENT_SWITCHCOUNT_NONZERO 100 -#define CONTROLVM_RESP_ERROR_EXPECTED_CHIPSET_INIT 101 +#define CONTROLVM_RESP_CLIENT_SWITCHCOUNT_NONZERO 100 +#define CONTROLVM_RESP_EXPECTED_CHIPSET_INIT 101 /* Maximum Limit----------------------------------------------------[200-299] */ #define CONTROLVM_RESP_ERROR_MAX_BUSES 201 /* BUS_CREATE */ #define CONTROLVM_RESP_ERROR_MAX_DEVICES 202 /* DEVICE_CREATE */ /* Payload and Parameter Related------------------------------------[400-499] */ -#define CONTROLVM_RESP_ERROR_PAYLOAD_INVALID 400 /* SWITCH_ATTACHEXTPORT, +#define CONTROLVM_RESP_PAYLOAD_INVALID 400 /* SWITCH_ATTACHEXTPORT, * DEVICE_CONFIGURE */ -#define CONTROLVM_RESP_ERROR_INITIATOR_PARAMETER_INVALID 401 /* Multiple */ -#define CONTROLVM_RESP_ERROR_TARGET_PARAMETER_INVALID 402 /* DEVICE_CONFIGURE */ -#define CONTROLVM_RESP_ERROR_CLIENT_PARAMETER_INVALID 403 /* DEVICE_CONFIGURE */ +#define CONTROLVM_RESP_INITIATOR_PARAMETER_INVALID 401 /* Multiple */ +#define CONTROLVM_RESP_TARGET_PARAMETER_INVALID 402 /* DEVICE_CONFIGURE */ +#define CONTROLVM_RESP_CLIENT_PARAMETER_INVALID 403 /* DEVICE_CONFIGURE */ /* Specified[Packet Structure] Value-------------------------------[500-599] */ -#define CONTROLVM_RESP_ERROR_BUS_INVALID 500 /* SWITCH_ATTACHINTPORT, +#define CONTROLVM_RESP_BUS_INVALID 500 /* SWITCH_ATTACHINTPORT, * BUS_CONFIGURE, * DEVICE_CREATE, * DEVICE_CONFIG * DEVICE_DESTROY */ -#define CONTROLVM_RESP_ERROR_DEVICE_INVALID 501 /* SWITCH_ATTACHINTPORT */ +#define CONTROLVM_RESP_DEVICE_INVALID 501 /* SWITCH_ATTACHINTPORT */ /* DEVICE_CREATE, * DEVICE_CONFIGURE, * DEVICE_DESTROY */ -#define CONTROLVM_RESP_ERROR_CHANNEL_INVALID 502 /* DEVICE_CREATE, +#define CONTROLVM_RESP_CHANNEL_INVALID 502 /* DEVICE_CREATE, * DEVICE_CONFIGURE */ /* Partition Driver Callback Interface----------------------[600-699] */ -#define CONTROLVM_RESP_ERROR_VIRTPCI_DRIVER_FAILURE 604 /* BUS_CREATE, - * BUS_DESTROY, - * DEVICE_CREATE, - * DEVICE_DESTROY - */ +#define CONTROLVM_RESP_VIRTPCI_DRIVER_FAILURE 604 /* BUS_CREATE, + * BUS_DESTROY, + * DEVICE_CREATE, + * DEVICE_DESTROY + */ /* Unable to invoke VIRTPCI callback */ -#define CONTROLVM_RESP_ERROR_VIRTPCI_DRIVER_CALLBACK_ERROR 605 - /* BUS_CREATE, - * BUS_DESTROY, - * DEVICE_CREATE, - * DEVICE_DESTROY - */ +#define CONTROLVM_RESP_VIRTPCI_DRIVER_CALLBACK_ERROR 605 /* BUS_CREATE, + * BUS_DESTROY, + * DEVICE_CREATE, + * DEVICE_DESTROY + */ /* VIRTPCI Callback returned error */ -#define CONTROLVM_RESP_ERROR_GENERIC_DRIVER_CALLBACK_ERROR 606 +#define CONTROLVM_RESP_GENERIC_DRIVER_CALLBACK_ERROR 606 /* SWITCH_ATTACHEXTPORT, * SWITCH_DETACHEXTPORT * DEVICE_CONFIGURE @@ -543,19 +542,19 @@ struct spar_controlvm_parameters_header { /* Bus Related------------------------------------------------------[700-799] */ #define CONTROLVM_RESP_ERROR_BUS_DEVICE_ATTACHED 700 /* BUS_DESTROY */ /* Channel Related--------------------------------------------------[800-899] */ -#define CONTROLVM_RESP_ERROR_CHANNEL_TYPE_UNKNOWN 800 /* GET_CHANNELINFO, +#define CONTROLVM_RESP_CHANNEL_TYPE_UNKNOWN 800 /* GET_CHANNELINFO, * DEVICE_DESTROY */ -#define CONTROLVM_RESP_ERROR_CHANNEL_SIZE_TOO_SMALL 801 /* DEVICE_CREATE */ +#define CONTROLVM_RESP_CHANNEL_SIZE_TOO_SMALL 801 /* DEVICE_CREATE */ /* Chipset Shutdown Related---------------------------------------[1000-1099] */ -#define CONTROLVM_RESP_ERROR_CHIPSET_SHUTDOWN_FAILED 1000 -#define CONTROLVM_RESP_ERROR_CHIPSET_SHUTDOWN_ALREADY_ACTIVE 1001 +#define CONTROLVM_RESP_CHIPSET_SHUTDOWN_FAILED 1000 +#define CONTROLVM_RESP_CHIPSET_SHUTDOWN_ALREADY_ACTIVE 1001 /* Chipset Stop Related-------------------------------------------[1100-1199] */ -#define CONTROLVM_RESP_ERROR_CHIPSET_STOP_FAILED_BUS 1100 -#define CONTROLVM_RESP_ERROR_CHIPSET_STOP_FAILED_SWITCH 1101 +#define CONTROLVM_RESP_CHIPSET_STOP_FAILED_BUS 1100 +#define CONTROLVM_RESP_CHIPSET_STOP_FAILED_SWITCH 1101 /* Device Related-------------------------------------------------[1400-1499] */ -#define CONTROLVM_RESP_ERROR_DEVICE_UDEV_TIMEOUT 1400 +#define CONTROLVM_RESP_DEVICE_UDEV_TIMEOUT 1400 #endif /* __CONTROLVMCHANNEL_H__ */ diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index d7148c351d3f..2dd8930e1d81 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -521,7 +521,7 @@ chipset_init(struct controlvm_message *inmsg) POSTCODE_LINUX(CHIPSET_INIT_ENTRY_PC, 0, 0, DIAG_SEVERITY_PRINT); if (chipset_inited) { - rc = -CONTROLVM_RESP_ERROR_ALREADY_DONE; + rc = -CONTROLVM_RESP_ALREADY_DONE; res = -EIO; goto out_respond; } @@ -890,14 +890,14 @@ my_device_create(struct controlvm_message *inmsg) if (!bus_info) { POSTCODE_LINUX(DEVICE_CREATE_FAILURE_PC, dev_no, bus_no, DIAG_SEVERITY_ERR); - rc = -CONTROLVM_RESP_ERROR_BUS_INVALID; + rc = -CONTROLVM_RESP_BUS_INVALID; goto out_respond; } if (bus_info->state.created == 0) { POSTCODE_LINUX(DEVICE_CREATE_FAILURE_PC, dev_no, bus_no, DIAG_SEVERITY_ERR); - rc = -CONTROLVM_RESP_ERROR_BUS_INVALID; + rc = -CONTROLVM_RESP_BUS_INVALID; goto out_respond; } @@ -905,7 +905,7 @@ my_device_create(struct controlvm_message *inmsg) if (dev_info && (dev_info->state.created == 1)) { POSTCODE_LINUX(DEVICE_CREATE_FAILURE_PC, dev_no, bus_no, DIAG_SEVERITY_ERR); - rc = -CONTROLVM_RESP_ERROR_ALREADY_DONE; + rc = -CONTROLVM_RESP_ALREADY_DONE; goto out_respond; } @@ -913,7 +913,7 @@ my_device_create(struct controlvm_message *inmsg) if (!dev_info) { POSTCODE_LINUX(DEVICE_CREATE_FAILURE_PC, dev_no, bus_no, DIAG_SEVERITY_ERR); - rc = -CONTROLVM_RESP_ERROR_KMALLOC_FAILED; + rc = -CONTROLVM_RESP_KMALLOC_FAILED; goto out_respond; } @@ -936,7 +936,7 @@ my_device_create(struct controlvm_message *inmsg) if (!visorchannel) { POSTCODE_LINUX(DEVICE_CREATE_FAILURE_PC, dev_no, bus_no, DIAG_SEVERITY_ERR); - rc = -CONTROLVM_RESP_ERROR_KMALLOC_FAILED; + rc = -CONTROLVM_RESP_KMALLOC_FAILED; goto out_free_dev_info; } dev_info->visorchannel = visorchannel; @@ -948,7 +948,7 @@ my_device_create(struct controlvm_message *inmsg) if (inmsg->hdr.flags.response_expected == 1) { pmsg_hdr = kzalloc(sizeof(*pmsg_hdr), GFP_KERNEL); if (!pmsg_hdr) { - rc = -CONTROLVM_RESP_ERROR_KMALLOC_FAILED; + rc = -CONTROLVM_RESP_KMALLOC_FAILED; goto out_free_dev_info; } @@ -985,24 +985,24 @@ my_device_changestate(struct controlvm_message *inmsg) if (!dev_info) { POSTCODE_LINUX(DEVICE_CHANGESTATE_FAILURE_PC, dev_no, bus_no, DIAG_SEVERITY_ERR); - rc = -CONTROLVM_RESP_ERROR_DEVICE_INVALID; + rc = -CONTROLVM_RESP_DEVICE_INVALID; goto err_respond; } if (dev_info->state.created == 0) { POSTCODE_LINUX(DEVICE_CHANGESTATE_FAILURE_PC, dev_no, bus_no, DIAG_SEVERITY_ERR); - rc = -CONTROLVM_RESP_ERROR_DEVICE_INVALID; + rc = -CONTROLVM_RESP_DEVICE_INVALID; goto err_respond; } if (dev_info->pending_msg_hdr) { /* only non-NULL if dev is still waiting on a response */ - rc = -CONTROLVM_RESP_ERROR_MESSAGE_ID_INVALID_FOR_CLIENT; + rc = -CONTROLVM_RESP_ID_INVALID_FOR_CLIENT; goto err_respond; } if (inmsg->hdr.flags.response_expected == 1) { pmsg_hdr = kzalloc(sizeof(*pmsg_hdr), GFP_KERNEL); if (!pmsg_hdr) { - rc = -CONTROLVM_RESP_ERROR_KMALLOC_FAILED; + rc = -CONTROLVM_RESP_KMALLOC_FAILED; goto err_respond; } @@ -1043,23 +1043,23 @@ my_device_destroy(struct controlvm_message *inmsg) dev_info = visorbus_get_device_by_id(bus_no, dev_no, NULL); if (!dev_info) { - rc = -CONTROLVM_RESP_ERROR_DEVICE_INVALID; + rc = -CONTROLVM_RESP_DEVICE_INVALID; goto err_respond; } if (dev_info->state.created == 0) { - rc = -CONTROLVM_RESP_ERROR_ALREADY_DONE; + rc = -CONTROLVM_RESP_ALREADY_DONE; goto err_respond; } if (dev_info->pending_msg_hdr) { /* only non-NULL if dev is still waiting on a response */ - rc = -CONTROLVM_RESP_ERROR_MESSAGE_ID_INVALID_FOR_CLIENT; + rc = -CONTROLVM_RESP_ID_INVALID_FOR_CLIENT; goto err_respond; } if (inmsg->hdr.flags.response_expected == 1) { pmsg_hdr = kzalloc(sizeof(*pmsg_hdr), GFP_KERNEL); if (!pmsg_hdr) { - rc = -CONTROLVM_RESP_ERROR_KMALLOC_FAILED; + rc = -CONTROLVM_RESP_KMALLOC_FAILED; goto err_respond; } @@ -1097,14 +1097,14 @@ initialize_controlvm_payload_info(u64 phys_addr, u64 offset, u32 bytes, u8 *payload = NULL; if (!info) - return -CONTROLVM_RESP_ERROR_PAYLOAD_INVALID; + return -CONTROLVM_RESP_PAYLOAD_INVALID; if ((offset == 0) || (bytes == 0)) - return -CONTROLVM_RESP_ERROR_PAYLOAD_INVALID; + return -CONTROLVM_RESP_PAYLOAD_INVALID; payload = memremap(phys_addr + offset, bytes, MEMREMAP_WB); if (!payload) - return -CONTROLVM_RESP_ERROR_IOREMAP_FAILED; + return -CONTROLVM_RESP_IOREMAP_FAILED; memset(info, 0, sizeof(struct visor_controlvm_payload_info)); info->offset = offset; @@ -2001,8 +2001,7 @@ handle_command(struct controlvm_message inmsg, u64 channel_addr) default: if (inmsg.hdr.flags.response_expected) controlvm_respond - (&inmsg.hdr, - -CONTROLVM_RESP_ERROR_MESSAGE_ID_UNKNOWN); + (&inmsg.hdr, -CONTROLVM_RESP_ID_UNKNOWN); break; } @@ -2057,7 +2056,7 @@ parahotplug_process_list(void) if (req->msg.hdr.flags.response_expected) controlvm_respond_physdev_changestate( &req->msg.hdr, - CONTROLVM_RESP_ERROR_DEVICE_UDEV_TIMEOUT, + CONTROLVM_RESP_DEVICE_UDEV_TIMEOUT, req->msg.cmd.device_change_state.state); parahotplug_request_destroy(req); }