mirror of https://gitee.com/openkylin/linux.git
staging: unisys: get rid of goto in visorchipset_ioctl()
Remove another completely unnecessary goto and just return the values directly. Signed-off-by: Ken Depro <kenneth.depro@unisys.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
cc5ff7f5c7
commit
2ce6cbb6b9
|
@ -166,7 +166,6 @@ visorchipset_mmap(struct file *file, struct vm_area_struct *vma)
|
||||||
|
|
||||||
long visorchipset_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
long visorchipset_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||||
{
|
{
|
||||||
int rc = SUCCESS;
|
|
||||||
s64 adjustment;
|
s64 adjustment;
|
||||||
s64 vrtc_offset;
|
s64 vrtc_offset;
|
||||||
|
|
||||||
|
@ -177,28 +176,21 @@ long visorchipset_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||||
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))) {
|
||||||
rc = -EFAULT;
|
return -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;
|
return SUCCESS;
|
||||||
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))) {
|
||||||
rc = -EFAULT;
|
return -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);
|
return issue_vmcall_update_physical_time(adjustment);
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
LOGERR("visorchipset_ioctl received invalid command");
|
LOGERR("visorchipset_ioctl received invalid command");
|
||||||
rc = -EFAULT;
|
return -EFAULT;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
Away:
|
|
||||||
DBGINF("exiting %d!", rc);
|
|
||||||
return rc;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue