ipc/compat: convert to COMPAT_SYSCALL_DEFINE

Convert all compat system call functions where all parameter types
have a size of four or less than four bytes, or are pointer types
to COMPAT_SYSCALL_DEFINE.
The implicit casts within COMPAT_SYSCALL_DEFINE will perform proper
zero and sign extension to 64 bit of all parameters if needed.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
This commit is contained in:
Heiko Carstens 2014-03-04 11:17:50 +01:00
parent 625b1d7e81
commit 5d70a59637
2 changed files with 13 additions and 12 deletions

View File

@ -498,7 +498,7 @@ static inline int put_compat_msqid_ds(struct msqid64_ds *m,
return err; return err;
} }
long compat_sys_msgctl(int first, int second, void __user *uptr) COMPAT_SYSCALL_DEFINE3(msgctl, int, first, int, second, void __user *, uptr)
{ {
int err, err2; int err, err2;
struct msqid64_ds m64; struct msqid64_ds m64;
@ -668,7 +668,7 @@ static inline int put_compat_shm_info(struct shm_info __user *ip,
return err; return err;
} }
long compat_sys_shmctl(int first, int second, void __user *uptr) COMPAT_SYSCALL_DEFINE3(shmctl, int, first, int, second, void __user *, uptr)
{ {
void __user *p; void __user *p;
struct shmid64_ds s64; struct shmid64_ds s64;
@ -749,8 +749,9 @@ long compat_sys_shmctl(int first, int second, void __user *uptr)
return err; return err;
} }
long compat_sys_semtimedop(int semid, struct sembuf __user *tsems, COMPAT_SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsems,
unsigned nsops, const struct compat_timespec __user *timeout) unsigned, nsops,
const struct compat_timespec __user *, timeout)
{ {
struct timespec __user *ts64 = NULL; struct timespec __user *ts64 = NULL;
if (timeout) { if (timeout) {

View File

@ -46,9 +46,9 @@ static inline int put_compat_mq_attr(const struct mq_attr *attr,
| __put_user(attr->mq_curmsgs, &uattr->mq_curmsgs); | __put_user(attr->mq_curmsgs, &uattr->mq_curmsgs);
} }
asmlinkage long compat_sys_mq_open(const char __user *u_name, COMPAT_SYSCALL_DEFINE4(mq_open, const char __user *, u_name,
int oflag, compat_mode_t mode, int, oflag, compat_mode_t, mode,
struct compat_mq_attr __user *u_attr) struct compat_mq_attr __user *, u_attr)
{ {
void __user *p = NULL; void __user *p = NULL;
if (u_attr && oflag & O_CREAT) { if (u_attr && oflag & O_CREAT) {
@ -105,8 +105,8 @@ asmlinkage ssize_t compat_sys_mq_timedreceive(mqd_t mqdes,
u_msg_prio, u_ts); u_msg_prio, u_ts);
} }
asmlinkage long compat_sys_mq_notify(mqd_t mqdes, COMPAT_SYSCALL_DEFINE2(mq_notify, mqd_t, mqdes,
const struct compat_sigevent __user *u_notification) const struct compat_sigevent __user *, u_notification)
{ {
struct sigevent __user *p = NULL; struct sigevent __user *p = NULL;
if (u_notification) { if (u_notification) {
@ -122,9 +122,9 @@ asmlinkage long compat_sys_mq_notify(mqd_t mqdes,
return sys_mq_notify(mqdes, p); return sys_mq_notify(mqdes, p);
} }
asmlinkage long compat_sys_mq_getsetattr(mqd_t mqdes, COMPAT_SYSCALL_DEFINE3(mq_getsetattr, mqd_t, mqdes,
const struct compat_mq_attr __user *u_mqstat, const struct compat_mq_attr __user *, u_mqstat,
struct compat_mq_attr __user *u_omqstat) struct compat_mq_attr __user *, u_omqstat)
{ {
struct mq_attr mqstat; struct mq_attr mqstat;
struct mq_attr __user *p = compat_alloc_user_space(2 * sizeof(*p)); struct mq_attr __user *p = compat_alloc_user_space(2 * sizeof(*p));