Skip to content

Commit

Permalink
pps: declare variables where they are used in switch
Browse files Browse the repository at this point in the history
Move variable declarations where they are used in pps_cdev_ioctl.

Signed-off-by: Alexander Gordeev <lasaine@lvk.cs.msu.su>
Acked-by: Rodolfo Giometti <giometti@linux.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Alexander Gordeev authored and Linus Torvalds committed Jan 13, 2011
1 parent 7a21a3c commit 86d921f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/pps/pps.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ static long pps_cdev_ioctl(struct file *file,
{
struct pps_device *pps = file->private_data;
struct pps_kparams params;
struct pps_fdata fdata;
unsigned long ticks;
void __user *uarg = (void __user *) arg;
int __user *iuarg = (int __user *) arg;
int err;
Expand Down Expand Up @@ -136,7 +134,9 @@ static long pps_cdev_ioctl(struct file *file,

break;

case PPS_FETCH:
case PPS_FETCH: {
struct pps_fdata fdata;

pr_debug("PPS_FETCH: source %d\n", pps->id);

err = copy_from_user(&fdata, uarg, sizeof(struct pps_fdata));
Expand All @@ -149,6 +149,8 @@ static long pps_cdev_ioctl(struct file *file,
if (fdata.timeout.flags & PPS_TIME_INVALID)
err = wait_event_interruptible(pps->queue, pps->go);
else {
unsigned long ticks;

pr_debug("timeout %lld.%09d\n",
(long long) fdata.timeout.sec,
fdata.timeout.nsec);
Expand Down Expand Up @@ -185,7 +187,7 @@ static long pps_cdev_ioctl(struct file *file,
return -EFAULT;

break;

}
default:
return -ENOTTY;
break;
Expand Down

0 comments on commit 86d921f

Please sign in to comment.