[PATCH] consolidate sys32/compat_adjtimex
Create compat_sys_adjtimex and use it an all appropriate places. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Arnd Bergmann <arnd@arndb.de> Acked-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:

committed by
Linus Torvalds

parent
88959ea968
commit
3158e9411a
@@ -19,7 +19,6 @@
|
||||
#include <linux/resource.h>
|
||||
#include <linux/times.h>
|
||||
#include <linux/utsname.h>
|
||||
#include <linux/timex.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/sem.h>
|
||||
@@ -945,66 +944,6 @@ asmlinkage long compat_sys_sendfile64(int out_fd, int in_fd,
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Handle adjtimex compatibility. */
|
||||
|
||||
extern int do_adjtimex(struct timex *);
|
||||
|
||||
asmlinkage long sys32_adjtimex(struct compat_timex __user *utp)
|
||||
{
|
||||
struct timex txc;
|
||||
int ret;
|
||||
|
||||
memset(&txc, 0, sizeof(struct timex));
|
||||
|
||||
if (get_user(txc.modes, &utp->modes) ||
|
||||
__get_user(txc.offset, &utp->offset) ||
|
||||
__get_user(txc.freq, &utp->freq) ||
|
||||
__get_user(txc.maxerror, &utp->maxerror) ||
|
||||
__get_user(txc.esterror, &utp->esterror) ||
|
||||
__get_user(txc.status, &utp->status) ||
|
||||
__get_user(txc.constant, &utp->constant) ||
|
||||
__get_user(txc.precision, &utp->precision) ||
|
||||
__get_user(txc.tolerance, &utp->tolerance) ||
|
||||
__get_user(txc.time.tv_sec, &utp->time.tv_sec) ||
|
||||
__get_user(txc.time.tv_usec, &utp->time.tv_usec) ||
|
||||
__get_user(txc.tick, &utp->tick) ||
|
||||
__get_user(txc.ppsfreq, &utp->ppsfreq) ||
|
||||
__get_user(txc.jitter, &utp->jitter) ||
|
||||
__get_user(txc.shift, &utp->shift) ||
|
||||
__get_user(txc.stabil, &utp->stabil) ||
|
||||
__get_user(txc.jitcnt, &utp->jitcnt) ||
|
||||
__get_user(txc.calcnt, &utp->calcnt) ||
|
||||
__get_user(txc.errcnt, &utp->errcnt) ||
|
||||
__get_user(txc.stbcnt, &utp->stbcnt))
|
||||
return -EFAULT;
|
||||
|
||||
ret = do_adjtimex(&txc);
|
||||
|
||||
if (put_user(txc.modes, &utp->modes) ||
|
||||
__put_user(txc.offset, &utp->offset) ||
|
||||
__put_user(txc.freq, &utp->freq) ||
|
||||
__put_user(txc.maxerror, &utp->maxerror) ||
|
||||
__put_user(txc.esterror, &utp->esterror) ||
|
||||
__put_user(txc.status, &utp->status) ||
|
||||
__put_user(txc.constant, &utp->constant) ||
|
||||
__put_user(txc.precision, &utp->precision) ||
|
||||
__put_user(txc.tolerance, &utp->tolerance) ||
|
||||
__put_user(txc.time.tv_sec, &utp->time.tv_sec) ||
|
||||
__put_user(txc.time.tv_usec, &utp->time.tv_usec) ||
|
||||
__put_user(txc.tick, &utp->tick) ||
|
||||
__put_user(txc.ppsfreq, &utp->ppsfreq) ||
|
||||
__put_user(txc.jitter, &utp->jitter) ||
|
||||
__put_user(txc.shift, &utp->shift) ||
|
||||
__put_user(txc.stabil, &utp->stabil) ||
|
||||
__put_user(txc.jitcnt, &utp->jitcnt) ||
|
||||
__put_user(txc.calcnt, &utp->calcnt) ||
|
||||
__put_user(txc.errcnt, &utp->errcnt) ||
|
||||
__put_user(txc.stbcnt, &utp->stbcnt))
|
||||
ret = -EFAULT;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* This is just a version for 32-bit applications which does
|
||||
* not force O_LARGEFILE on.
|
||||
*/
|
||||
|
@@ -63,7 +63,7 @@ sys_call_table32:
|
||||
/*200*/ .word sys32_ssetmask, sys_sigsuspend, compat_sys_newlstat, sys_uselib, compat_sys_old_readdir
|
||||
.word sys32_readahead, sys32_socketcall, sys32_syslog, sys32_lookup_dcookie, sys32_fadvise64
|
||||
/*210*/ .word sys32_fadvise64_64, sys32_tgkill, sys32_waitpid, sys_swapoff, sys32_sysinfo
|
||||
.word sys32_ipc, sys32_sigreturn, sys_clone, sys32_ioprio_get, sys32_adjtimex
|
||||
.word sys32_ipc, sys32_sigreturn, sys_clone, sys32_ioprio_get, compat_sys_adjtimex
|
||||
/*220*/ .word sys32_sigprocmask, sys_ni_syscall, sys32_delete_module, sys_ni_syscall, sys32_getpgid
|
||||
.word sys32_bdflush, sys32_sysfs, sys_nis_syscall, sys32_setfsuid16, sys32_setfsgid16
|
||||
/*230*/ .word sys32_select, compat_sys_time, sys_nis_syscall, compat_sys_stime, compat_sys_statfs64
|
||||
|
Reference in New Issue
Block a user