Commit 310b587e authored by Nishanth Aravamudan's avatar Nishanth Aravamudan Committed by Linus Torvalds

[PATCH] mips: fix-up schedule_timeout() usage

Use schedule_timeout_interruptible() instead of
set_current_state()/schedule_timeout() to reduce kernel size.  Also, replace
custom timespectojiffies() function with globally availabe
timespec_to_jiffies().
Signed-off-by: default avatarNishanth Aravamudan <nacc@us.ibm.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 52e6e630
...@@ -440,18 +440,6 @@ struct irix5_siginfo { ...@@ -440,18 +440,6 @@ struct irix5_siginfo {
} stuff; } stuff;
}; };
static inline unsigned long timespectojiffies(struct timespec *value)
{
unsigned long sec = (unsigned) value->tv_sec;
long nsec = value->tv_nsec;
if (sec > (LONG_MAX / HZ))
return LONG_MAX;
nsec += 1000000000L / HZ - 1;
nsec /= 1000000000L / HZ;
return HZ * sec + nsec;
}
asmlinkage int irix_sigpoll_sys(unsigned long *set, struct irix5_siginfo *info, asmlinkage int irix_sigpoll_sys(unsigned long *set, struct irix5_siginfo *info,
struct timespec *tp) struct timespec *tp)
{ {
...@@ -489,14 +477,13 @@ asmlinkage int irix_sigpoll_sys(unsigned long *set, struct irix5_siginfo *info, ...@@ -489,14 +477,13 @@ asmlinkage int irix_sigpoll_sys(unsigned long *set, struct irix5_siginfo *info,
error = -EINVAL; error = -EINVAL;
goto out; goto out;
} }
expire = timespectojiffies(tp)+(tp->tv_sec||tp->tv_nsec); expire = timespec_to_jiffies(tp) + (tp->tv_sec||tp->tv_nsec);
} }
while(1) { while(1) {
long tmp = 0; long tmp = 0;
current->state = TASK_INTERRUPTIBLE; expire = schedule_timeout_interruptible(expire);
expire = schedule_timeout(expire);
for (i=0; i<=4; i++) for (i=0; i<=4; i++)
tmp |= (current->pending.signal.sig[i] & kset.sig[i]); tmp |= (current->pending.signal.sig[i] & kset.sig[i]);
......
...@@ -1032,8 +1032,7 @@ asmlinkage int irix_lseek64(int fd, int _unused, int offhi, int offlow, ...@@ -1032,8 +1032,7 @@ asmlinkage int irix_lseek64(int fd, int _unused, int offhi, int offlow,
asmlinkage int irix_sginap(int ticks) asmlinkage int irix_sginap(int ticks)
{ {
current->state = TASK_INTERRUPTIBLE; schedule_timeout_interruptible(ticks);
schedule_timeout(ticks);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment