linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: Jiri Kosina <jkosina@suse.cz>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] powerpc: fix personality handling in ppc64_personality()
Date: Thu, 02 Aug 2012 00:19:27 +0200	[thread overview]
Message-ID: <m27gtitfv4.fsf@igel.home> (raw)
In-Reply-To: <alpine.LNX.2.00.1208012201520.14910@pobox.suse.cz> (Jiri Kosina's message of "Wed, 1 Aug 2012 22:03:42 +0200 (CEST)")

Jiri Kosina <jkosina@suse.cz> writes:

>  	if (personality(current->personality) == PER_LINUX32
> -	    && personality == PER_LINUX)
> -		personality = PER_LINUX32;
> +	    && personality(personality) == PER_LINUX)
> +		personality &= ~PER_LINUX | PER_LINUX32;

That doesn't work.  ~PER_LINUX is -1, so this is a no-op.

>  	ret = sys_personality(personality);
> -	if (ret == PER_LINUX32)
> -		ret = PER_LINUX;
> +	if (personality(ret) == PER_LINUX32)
> +		ret &= ~PER_LINUX32 | PER_LINUX;

That only "works" because PER_LINUX is 0.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

  reply	other threads:[~2012-08-01 22:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-01 20:03 [PATCH] powerpc: fix personality handling in ppc64_personality() Jiri Kosina
2012-08-01 22:19 ` Andreas Schwab [this message]
2012-08-02  7:10   ` [PATCH v2] " Jiri Kosina
2012-09-05  2:54     ` Benjamin Herrenschmidt
2012-09-05  8:56       ` Jiri Kosina
2012-09-05 21:13         ` Benjamin Herrenschmidt
2012-09-06  8:46           ` Jiri Kosina

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=m27gtitfv4.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=benh@kernel.crashing.org \
    --cc=jkosina@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --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).