linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Gustavo Padovan <gustavo@padovan.org>
To: linuxppc-dev@lists.ozlabs.org
Cc: linux-kernel@vger.kernel.org,
	Gustavo Padovan <gustavo.padovan@collabora.co.uk>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Michael Ellerman <mpe@ellerman.id.au>
Subject: [PATCH] powerpc: rename to_user_ptr to __to_user_ptr
Date: Thu, 17 Mar 2016 17:18:23 -0300	[thread overview]
Message-ID: <1458245903-3937-1-git-send-email-gustavo@padovan.org> (raw)

From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

to_user_ptr() is a local macro defined by signal_32.c, rename it to
__to_user_ptr() as now we will have a global to_user_ptr() defined by
kernel.h that has a different meaning from this one.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
---
 arch/powerpc/kernel/signal_32.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
index b6aa378..558acd6 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -129,8 +129,8 @@ static inline int get_sigset_t(sigset_t *set,
 	return 0;
 }
 
-#define to_user_ptr(p)		ptr_to_compat(p)
-#define from_user_ptr(p)	compat_ptr(p)
+#define __to_user_ptr(p)	ptr_to_compat(p)
+#define __from_user_ptr(p)	compat_ptr(p)
 
 static inline int save_general_regs(struct pt_regs *regs,
 		struct mcontext __user *frame)
@@ -178,8 +178,8 @@ static inline int get_sigset_t(sigset_t *set, const sigset_t __user *uset)
 	return copy_from_user(set, uset, sizeof(*uset));
 }
 
-#define to_user_ptr(p)		((unsigned long)(p))
-#define from_user_ptr(p)	((void __user *)(p))
+#define __to_user_ptr(p)	((unsigned long)(p))
+#define __from_user_ptr(p)	((void __user *)(p))
 
 static inline int save_general_regs(struct pt_regs *regs,
 		struct mcontext __user *frame)
@@ -992,7 +992,7 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset,
 	if (copy_siginfo_to_user(&rt_sf->info, &ksig->info)
 	    || __put_user(0, &rt_sf->uc.uc_flags)
 	    || __save_altstack(&rt_sf->uc.uc_stack, regs->gpr[1])
-	    || __put_user(to_user_ptr(&rt_sf->uc.uc_mcontext),
+	    || __put_user(__to_user_ptr(&rt_sf->uc.uc_mcontext),
 		    &rt_sf->uc.uc_regs)
 	    || put_sigset_t(&rt_sf->uc.uc_sigmask, oldset))
 		goto badframe;
@@ -1181,7 +1181,7 @@ long sys_swapcontext(struct ucontext __user *old_ctx,
 		if (!access_ok(VERIFY_WRITE, old_ctx, ctx_size)
 		    || save_user_regs(regs, mctx, NULL, 0, ctx_has_vsx_region)
 		    || put_sigset_t(&old_ctx->uc_sigmask, &current->blocked)
-		    || __put_user(to_user_ptr(mctx), &old_ctx->uc_regs))
+		    || __put_user(__to_user_ptr(mctx), &old_ctx->uc_regs))
 			return -EFAULT;
 	}
 	if (new_ctx == NULL)
@@ -1414,14 +1414,14 @@ int handle_signal32(struct ksignal *ksig, sigset_t *oldset, struct pt_regs *regs
 #if _NSIG != 64
 #error "Please adjust handle_signal()"
 #endif
-	if (__put_user(to_user_ptr(ksig->ka.sa.sa_handler), &sc->handler)
+	if (__put_user(__to_user_ptr(ksig->ka.sa.sa_handler), &sc->handler)
 	    || __put_user(oldset->sig[0], &sc->oldmask)
 #ifdef CONFIG_PPC64
 	    || __put_user((oldset->sig[0] >> 32), &sc->_unused[3])
 #else
 	    || __put_user(oldset->sig[1], &sc->_unused[3])
 #endif
-	    || __put_user(to_user_ptr(&frame->mctx), &sc->regs)
+	    || __put_user(__to_user_ptr(&frame->mctx), &sc->regs)
 	    || __put_user(ksig->sig, &sc->signal))
 		goto badframe;
 
@@ -1526,7 +1526,7 @@ long sys_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
 	} else
 #endif
 	{
-		sr = (struct mcontext __user *)from_user_ptr(sigctx.regs);
+		sr = (struct mcontext __user *)__from_user_ptr(sigctx.regs);
 		addr = sr;
 		if (!access_ok(VERIFY_READ, sr, sizeof(*sr))
 		    || restore_user_regs(regs, sr, 1))
-- 
2.5.0

             reply	other threads:[~2016-03-17 20:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-17 20:18 Gustavo Padovan [this message]
2016-03-17 22:11 ` [PATCH] powerpc: rename to_user_ptr to __to_user_ptr Gustavo Padovan

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=1458245903-3937-1-git-send-email-gustavo@padovan.org \
    --to=gustavo@padovan.org \
    --cc=benh@kernel.crashing.org \
    --cc=gustavo.padovan@collabora.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    /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;
as well as URLs for NNTP newsgroup(s).