Staging: unisys: Remove RETINT macro
The RETINT macro included a goto statement which is not allowed in the kernel. Signed-off-by: Ken Cox <jkc@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
5e54c97dab
commit
22ad57ba5e
|
@ -122,10 +122,6 @@ typedef long VMMIO32;/**< #VMMIO pointing to 32-bit data */
|
||||||
#define RETTRACE(x)
|
#define RETTRACE(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** return from an int function, using a common exit point "Away"
|
|
||||||
* @param x the value to return
|
|
||||||
*/
|
|
||||||
#define RETINT(x) do { rc = (x); RETTRACE(x); goto Away; } while (0)
|
|
||||||
/** Try to evaulate the provided expression, and do a RETINT(x) iff
|
/** Try to evaulate the provided expression, and do a RETINT(x) iff
|
||||||
* the expression evaluates to < 0.
|
* the expression evaluates to < 0.
|
||||||
* @param x the expression to try
|
* @param x the expression to try
|
||||||
|
|
|
@ -28,8 +28,6 @@
|
||||||
#define CURRENT_FILE_PC UISLIB_PC_uisqueue_c
|
#define CURRENT_FILE_PC UISLIB_PC_uisqueue_c
|
||||||
#define __MYFILE__ "uisqueue.c"
|
#define __MYFILE__ "uisqueue.c"
|
||||||
|
|
||||||
#define RETINT(x) do { rc = (x); goto Away; } while (0)
|
|
||||||
|
|
||||||
#define CHECK_CACHE_ALIGN 0
|
#define CHECK_CACHE_ALIGN 0
|
||||||
|
|
||||||
/*****************************************************/
|
/*****************************************************/
|
||||||
|
@ -91,13 +89,13 @@ do_locked_client_insert(struct uisqueue_info *queueinfo,
|
||||||
locked = 1;
|
locked = 1;
|
||||||
|
|
||||||
if (!ULTRA_CHANNEL_CLIENT_ACQUIRE_OS(queueinfo->chan, channelId, NULL))
|
if (!ULTRA_CHANNEL_CLIENT_ACQUIRE_OS(queueinfo->chan, channelId, NULL))
|
||||||
RETINT(0);
|
goto Away;
|
||||||
|
|
||||||
acquired = 1;
|
acquired = 1;
|
||||||
|
|
||||||
queueWasEmpty = visor_signalqueue_empty(queueinfo->chan, whichqueue);
|
queueWasEmpty = visor_signalqueue_empty(queueinfo->chan, whichqueue);
|
||||||
if (!visor_signal_insert(queueinfo->chan, whichqueue, pSignal))
|
if (!visor_signal_insert(queueinfo->chan, whichqueue, pSignal))
|
||||||
RETINT(0);
|
goto Away;
|
||||||
ULTRA_CHANNEL_CLIENT_RELEASE_OS(queueinfo->chan, channelId, NULL);
|
ULTRA_CHANNEL_CLIENT_RELEASE_OS(queueinfo->chan, channelId, NULL);
|
||||||
acquired = 0;
|
acquired = 0;
|
||||||
spin_unlock_irqrestore(lock, flags);
|
spin_unlock_irqrestore(lock, flags);
|
||||||
|
@ -105,8 +103,7 @@ do_locked_client_insert(struct uisqueue_info *queueinfo,
|
||||||
|
|
||||||
queueinfo->packets_sent++;
|
queueinfo->packets_sent++;
|
||||||
|
|
||||||
RETINT(1);
|
rc = 1;
|
||||||
|
|
||||||
Away:
|
Away:
|
||||||
if (acquired) {
|
if (acquired) {
|
||||||
ULTRA_CHANNEL_CLIENT_RELEASE_OS(queueinfo->chan, channelId,
|
ULTRA_CHANNEL_CLIENT_RELEASE_OS(queueinfo->chan, channelId,
|
||||||
|
|
|
@ -250,7 +250,7 @@ visorchannel_clear(VISORCHANNEL *channel, ulong offset, U8 ch, ulong nbytes)
|
||||||
|
|
||||||
if (buf == NULL) {
|
if (buf == NULL) {
|
||||||
ERRDRV("%s failed memory allocation", __func__);
|
ERRDRV("%s failed memory allocation", __func__);
|
||||||
RETINT(-1);
|
goto Away;
|
||||||
}
|
}
|
||||||
memset(buf, ch, bufsize);
|
memset(buf, ch, bufsize);
|
||||||
while (nbytes > 0) {
|
while (nbytes > 0) {
|
||||||
|
@ -260,12 +260,14 @@ visorchannel_clear(VISORCHANNEL *channel, ulong offset, U8 ch, ulong nbytes)
|
||||||
thisbytes = nbytes;
|
thisbytes = nbytes;
|
||||||
x = visor_memregion_write(channel->memregion, offset + written,
|
x = visor_memregion_write(channel->memregion, offset + written,
|
||||||
buf, thisbytes);
|
buf, thisbytes);
|
||||||
if (x < 0)
|
if (x < 0) {
|
||||||
RETINT(x);
|
rc = x;
|
||||||
|
goto Away;
|
||||||
|
}
|
||||||
written += thisbytes;
|
written += thisbytes;
|
||||||
nbytes -= thisbytes;
|
nbytes -= thisbytes;
|
||||||
}
|
}
|
||||||
RETINT(0);
|
rc = 0;
|
||||||
|
|
||||||
Away:
|
Away:
|
||||||
if (buf != NULL) {
|
if (buf != NULL) {
|
||||||
|
|
|
@ -71,7 +71,7 @@ visorchipset_file_init(dev_t majorDev, VISORCHANNEL **pControlVm_channel)
|
||||||
if (alloc_chrdev_region(&MajorDev, 0, 1, MYDRVNAME) < 0) {
|
if (alloc_chrdev_region(&MajorDev, 0, 1, MYDRVNAME) < 0) {
|
||||||
ERRDRV("Unable to allocate+register char device %s",
|
ERRDRV("Unable to allocate+register char device %s",
|
||||||
MYDRVNAME);
|
MYDRVNAME);
|
||||||
RETINT(-1);
|
goto Away;
|
||||||
}
|
}
|
||||||
Registered = TRUE;
|
Registered = TRUE;
|
||||||
INFODRV("New major number %d registered\n", MAJOR(MajorDev));
|
INFODRV("New major number %d registered\n", MAJOR(MajorDev));
|
||||||
|
@ -79,19 +79,18 @@ visorchipset_file_init(dev_t majorDev, VISORCHANNEL **pControlVm_channel)
|
||||||
/* static major device number registration required */
|
/* static major device number registration required */
|
||||||
if (register_chrdev_region(MajorDev, 1, MYDRVNAME) < 0) {
|
if (register_chrdev_region(MajorDev, 1, MYDRVNAME) < 0) {
|
||||||
ERRDRV("Unable to register char device %s", MYDRVNAME);
|
ERRDRV("Unable to register char device %s", MYDRVNAME);
|
||||||
RETINT(-1);
|
goto Away;
|
||||||
}
|
}
|
||||||
Registered = TRUE;
|
Registered = TRUE;
|
||||||
INFODRV("Static major number %d registered\n", MAJOR(MajorDev));
|
INFODRV("Static major number %d registered\n", MAJOR(MajorDev));
|
||||||
}
|
}
|
||||||
if (cdev_add(&Cdev, MKDEV(MAJOR(MajorDev), 0), 1) < 0) {
|
if (cdev_add(&Cdev, MKDEV(MAJOR(MajorDev), 0), 1) < 0) {
|
||||||
ERRDRV("failed to create char device: (status=-1)\n");
|
ERRDRV("failed to create char device: (status=%d)\n", rc);
|
||||||
rc = -1;
|
|
||||||
goto Away;
|
goto Away;
|
||||||
}
|
}
|
||||||
INFODRV("Registered char device for %s (major=%d)",
|
INFODRV("Registered char device for %s (major=%d)",
|
||||||
MYDRVNAME, MAJOR(MajorDev));
|
MYDRVNAME, MAJOR(MajorDev));
|
||||||
RETINT(0);
|
rc = 0;
|
||||||
Away:
|
Away:
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -119,9 +118,9 @@ visorchipset_open(struct inode *inode, struct file *file)
|
||||||
|
|
||||||
DEBUGDRV("%s", __func__);
|
DEBUGDRV("%s", __func__);
|
||||||
if (minor_number != 0)
|
if (minor_number != 0)
|
||||||
RETINT(-ENODEV);
|
goto Away;
|
||||||
file->private_data = NULL;
|
file->private_data = NULL;
|
||||||
RETINT(0);
|
rc = 0;
|
||||||
Away:
|
Away:
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
ERRDRV("%s minor=%d failed", __func__, minor_number);
|
ERRDRV("%s minor=%d failed", __func__, minor_number);
|
||||||
|
@ -131,11 +130,8 @@ Away:
|
||||||
static int
|
static int
|
||||||
visorchipset_release(struct inode *inode, struct file *file)
|
visorchipset_release(struct inode *inode, struct file *file)
|
||||||
{
|
{
|
||||||
int rc = -1;
|
|
||||||
DEBUGDRV("%s", __func__);
|
DEBUGDRV("%s", __func__);
|
||||||
RETINT(0);
|
return 0;
|
||||||
Away:
|
|
||||||
return rc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -202,25 +198,28 @@ visorchipset_ioctl(struct inode *inode, struct file *file,
|
||||||
/* get the physical rtc offset */
|
/* get the physical rtc offset */
|
||||||
vrtc_offset = Issue_VMCALL_QUERY_GUEST_VIRTUAL_TIME_OFFSET();
|
vrtc_offset = Issue_VMCALL_QUERY_GUEST_VIRTUAL_TIME_OFFSET();
|
||||||
if (copy_to_user
|
if (copy_to_user
|
||||||
((void __user *)arg, &vrtc_offset, sizeof(vrtc_offset)))
|
((void __user *)arg, &vrtc_offset, sizeof(vrtc_offset))) {
|
||||||
RETINT(-EFAULT);
|
rc = -EFAULT;
|
||||||
|
goto Away;
|
||||||
|
}
|
||||||
DBGINF("insde visorchipset_ioctl, cmd=%d, vrtc_offset=%lld",
|
DBGINF("insde visorchipset_ioctl, cmd=%d, vrtc_offset=%lld",
|
||||||
cmd, vrtc_offset);
|
cmd, vrtc_offset);
|
||||||
break;
|
break;
|
||||||
case VMCALL_UPDATE_PHYSICAL_TIME:
|
case VMCALL_UPDATE_PHYSICAL_TIME:
|
||||||
if (copy_from_user
|
if (copy_from_user
|
||||||
(&adjustment, (void __user *)arg, sizeof(adjustment)))
|
(&adjustment, (void __user *)arg, sizeof(adjustment))) {
|
||||||
RETINT(-EFAULT);
|
rc = -EFAULT;
|
||||||
|
goto Away;
|
||||||
|
}
|
||||||
DBGINF("insde visorchipset_ioctl, cmd=%d, adjustment=%lld", cmd,
|
DBGINF("insde visorchipset_ioctl, cmd=%d, adjustment=%lld", cmd,
|
||||||
adjustment);
|
adjustment);
|
||||||
rc = Issue_VMCALL_UPDATE_PHYSICAL_TIME(adjustment);
|
rc = Issue_VMCALL_UPDATE_PHYSICAL_TIME(adjustment);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOGERR("visorchipset_ioctl received invalid command");
|
LOGERR("visorchipset_ioctl received invalid command");
|
||||||
RETINT(-EFAULT);
|
rc = -EFAULT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
RETINT(rc);
|
|
||||||
Away:
|
Away:
|
||||||
DBGINF("exiting %d!", rc);
|
DBGINF("exiting %d!", rc);
|
||||||
return rc;
|
return rc;
|
||||||
|
|
|
@ -631,7 +631,8 @@ chipset_init(CONTROLVM_MESSAGE *inmsg)
|
||||||
POSTCODE_LINUX_2(CHIPSET_INIT_ENTRY_PC, POSTCODE_SEVERITY_INFO);
|
POSTCODE_LINUX_2(CHIPSET_INIT_ENTRY_PC, POSTCODE_SEVERITY_INFO);
|
||||||
if (chipset_inited) {
|
if (chipset_inited) {
|
||||||
LOGERR("CONTROLVM_CHIPSET_INIT Failed: Already Done.");
|
LOGERR("CONTROLVM_CHIPSET_INIT Failed: Already Done.");
|
||||||
RETINT(-CONTROLVM_RESP_ERROR_ALREADY_DONE);
|
rc = -CONTROLVM_RESP_ERROR_ALREADY_DONE;
|
||||||
|
goto Away;
|
||||||
}
|
}
|
||||||
chipset_inited = 1;
|
chipset_inited = 1;
|
||||||
POSTCODE_LINUX_2(CHIPSET_INIT_EXIT_PC, POSTCODE_SEVERITY_INFO);
|
POSTCODE_LINUX_2(CHIPSET_INIT_EXIT_PC, POSTCODE_SEVERITY_INFO);
|
||||||
|
@ -1079,7 +1080,8 @@ bus_create(CONTROLVM_MESSAGE *inmsg)
|
||||||
busNo);
|
busNo);
|
||||||
POSTCODE_LINUX_3(BUS_CREATE_FAILURE_PC, busNo,
|
POSTCODE_LINUX_3(BUS_CREATE_FAILURE_PC, busNo,
|
||||||
POSTCODE_SEVERITY_ERR);
|
POSTCODE_SEVERITY_ERR);
|
||||||
RETINT(-CONTROLVM_RESP_ERROR_ALREADY_DONE);
|
rc = -CONTROLVM_RESP_ERROR_ALREADY_DONE;
|
||||||
|
goto Away;
|
||||||
}
|
}
|
||||||
pBusInfo = kzalloc(sizeof(VISORCHIPSET_BUS_INFO), GFP_KERNEL);
|
pBusInfo = kzalloc(sizeof(VISORCHIPSET_BUS_INFO), GFP_KERNEL);
|
||||||
if (pBusInfo == NULL) {
|
if (pBusInfo == NULL) {
|
||||||
|
@ -1087,7 +1089,8 @@ bus_create(CONTROLVM_MESSAGE *inmsg)
|
||||||
busNo);
|
busNo);
|
||||||
POSTCODE_LINUX_3(BUS_CREATE_FAILURE_PC, busNo,
|
POSTCODE_LINUX_3(BUS_CREATE_FAILURE_PC, busNo,
|
||||||
POSTCODE_SEVERITY_ERR);
|
POSTCODE_SEVERITY_ERR);
|
||||||
RETINT(-CONTROLVM_RESP_ERROR_KMALLOC_FAILED);
|
rc = -CONTROLVM_RESP_ERROR_KMALLOC_FAILED;
|
||||||
|
goto Away;
|
||||||
}
|
}
|
||||||
|
|
||||||
INIT_LIST_HEAD(&pBusInfo->entry);
|
INIT_LIST_HEAD(&pBusInfo->entry);
|
||||||
|
@ -1127,12 +1130,14 @@ bus_destroy(CONTROLVM_MESSAGE *inmsg)
|
||||||
pBusInfo = findbus(&BusInfoList, busNo);
|
pBusInfo = findbus(&BusInfoList, busNo);
|
||||||
if (!pBusInfo) {
|
if (!pBusInfo) {
|
||||||
LOGERR("CONTROLVM_BUS_DESTROY Failed: bus %lu invalid", busNo);
|
LOGERR("CONTROLVM_BUS_DESTROY Failed: bus %lu invalid", busNo);
|
||||||
RETINT(-CONTROLVM_RESP_ERROR_BUS_INVALID);
|
rc = -CONTROLVM_RESP_ERROR_BUS_INVALID;
|
||||||
|
goto Away;
|
||||||
}
|
}
|
||||||
if (pBusInfo->state.created == 0) {
|
if (pBusInfo->state.created == 0) {
|
||||||
LOGERR("CONTROLVM_BUS_DESTROY Failed: bus %lu already destroyed",
|
LOGERR("CONTROLVM_BUS_DESTROY Failed: bus %lu already destroyed",
|
||||||
busNo);
|
busNo);
|
||||||
RETINT(-CONTROLVM_RESP_ERROR_ALREADY_DONE);
|
rc = -CONTROLVM_RESP_ERROR_ALREADY_DONE;
|
||||||
|
goto Away;
|
||||||
}
|
}
|
||||||
|
|
||||||
Away:
|
Away:
|
||||||
|
@ -1158,14 +1163,16 @@ bus_configure(CONTROLVM_MESSAGE *inmsg, PARSER_CONTEXT *parser_ctx)
|
||||||
busNo);
|
busNo);
|
||||||
POSTCODE_LINUX_3(BUS_CONFIGURE_FAILURE_PC, busNo,
|
POSTCODE_LINUX_3(BUS_CONFIGURE_FAILURE_PC, busNo,
|
||||||
POSTCODE_SEVERITY_ERR);
|
POSTCODE_SEVERITY_ERR);
|
||||||
RETINT(-CONTROLVM_RESP_ERROR_BUS_INVALID);
|
rc = -CONTROLVM_RESP_ERROR_BUS_INVALID;
|
||||||
|
goto Away;
|
||||||
}
|
}
|
||||||
if (pBusInfo->state.created == 0) {
|
if (pBusInfo->state.created == 0) {
|
||||||
LOGERR("CONTROLVM_BUS_CONFIGURE Failed: Invalid bus %lu - not created yet",
|
LOGERR("CONTROLVM_BUS_CONFIGURE Failed: Invalid bus %lu - not created yet",
|
||||||
busNo);
|
busNo);
|
||||||
POSTCODE_LINUX_3(BUS_CONFIGURE_FAILURE_PC, busNo,
|
POSTCODE_LINUX_3(BUS_CONFIGURE_FAILURE_PC, busNo,
|
||||||
POSTCODE_SEVERITY_ERR);
|
POSTCODE_SEVERITY_ERR);
|
||||||
RETINT(-CONTROLVM_RESP_ERROR_BUS_INVALID);
|
rc = -CONTROLVM_RESP_ERROR_BUS_INVALID;
|
||||||
|
goto Away;
|
||||||
}
|
}
|
||||||
/* TBD - add this check to other commands also... */
|
/* TBD - add this check to other commands also... */
|
||||||
if (pBusInfo->pendingMsgHdr.Id != CONTROLVM_INVALID) {
|
if (pBusInfo->pendingMsgHdr.Id != CONTROLVM_INVALID) {
|
||||||
|
@ -1173,7 +1180,8 @@ bus_configure(CONTROLVM_MESSAGE *inmsg, PARSER_CONTEXT *parser_ctx)
|
||||||
busNo, (uint) pBusInfo->pendingMsgHdr.Id);
|
busNo, (uint) pBusInfo->pendingMsgHdr.Id);
|
||||||
POSTCODE_LINUX_3(BUS_CONFIGURE_FAILURE_PC, busNo,
|
POSTCODE_LINUX_3(BUS_CONFIGURE_FAILURE_PC, busNo,
|
||||||
POSTCODE_SEVERITY_ERR);
|
POSTCODE_SEVERITY_ERR);
|
||||||
RETINT(-CONTROLVM_RESP_ERROR_MESSAGE_ID_INVALID_FOR_CLIENT);
|
rc = -CONTROLVM_RESP_ERROR_MESSAGE_ID_INVALID_FOR_CLIENT;
|
||||||
|
goto Away;
|
||||||
}
|
}
|
||||||
|
|
||||||
pBusInfo->partitionHandle = cmd->configureBus.guestHandle;
|
pBusInfo->partitionHandle = cmd->configureBus.guestHandle;
|
||||||
|
@ -1189,7 +1197,8 @@ bus_configure(CONTROLVM_MESSAGE *inmsg, PARSER_CONTEXT *parser_ctx)
|
||||||
busNo);
|
busNo);
|
||||||
POSTCODE_LINUX_3(BUS_CONFIGURE_FAILURE_PC, busNo,
|
POSTCODE_LINUX_3(BUS_CONFIGURE_FAILURE_PC, busNo,
|
||||||
POSTCODE_SEVERITY_ERR);
|
POSTCODE_SEVERITY_ERR);
|
||||||
RETINT(-CONTROLVM_RESP_ERROR_KMALLOC_FAILED);
|
rc = -CONTROLVM_RESP_ERROR_KMALLOC_FAILED;
|
||||||
|
goto Away;
|
||||||
}
|
}
|
||||||
POSTCODE_LINUX_3(BUS_CONFIGURE_EXIT_PC, busNo, POSTCODE_SEVERITY_INFO);
|
POSTCODE_LINUX_3(BUS_CONFIGURE_EXIT_PC, busNo, POSTCODE_SEVERITY_INFO);
|
||||||
Away:
|
Away:
|
||||||
|
@ -1213,7 +1222,8 @@ my_device_create(CONTROLVM_MESSAGE *inmsg)
|
||||||
busNo, devNo);
|
busNo, devNo);
|
||||||
POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, devNo, busNo,
|
POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, devNo, busNo,
|
||||||
POSTCODE_SEVERITY_ERR);
|
POSTCODE_SEVERITY_ERR);
|
||||||
RETINT(-CONTROLVM_RESP_ERROR_ALREADY_DONE);
|
rc = -CONTROLVM_RESP_ERROR_ALREADY_DONE;
|
||||||
|
goto Away;
|
||||||
}
|
}
|
||||||
pBusInfo = findbus(&BusInfoList, busNo);
|
pBusInfo = findbus(&BusInfoList, busNo);
|
||||||
if (!pBusInfo) {
|
if (!pBusInfo) {
|
||||||
|
@ -1221,14 +1231,16 @@ my_device_create(CONTROLVM_MESSAGE *inmsg)
|
||||||
busNo);
|
busNo);
|
||||||
POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, devNo, busNo,
|
POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, devNo, busNo,
|
||||||
POSTCODE_SEVERITY_ERR);
|
POSTCODE_SEVERITY_ERR);
|
||||||
RETINT(-CONTROLVM_RESP_ERROR_BUS_INVALID);
|
rc = -CONTROLVM_RESP_ERROR_BUS_INVALID;
|
||||||
|
goto Away;
|
||||||
}
|
}
|
||||||
if (pBusInfo->state.created == 0) {
|
if (pBusInfo->state.created == 0) {
|
||||||
LOGERR("CONTROLVM_DEVICE_CREATE Failed: Invalid bus %lu - not created yet",
|
LOGERR("CONTROLVM_DEVICE_CREATE Failed: Invalid bus %lu - not created yet",
|
||||||
busNo);
|
busNo);
|
||||||
POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, devNo, busNo,
|
POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, devNo, busNo,
|
||||||
POSTCODE_SEVERITY_ERR);
|
POSTCODE_SEVERITY_ERR);
|
||||||
RETINT(-CONTROLVM_RESP_ERROR_BUS_INVALID);
|
rc = -CONTROLVM_RESP_ERROR_BUS_INVALID;
|
||||||
|
goto Away;
|
||||||
}
|
}
|
||||||
pDevInfo = kzalloc(sizeof(VISORCHIPSET_DEVICE_INFO), GFP_KERNEL);
|
pDevInfo = kzalloc(sizeof(VISORCHIPSET_DEVICE_INFO), GFP_KERNEL);
|
||||||
if (pDevInfo == NULL) {
|
if (pDevInfo == NULL) {
|
||||||
|
@ -1236,7 +1248,8 @@ my_device_create(CONTROLVM_MESSAGE *inmsg)
|
||||||
busNo, devNo);
|
busNo, devNo);
|
||||||
POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, devNo, busNo,
|
POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, devNo, busNo,
|
||||||
POSTCODE_SEVERITY_ERR);
|
POSTCODE_SEVERITY_ERR);
|
||||||
RETINT(-CONTROLVM_RESP_ERROR_KMALLOC_FAILED);
|
rc = -CONTROLVM_RESP_ERROR_KMALLOC_FAILED;
|
||||||
|
goto Away;
|
||||||
}
|
}
|
||||||
|
|
||||||
INIT_LIST_HEAD(&pDevInfo->entry);
|
INIT_LIST_HEAD(&pDevInfo->entry);
|
||||||
|
@ -1287,14 +1300,15 @@ my_device_changestate(CONTROLVM_MESSAGE *inmsg)
|
||||||
busNo, devNo);
|
busNo, devNo);
|
||||||
POSTCODE_LINUX_4(DEVICE_CHANGESTATE_FAILURE_PC, devNo, busNo,
|
POSTCODE_LINUX_4(DEVICE_CHANGESTATE_FAILURE_PC, devNo, busNo,
|
||||||
POSTCODE_SEVERITY_ERR);
|
POSTCODE_SEVERITY_ERR);
|
||||||
RETINT(-CONTROLVM_RESP_ERROR_DEVICE_INVALID);
|
rc = -CONTROLVM_RESP_ERROR_DEVICE_INVALID;
|
||||||
|
goto Away;
|
||||||
}
|
}
|
||||||
if (pDevInfo->state.created == 0) {
|
if (pDevInfo->state.created == 0) {
|
||||||
LOGERR("CONTROLVM_DEVICE_CHANGESTATE Failed: busNo=%lu, devNo=%lu invalid (not created)",
|
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_LINUX_4(DEVICE_CHANGESTATE_FAILURE_PC, devNo, busNo,
|
||||||
POSTCODE_SEVERITY_ERR);
|
POSTCODE_SEVERITY_ERR);
|
||||||
RETINT(-CONTROLVM_RESP_ERROR_DEVICE_INVALID);
|
rc = -CONTROLVM_RESP_ERROR_DEVICE_INVALID;
|
||||||
}
|
}
|
||||||
Away:
|
Away:
|
||||||
if ((rc >= CONTROLVM_RESP_SUCCESS) && pDevInfo)
|
if ((rc >= CONTROLVM_RESP_SUCCESS) && pDevInfo)
|
||||||
|
@ -1317,12 +1331,13 @@ my_device_destroy(CONTROLVM_MESSAGE *inmsg)
|
||||||
if (!pDevInfo) {
|
if (!pDevInfo) {
|
||||||
LOGERR("CONTROLVM_DEVICE_DESTROY Failed: busNo=%lu, devNo=%lu invalid",
|
LOGERR("CONTROLVM_DEVICE_DESTROY Failed: busNo=%lu, devNo=%lu invalid",
|
||||||
busNo, devNo);
|
busNo, devNo);
|
||||||
RETINT(-CONTROLVM_RESP_ERROR_DEVICE_INVALID);
|
rc = -CONTROLVM_RESP_ERROR_DEVICE_INVALID;
|
||||||
|
goto Away;
|
||||||
}
|
}
|
||||||
if (pDevInfo->state.created == 0) {
|
if (pDevInfo->state.created == 0) {
|
||||||
LOGERR("CONTROLVM_DEVICE_DESTROY Failed: busNo=%lu, devNo=%lu already destroyed",
|
LOGERR("CONTROLVM_DEVICE_DESTROY Failed: busNo=%lu, devNo=%lu already destroyed",
|
||||||
busNo, devNo);
|
busNo, devNo);
|
||||||
RETINT(-CONTROLVM_RESP_ERROR_ALREADY_DONE);
|
rc = -CONTROLVM_RESP_ERROR_ALREADY_DONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
Away:
|
Away:
|
||||||
|
@ -1349,19 +1364,22 @@ initialize_controlvm_payload_info(HOSTADDRESS phys_addr, U64 offset, U32 bytes,
|
||||||
if (info == NULL) {
|
if (info == NULL) {
|
||||||
LOGERR("HUH ? CONTROLVM_PAYLOAD_INIT Failed : Programmer check at %s:%d",
|
LOGERR("HUH ? CONTROLVM_PAYLOAD_INIT Failed : Programmer check at %s:%d",
|
||||||
__FILE__, __LINE__);
|
__FILE__, __LINE__);
|
||||||
RETINT(-CONTROLVM_RESP_ERROR_PAYLOAD_INVALID);
|
rc = -CONTROLVM_RESP_ERROR_PAYLOAD_INVALID;
|
||||||
|
goto Away;
|
||||||
}
|
}
|
||||||
memset(info, 0, sizeof(CONTROLVM_PAYLOAD_INFO));
|
memset(info, 0, sizeof(CONTROLVM_PAYLOAD_INFO));
|
||||||
if ((offset == 0) || (bytes == 0)) {
|
if ((offset == 0) || (bytes == 0)) {
|
||||||
LOGERR("CONTROLVM_PAYLOAD_INIT Failed: RequestPayloadOffset=%llu RequestPayloadBytes=%llu!",
|
LOGERR("CONTROLVM_PAYLOAD_INIT Failed: RequestPayloadOffset=%llu RequestPayloadBytes=%llu!",
|
||||||
(u64) offset, (u64) bytes);
|
(u64) offset, (u64) bytes);
|
||||||
RETINT(-CONTROLVM_RESP_ERROR_PAYLOAD_INVALID);
|
rc = -CONTROLVM_RESP_ERROR_PAYLOAD_INVALID;
|
||||||
|
goto Away;
|
||||||
}
|
}
|
||||||
payload = ioremap_cache(phys_addr + offset, bytes);
|
payload = ioremap_cache(phys_addr + offset, bytes);
|
||||||
if (payload == NULL) {
|
if (payload == NULL) {
|
||||||
LOGERR("CONTROLVM_PAYLOAD_INIT Failed: ioremap_cache %llu for %llu bytes failed",
|
LOGERR("CONTROLVM_PAYLOAD_INIT Failed: ioremap_cache %llu for %llu bytes failed",
|
||||||
(u64) offset, (u64) bytes);
|
(u64) offset, (u64) bytes);
|
||||||
RETINT(-CONTROLVM_RESP_ERROR_IOREMAP_FAILED);
|
rc = -CONTROLVM_RESP_ERROR_IOREMAP_FAILED;
|
||||||
|
goto Away;
|
||||||
}
|
}
|
||||||
|
|
||||||
info->offset = offset;
|
info->offset = offset;
|
||||||
|
@ -2796,10 +2814,8 @@ visorchipset_init(void)
|
||||||
}
|
}
|
||||||
LOGINF("visorchipset device created");
|
LOGINF("visorchipset device created");
|
||||||
POSTCODE_LINUX_2(CHIPSET_INIT_SUCCESS_PC, POSTCODE_SEVERITY_INFO);
|
POSTCODE_LINUX_2(CHIPSET_INIT_SUCCESS_PC, POSTCODE_SEVERITY_INFO);
|
||||||
RETINT(0);
|
rc = 0;
|
||||||
|
|
||||||
Away:
|
Away:
|
||||||
|
|
||||||
if (rc) {
|
if (rc) {
|
||||||
LOGERR("visorchipset_init failed");
|
LOGERR("visorchipset_init failed");
|
||||||
POSTCODE_LINUX_3(CHIPSET_INIT_FAILURE_PC, rc,
|
POSTCODE_LINUX_3(CHIPSET_INIT_FAILURE_PC, rc,
|
||||||
|
|
|
@ -98,11 +98,10 @@ static int charqueue_dequeue_1(CHARQUEUE *charqueue)
|
||||||
|
|
||||||
int charqueue_dequeue(CHARQUEUE *charqueue)
|
int charqueue_dequeue(CHARQUEUE *charqueue)
|
||||||
{
|
{
|
||||||
int rc = -1;
|
int rc;
|
||||||
|
|
||||||
spin_lock(&charqueue->lock);
|
spin_lock(&charqueue->lock);
|
||||||
RETINT(charqueue_dequeue_1(charqueue));
|
rc = charqueue_dequeue_1(charqueue);
|
||||||
Away:
|
|
||||||
spin_unlock(&charqueue->lock);
|
spin_unlock(&charqueue->lock);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -111,7 +110,7 @@ Away:
|
||||||
|
|
||||||
int visor_charqueue_dequeue_n(CHARQUEUE *charqueue, unsigned char *buf, int n)
|
int visor_charqueue_dequeue_n(CHARQUEUE *charqueue, unsigned char *buf, int n)
|
||||||
{
|
{
|
||||||
int rc = -1, counter = 0, c;
|
int rc, counter = 0, c;
|
||||||
|
|
||||||
spin_lock(&charqueue->lock);
|
spin_lock(&charqueue->lock);
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
@ -125,9 +124,7 @@ int visor_charqueue_dequeue_n(CHARQUEUE *charqueue, unsigned char *buf, int n)
|
||||||
n--;
|
n--;
|
||||||
counter++;
|
counter++;
|
||||||
}
|
}
|
||||||
RETINT(counter);
|
rc = counter;
|
||||||
|
|
||||||
Away:
|
|
||||||
spin_unlock(&charqueue->lock);
|
spin_unlock(&charqueue->lock);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue