staging: unisys: visorbus: shorten error message defines

This patch shortens a few error message defines by removing ERROR
from the define.

Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: David Binder <david.binder@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Sameer Wadgaonkar 2016-12-22 11:08:58 -05:00 committed by Greg Kroah-Hartman
parent e3e0293ca9
commit 98f9ed9ecb
2 changed files with 52 additions and 54 deletions

View File

@ -484,56 +484,55 @@ struct spar_controlvm_parameters_header {
/* General Errors------------------------------------------------------[0-99] */ /* General Errors------------------------------------------------------[0-99] */
#define CONTROLVM_RESP_SUCCESS 0 #define CONTROLVM_RESP_SUCCESS 0
#define CONTROLVM_RESP_ERROR_ALREADY_DONE 1 #define CONTROLVM_RESP_ALREADY_DONE 1
#define CONTROLVM_RESP_ERROR_IOREMAP_FAILED 2 #define CONTROLVM_RESP_IOREMAP_FAILED 2
#define CONTROLVM_RESP_ERROR_KMALLOC_FAILED 3 #define CONTROLVM_RESP_KMALLOC_FAILED 3
#define CONTROLVM_RESP_ERROR_MESSAGE_ID_UNKNOWN 4 #define CONTROLVM_RESP_ID_UNKNOWN 4
#define CONTROLVM_RESP_ERROR_MESSAGE_ID_INVALID_FOR_CLIENT 5 #define CONTROLVM_RESP_ID_INVALID_FOR_CLIENT 5
/* CONTROLVM_INIT_CHIPSET-------------------------------------------[100-199] */ /* CONTROLVM_INIT_CHIPSET-------------------------------------------[100-199] */
#define CONTROLVM_RESP_ERROR_CLIENT_SWITCHCOUNT_NONZERO 100 #define CONTROLVM_RESP_CLIENT_SWITCHCOUNT_NONZERO 100
#define CONTROLVM_RESP_ERROR_EXPECTED_CHIPSET_INIT 101 #define CONTROLVM_RESP_EXPECTED_CHIPSET_INIT 101
/* Maximum Limit----------------------------------------------------[200-299] */ /* Maximum Limit----------------------------------------------------[200-299] */
#define CONTROLVM_RESP_ERROR_MAX_BUSES 201 /* BUS_CREATE */ #define CONTROLVM_RESP_ERROR_MAX_BUSES 201 /* BUS_CREATE */
#define CONTROLVM_RESP_ERROR_MAX_DEVICES 202 /* DEVICE_CREATE */ #define CONTROLVM_RESP_ERROR_MAX_DEVICES 202 /* DEVICE_CREATE */
/* Payload and Parameter Related------------------------------------[400-499] */ /* 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 * DEVICE_CONFIGURE
*/ */
#define CONTROLVM_RESP_ERROR_INITIATOR_PARAMETER_INVALID 401 /* Multiple */ #define CONTROLVM_RESP_INITIATOR_PARAMETER_INVALID 401 /* Multiple */
#define CONTROLVM_RESP_ERROR_TARGET_PARAMETER_INVALID 402 /* DEVICE_CONFIGURE */ #define CONTROLVM_RESP_TARGET_PARAMETER_INVALID 402 /* DEVICE_CONFIGURE */
#define CONTROLVM_RESP_ERROR_CLIENT_PARAMETER_INVALID 403 /* DEVICE_CONFIGURE */ #define CONTROLVM_RESP_CLIENT_PARAMETER_INVALID 403 /* DEVICE_CONFIGURE */
/* Specified[Packet Structure] Value-------------------------------[500-599] */ /* 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, * BUS_CONFIGURE,
* DEVICE_CREATE, * DEVICE_CREATE,
* DEVICE_CONFIG * DEVICE_CONFIG
* DEVICE_DESTROY * DEVICE_DESTROY
*/ */
#define CONTROLVM_RESP_ERROR_DEVICE_INVALID 501 /* SWITCH_ATTACHINTPORT */ #define CONTROLVM_RESP_DEVICE_INVALID 501 /* SWITCH_ATTACHINTPORT */
/* DEVICE_CREATE, /* DEVICE_CREATE,
* DEVICE_CONFIGURE, * DEVICE_CONFIGURE,
* DEVICE_DESTROY * DEVICE_DESTROY
*/ */
#define CONTROLVM_RESP_ERROR_CHANNEL_INVALID 502 /* DEVICE_CREATE, #define CONTROLVM_RESP_CHANNEL_INVALID 502 /* DEVICE_CREATE,
* DEVICE_CONFIGURE * DEVICE_CONFIGURE
*/ */
/* Partition Driver Callback Interface----------------------[600-699] */ /* Partition Driver Callback Interface----------------------[600-699] */
#define CONTROLVM_RESP_ERROR_VIRTPCI_DRIVER_FAILURE 604 /* BUS_CREATE, #define CONTROLVM_RESP_VIRTPCI_DRIVER_FAILURE 604 /* BUS_CREATE,
* BUS_DESTROY, * BUS_DESTROY,
* DEVICE_CREATE, * DEVICE_CREATE,
* DEVICE_DESTROY * DEVICE_DESTROY
*/ */
/* Unable to invoke VIRTPCI callback */ /* Unable to invoke VIRTPCI callback */
#define CONTROLVM_RESP_ERROR_VIRTPCI_DRIVER_CALLBACK_ERROR 605 #define CONTROLVM_RESP_VIRTPCI_DRIVER_CALLBACK_ERROR 605 /* BUS_CREATE,
/* BUS_CREATE, * BUS_DESTROY,
* BUS_DESTROY, * DEVICE_CREATE,
* DEVICE_CREATE, * DEVICE_DESTROY
* DEVICE_DESTROY */
*/
/* VIRTPCI Callback returned error */ /* VIRTPCI Callback returned error */
#define CONTROLVM_RESP_ERROR_GENERIC_DRIVER_CALLBACK_ERROR 606 #define CONTROLVM_RESP_GENERIC_DRIVER_CALLBACK_ERROR 606
/* SWITCH_ATTACHEXTPORT, /* SWITCH_ATTACHEXTPORT,
* SWITCH_DETACHEXTPORT * SWITCH_DETACHEXTPORT
* DEVICE_CONFIGURE * DEVICE_CONFIGURE
@ -543,19 +542,19 @@ struct spar_controlvm_parameters_header {
/* Bus Related------------------------------------------------------[700-799] */ /* Bus Related------------------------------------------------------[700-799] */
#define CONTROLVM_RESP_ERROR_BUS_DEVICE_ATTACHED 700 /* BUS_DESTROY */ #define CONTROLVM_RESP_ERROR_BUS_DEVICE_ATTACHED 700 /* BUS_DESTROY */
/* Channel Related--------------------------------------------------[800-899] */ /* 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 * 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] */ /* Chipset Shutdown Related---------------------------------------[1000-1099] */
#define CONTROLVM_RESP_ERROR_CHIPSET_SHUTDOWN_FAILED 1000 #define CONTROLVM_RESP_CHIPSET_SHUTDOWN_FAILED 1000
#define CONTROLVM_RESP_ERROR_CHIPSET_SHUTDOWN_ALREADY_ACTIVE 1001 #define CONTROLVM_RESP_CHIPSET_SHUTDOWN_ALREADY_ACTIVE 1001
/* Chipset Stop Related-------------------------------------------[1100-1199] */ /* Chipset Stop Related-------------------------------------------[1100-1199] */
#define CONTROLVM_RESP_ERROR_CHIPSET_STOP_FAILED_BUS 1100 #define CONTROLVM_RESP_CHIPSET_STOP_FAILED_BUS 1100
#define CONTROLVM_RESP_ERROR_CHIPSET_STOP_FAILED_SWITCH 1101 #define CONTROLVM_RESP_CHIPSET_STOP_FAILED_SWITCH 1101
/* Device Related-------------------------------------------------[1400-1499] */ /* Device Related-------------------------------------------------[1400-1499] */
#define CONTROLVM_RESP_ERROR_DEVICE_UDEV_TIMEOUT 1400 #define CONTROLVM_RESP_DEVICE_UDEV_TIMEOUT 1400
#endif /* __CONTROLVMCHANNEL_H__ */ #endif /* __CONTROLVMCHANNEL_H__ */

View File

@ -521,7 +521,7 @@ chipset_init(struct controlvm_message *inmsg)
POSTCODE_LINUX(CHIPSET_INIT_ENTRY_PC, 0, 0, DIAG_SEVERITY_PRINT); POSTCODE_LINUX(CHIPSET_INIT_ENTRY_PC, 0, 0, DIAG_SEVERITY_PRINT);
if (chipset_inited) { if (chipset_inited) {
rc = -CONTROLVM_RESP_ERROR_ALREADY_DONE; rc = -CONTROLVM_RESP_ALREADY_DONE;
res = -EIO; res = -EIO;
goto out_respond; goto out_respond;
} }
@ -890,14 +890,14 @@ my_device_create(struct controlvm_message *inmsg)
if (!bus_info) { if (!bus_info) {
POSTCODE_LINUX(DEVICE_CREATE_FAILURE_PC, dev_no, bus_no, POSTCODE_LINUX(DEVICE_CREATE_FAILURE_PC, dev_no, bus_no,
DIAG_SEVERITY_ERR); DIAG_SEVERITY_ERR);
rc = -CONTROLVM_RESP_ERROR_BUS_INVALID; rc = -CONTROLVM_RESP_BUS_INVALID;
goto out_respond; goto out_respond;
} }
if (bus_info->state.created == 0) { if (bus_info->state.created == 0) {
POSTCODE_LINUX(DEVICE_CREATE_FAILURE_PC, dev_no, bus_no, POSTCODE_LINUX(DEVICE_CREATE_FAILURE_PC, dev_no, bus_no,
DIAG_SEVERITY_ERR); DIAG_SEVERITY_ERR);
rc = -CONTROLVM_RESP_ERROR_BUS_INVALID; rc = -CONTROLVM_RESP_BUS_INVALID;
goto out_respond; goto out_respond;
} }
@ -905,7 +905,7 @@ my_device_create(struct controlvm_message *inmsg)
if (dev_info && (dev_info->state.created == 1)) { if (dev_info && (dev_info->state.created == 1)) {
POSTCODE_LINUX(DEVICE_CREATE_FAILURE_PC, dev_no, bus_no, POSTCODE_LINUX(DEVICE_CREATE_FAILURE_PC, dev_no, bus_no,
DIAG_SEVERITY_ERR); DIAG_SEVERITY_ERR);
rc = -CONTROLVM_RESP_ERROR_ALREADY_DONE; rc = -CONTROLVM_RESP_ALREADY_DONE;
goto out_respond; goto out_respond;
} }
@ -913,7 +913,7 @@ my_device_create(struct controlvm_message *inmsg)
if (!dev_info) { if (!dev_info) {
POSTCODE_LINUX(DEVICE_CREATE_FAILURE_PC, dev_no, bus_no, POSTCODE_LINUX(DEVICE_CREATE_FAILURE_PC, dev_no, bus_no,
DIAG_SEVERITY_ERR); DIAG_SEVERITY_ERR);
rc = -CONTROLVM_RESP_ERROR_KMALLOC_FAILED; rc = -CONTROLVM_RESP_KMALLOC_FAILED;
goto out_respond; goto out_respond;
} }
@ -936,7 +936,7 @@ my_device_create(struct controlvm_message *inmsg)
if (!visorchannel) { if (!visorchannel) {
POSTCODE_LINUX(DEVICE_CREATE_FAILURE_PC, dev_no, bus_no, POSTCODE_LINUX(DEVICE_CREATE_FAILURE_PC, dev_no, bus_no,
DIAG_SEVERITY_ERR); DIAG_SEVERITY_ERR);
rc = -CONTROLVM_RESP_ERROR_KMALLOC_FAILED; rc = -CONTROLVM_RESP_KMALLOC_FAILED;
goto out_free_dev_info; goto out_free_dev_info;
} }
dev_info->visorchannel = visorchannel; dev_info->visorchannel = visorchannel;
@ -948,7 +948,7 @@ my_device_create(struct controlvm_message *inmsg)
if (inmsg->hdr.flags.response_expected == 1) { if (inmsg->hdr.flags.response_expected == 1) {
pmsg_hdr = kzalloc(sizeof(*pmsg_hdr), GFP_KERNEL); pmsg_hdr = kzalloc(sizeof(*pmsg_hdr), GFP_KERNEL);
if (!pmsg_hdr) { if (!pmsg_hdr) {
rc = -CONTROLVM_RESP_ERROR_KMALLOC_FAILED; rc = -CONTROLVM_RESP_KMALLOC_FAILED;
goto out_free_dev_info; goto out_free_dev_info;
} }
@ -985,24 +985,24 @@ my_device_changestate(struct controlvm_message *inmsg)
if (!dev_info) { if (!dev_info) {
POSTCODE_LINUX(DEVICE_CHANGESTATE_FAILURE_PC, dev_no, bus_no, POSTCODE_LINUX(DEVICE_CHANGESTATE_FAILURE_PC, dev_no, bus_no,
DIAG_SEVERITY_ERR); DIAG_SEVERITY_ERR);
rc = -CONTROLVM_RESP_ERROR_DEVICE_INVALID; rc = -CONTROLVM_RESP_DEVICE_INVALID;
goto err_respond; goto err_respond;
} }
if (dev_info->state.created == 0) { if (dev_info->state.created == 0) {
POSTCODE_LINUX(DEVICE_CHANGESTATE_FAILURE_PC, dev_no, bus_no, POSTCODE_LINUX(DEVICE_CHANGESTATE_FAILURE_PC, dev_no, bus_no,
DIAG_SEVERITY_ERR); DIAG_SEVERITY_ERR);
rc = -CONTROLVM_RESP_ERROR_DEVICE_INVALID; rc = -CONTROLVM_RESP_DEVICE_INVALID;
goto err_respond; goto err_respond;
} }
if (dev_info->pending_msg_hdr) { if (dev_info->pending_msg_hdr) {
/* only non-NULL if dev is still waiting on a response */ /* 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; goto err_respond;
} }
if (inmsg->hdr.flags.response_expected == 1) { if (inmsg->hdr.flags.response_expected == 1) {
pmsg_hdr = kzalloc(sizeof(*pmsg_hdr), GFP_KERNEL); pmsg_hdr = kzalloc(sizeof(*pmsg_hdr), GFP_KERNEL);
if (!pmsg_hdr) { if (!pmsg_hdr) {
rc = -CONTROLVM_RESP_ERROR_KMALLOC_FAILED; rc = -CONTROLVM_RESP_KMALLOC_FAILED;
goto err_respond; 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); dev_info = visorbus_get_device_by_id(bus_no, dev_no, NULL);
if (!dev_info) { if (!dev_info) {
rc = -CONTROLVM_RESP_ERROR_DEVICE_INVALID; rc = -CONTROLVM_RESP_DEVICE_INVALID;
goto err_respond; goto err_respond;
} }
if (dev_info->state.created == 0) { if (dev_info->state.created == 0) {
rc = -CONTROLVM_RESP_ERROR_ALREADY_DONE; rc = -CONTROLVM_RESP_ALREADY_DONE;
goto err_respond; goto err_respond;
} }
if (dev_info->pending_msg_hdr) { if (dev_info->pending_msg_hdr) {
/* only non-NULL if dev is still waiting on a response */ /* 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; goto err_respond;
} }
if (inmsg->hdr.flags.response_expected == 1) { if (inmsg->hdr.flags.response_expected == 1) {
pmsg_hdr = kzalloc(sizeof(*pmsg_hdr), GFP_KERNEL); pmsg_hdr = kzalloc(sizeof(*pmsg_hdr), GFP_KERNEL);
if (!pmsg_hdr) { if (!pmsg_hdr) {
rc = -CONTROLVM_RESP_ERROR_KMALLOC_FAILED; rc = -CONTROLVM_RESP_KMALLOC_FAILED;
goto err_respond; goto err_respond;
} }
@ -1097,14 +1097,14 @@ initialize_controlvm_payload_info(u64 phys_addr, u64 offset, u32 bytes,
u8 *payload = NULL; u8 *payload = NULL;
if (!info) if (!info)
return -CONTROLVM_RESP_ERROR_PAYLOAD_INVALID; return -CONTROLVM_RESP_PAYLOAD_INVALID;
if ((offset == 0) || (bytes == 0)) if ((offset == 0) || (bytes == 0))
return -CONTROLVM_RESP_ERROR_PAYLOAD_INVALID; return -CONTROLVM_RESP_PAYLOAD_INVALID;
payload = memremap(phys_addr + offset, bytes, MEMREMAP_WB); payload = memremap(phys_addr + offset, bytes, MEMREMAP_WB);
if (!payload) if (!payload)
return -CONTROLVM_RESP_ERROR_IOREMAP_FAILED; return -CONTROLVM_RESP_IOREMAP_FAILED;
memset(info, 0, sizeof(struct visor_controlvm_payload_info)); memset(info, 0, sizeof(struct visor_controlvm_payload_info));
info->offset = offset; info->offset = offset;
@ -2001,8 +2001,7 @@ handle_command(struct controlvm_message inmsg, u64 channel_addr)
default: default:
if (inmsg.hdr.flags.response_expected) if (inmsg.hdr.flags.response_expected)
controlvm_respond controlvm_respond
(&inmsg.hdr, (&inmsg.hdr, -CONTROLVM_RESP_ID_UNKNOWN);
-CONTROLVM_RESP_ERROR_MESSAGE_ID_UNKNOWN);
break; break;
} }
@ -2057,7 +2056,7 @@ parahotplug_process_list(void)
if (req->msg.hdr.flags.response_expected) if (req->msg.hdr.flags.response_expected)
controlvm_respond_physdev_changestate( controlvm_respond_physdev_changestate(
&req->msg.hdr, &req->msg.hdr,
CONTROLVM_RESP_ERROR_DEVICE_UDEV_TIMEOUT, CONTROLVM_RESP_DEVICE_UDEV_TIMEOUT,
req->msg.cmd.device_change_state.state); req->msg.cmd.device_change_state.state);
parahotplug_request_destroy(req); parahotplug_request_destroy(req);
} }