aboutsummaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorStanislav Kinsbursky2013-01-04 17:35:00 -0600
committerLinus Torvalds2013-01-04 18:11:46 -0600
commitb30efe2775ee0a1d911514292579770b214d31c3 (patch)
treed1059fdc2cd3eb2c44a0b4b2b641a63755db850c /ipc
parent85398aa8de1d68f44ff1b5d0ed9ceb2b0c51ce49 (diff)
downloadkernel-common-b30efe2775ee0a1d911514292579770b214d31c3.tar.gz
kernel-common-b30efe2775ee0a1d911514292579770b214d31c3.tar.xz
kernel-common-b30efe2775ee0a1d911514292579770b214d31c3.zip
ipc: convert prepare_copy() from macro to function
This code works if CONFIG_CHECKPOINT_RESTORE is disabled. [akpm@linux-foundation.org: remove __maybe_unused] Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: James Morris <jmorris@namei.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'ipc')
-rw-r--r--ipc/msg.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/ipc/msg.c b/ipc/msg.c
index 7a20536c3a5..038a7d79eb0 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -803,8 +803,15 @@ static inline void free_copy(struct msg_msg *copy)
803 free_msg(copy); 803 free_msg(copy);
804} 804}
805#else 805#else
806#define prepare_copy(buf, sz, msgflg, msgtyp, copy_nr) ERR_PTR(-ENOSYS)
807#define fill_copy(copy_nr, msg_nr, msg, copy) NULL 806#define fill_copy(copy_nr, msg_nr, msg, copy) NULL
807
808static inline struct msg_msg *prepare_copy(void __user *buf, size_t bufsz,
809 int msgflg, long *msgtyp,
810 unsigned long *copy_number)
811{
812 return ERR_PTR(-ENOSYS);
813}
814
808static inline void free_copy(struct msg_msg *copy) 815static inline void free_copy(struct msg_msg *copy)
809{ 816{
810} 817}
@@ -819,7 +826,7 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp,
819 int mode; 826 int mode;
820 struct ipc_namespace *ns; 827 struct ipc_namespace *ns;
821 struct msg_msg *copy = NULL; 828 struct msg_msg *copy = NULL;
822 unsigned long __maybe_unused copy_number; 829 unsigned long copy_number = 0;
823 830
824 if (msqid < 0 || (long) bufsz < 0) 831 if (msqid < 0 || (long) bufsz < 0)
825 return -EINVAL; 832 return -EINVAL;