提交 86d921f9 编写于 作者: A Alexander Gordeev 提交者: Linus Torvalds

pps: declare variables where they are used in switch

Move variable declarations where they are used in pps_cdev_ioctl.
Signed-off-by: NAlexander Gordeev <lasaine@lvk.cs.msu.su>
Acked-by: NRodolfo Giometti <giometti@linux.it>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 7a21a3cc
...@@ -61,8 +61,6 @@ static long pps_cdev_ioctl(struct file *file, ...@@ -61,8 +61,6 @@ static long pps_cdev_ioctl(struct file *file,
{ {
struct pps_device *pps = file->private_data; struct pps_device *pps = file->private_data;
struct pps_kparams params; struct pps_kparams params;
struct pps_fdata fdata;
unsigned long ticks;
void __user *uarg = (void __user *) arg; void __user *uarg = (void __user *) arg;
int __user *iuarg = (int __user *) arg; int __user *iuarg = (int __user *) arg;
int err; int err;
...@@ -136,7 +134,9 @@ static long pps_cdev_ioctl(struct file *file, ...@@ -136,7 +134,9 @@ static long pps_cdev_ioctl(struct file *file,
break; break;
case PPS_FETCH: case PPS_FETCH: {
struct pps_fdata fdata;
pr_debug("PPS_FETCH: source %d\n", pps->id); pr_debug("PPS_FETCH: source %d\n", pps->id);
err = copy_from_user(&fdata, uarg, sizeof(struct pps_fdata)); err = copy_from_user(&fdata, uarg, sizeof(struct pps_fdata));
...@@ -149,6 +149,8 @@ static long pps_cdev_ioctl(struct file *file, ...@@ -149,6 +149,8 @@ static long pps_cdev_ioctl(struct file *file,
if (fdata.timeout.flags & PPS_TIME_INVALID) if (fdata.timeout.flags & PPS_TIME_INVALID)
err = wait_event_interruptible(pps->queue, pps->go); err = wait_event_interruptible(pps->queue, pps->go);
else { else {
unsigned long ticks;
pr_debug("timeout %lld.%09d\n", pr_debug("timeout %lld.%09d\n",
(long long) fdata.timeout.sec, (long long) fdata.timeout.sec,
fdata.timeout.nsec); fdata.timeout.nsec);
...@@ -185,7 +187,7 @@ static long pps_cdev_ioctl(struct file *file, ...@@ -185,7 +187,7 @@ static long pps_cdev_ioctl(struct file *file,
return -EFAULT; return -EFAULT;
break; break;
}
default: default:
return -ENOTTY; return -ENOTTY;
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册