public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Stanislav Kinsbursky <skinsbursky@parallels.com>
Cc: ebiederm@xmission.com, devel@openvz.org,
	linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk,
	jmorris@namei.org
Subject: Re: [PATCH 2/4] ipc: convert prepare_copy() from macro to function
Date: Wed, 7 Nov 2012 11:20:16 -0800	[thread overview]
Message-ID: <20121107112016.d9321efe.akpm@linux-foundation.org> (raw)
In-Reply-To: <20121107100500.22846.143.stgit@localhost.localdomain>

On Wed, 07 Nov 2012 13:05:00 +0300
Stanislav Kinsbursky <skinsbursky@parallels.com> wrote:

> This code works if CONFIG_CHECKPOINT_RESTORE is disabled.
> 
> ...
>
> --- a/ipc/msg.c
> +++ b/ipc/msg.c
> @@ -803,8 +803,15 @@ static inline void free_copy(struct msg_msg *copy)
>  		free_msg(copy);
>  }
>  #else
> -#define prepare_copy(buf, sz, msgflg, msgtyp, copy_nr)	ERR_PTR(-ENOSYS)
>  #define fill_copy(copy_nr, msg_nr, msg, copy)		NULL
> +
> +static inline struct msg_msg *prepare_copy(void __user *buf, size_t bufsz,
> +					   int msgflg, long *msgtyp,
> +					   unsigned long *copy_number)
> +{
> +	return ERR_PTR(-ENOSYS);
> +}
> +
>  static inline void free_copy(struct msg_msg *copy)
>  {
>  }
> @@ -819,7 +826,7 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp,
>  	int mode;
>  	struct ipc_namespace *ns;
>  	struct msg_msg *copy = NULL;
> -	unsigned long __maybe_unused copy_number;
> +	unsigned long __maybe_unused copy_number = 0;

The __maybe_unused here makes no sense.  I'll remove it.

>  
>  	if (msqid < 0 || (long) bufsz < 0)
>  		return -EINVAL;

  reply	other threads:[~2012-11-07 19:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-07 10:04 [PATCH 0/4] IPC: CRIU enhancements fixes and cleanup Stanislav Kinsbursky
2012-11-07 10:04 ` [PATCH 1/4] ipc: simplify free_copy() call Stanislav Kinsbursky
2012-11-07 10:05 ` [PATCH 2/4] ipc: convert prepare_copy() from macro to function Stanislav Kinsbursky
2012-11-07 19:20   ` Andrew Morton [this message]
2012-11-07 10:05 ` [PATCH 3/4] ipc: simplify message copying Stanislav Kinsbursky
2012-11-07 10:05 ` [PATCH 4/4] ipc: add more comments to message copying related code Stanislav Kinsbursky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121107112016.d9321efe.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=devel@openvz.org \
    --cc=ebiederm@xmission.com \
    --cc=jmorris@namei.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=skinsbursky@parallels.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox