All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Jones <davej@redhat.com>
To: roel <12o3l@tiscali.nl>
Cc: travis@sgi.com, Andrew Morton <akpm@linux-foundation.org>,
	Andi Kleen <ak@suse.de>, Christoph Lameter <clameter@sgi.com>,
	Jack Steiner <steiner@sgi.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] x86: Convert cpuinfo_x86 array to a per_cpu array v3
Date: Mon, 24 Sep 2007 20:31:27 -0400	[thread overview]
Message-ID: <20070925003127.GQ11455@redhat.com> (raw)
In-Reply-To: <46F85431.1020306@tiscali.nl>

On Tue, Sep 25, 2007 at 02:20:01AM +0200, roel wrote:
 
 > >  > >  	if ((c->x86_vendor != X86_VENDOR_AMD) || (c->x86 != 5) ||
 > >  > >  		((c->x86_model != 12) && (c->x86_model != 13)))
 > >  > 
 > >  > while we're at it, we could change this to
 > >  > 
 > >  >   	if (!(c->x86_vendor == X86_VENDOR_AMD && c->x86 == 5 &&
 > >  >   		(c->x86_model == 12 || c->x86_model == 13)))
 > > 
 > > For what purpose?  There's nothing wrong with the code as it stands,
 > > and inverting the tests means we'd have to move a bunch of
 > > code inside the if arm instead of just returning -ENODEV.
 > 
 > It's not inverting the test, so you don't need to move code. It evaluates 
 > the same, only the combined negation is moved to the front. I suggested it
 > to increase clarity, it results in the same assembly language.

I don't see it as being particularly more readable after this change.
In fact, the reverse, as my previous comment implied, I missed the
initial !
Given this code works fine, and there's no discernable gain from
changing it, I'm not particularly enthusiastic about this modification.

	Dave

-- 
http://www.codemonkey.org.uk

WARNING: multiple messages have this Message-ID (diff)
From: Dave Jones <davej@redhat.com>
To: roel <12o3l@tiscali.nl>
Cc: travis@sgi.com, Andrew Morton <akpm@linux-foundation.org>,
	Andi Kleen <ak@suse.de>, Christoph Lameter <clameter@sgi.com>,
	Jack Steiner <steiner@sgi.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] x86: Convert cpuinfo_x86 array to a per_cpu array v3
Date: Mon, 24 Sep 2007 20:31:27 -0400	[thread overview]
Message-ID: <20070925003127.GQ11455@redhat.com> (raw)
In-Reply-To: <46F85431.1020306@tiscali.nl>

On Tue, Sep 25, 2007 at 02:20:01AM +0200, roel wrote:
 
 > >  > >  	if ((c->x86_vendor != X86_VENDOR_AMD) || (c->x86 != 5) ||
 > >  > >  		((c->x86_model != 12) && (c->x86_model != 13)))
 > >  > 
 > >  > while we're at it, we could change this to
 > >  > 
 > >  >   	if (!(c->x86_vendor == X86_VENDOR_AMD && c->x86 == 5 &&
 > >  >   		(c->x86_model == 12 || c->x86_model == 13)))
 > > 
 > > For what purpose?  There's nothing wrong with the code as it stands,
 > > and inverting the tests means we'd have to move a bunch of
 > > code inside the if arm instead of just returning -ENODEV.
 > 
 > It's not inverting the test, so you don't need to move code. It evaluates 
 > the same, only the combined negation is moved to the front. I suggested it
 > to increase clarity, it results in the same assembly language.

I don't see it as being particularly more readable after this change.
In fact, the reverse, as my previous comment implied, I missed the
initial !
Given this code works fine, and there's no discernable gain from
changing it, I'm not particularly enthusiastic about this modification.

	Dave

-- 
http://www.codemonkey.org.uk

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2007-09-25  0:31 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-24 21:08 [PATCH 0/1] x86: Convert cpuinfo_x86 array to a per_cpu array v3 travis
2007-09-24 21:08 ` travis
2007-09-24 21:08 ` [PATCH 1/1] " travis
2007-09-24 21:08   ` travis
2007-09-24 22:01   ` roel
2007-09-24 22:01     ` roel
2007-09-24 23:24     ` Dave Jones
2007-09-24 23:24       ` Dave Jones
2007-09-25  0:20       ` roel
2007-09-25  0:20         ` roel
2007-09-25  0:31         ` Dave Jones [this message]
2007-09-25  0:31           ` Dave Jones
2007-10-16  8:18 ` [PATCH 0/1] " Andrew Morton
2007-10-16  8:18   ` Andrew Morton
2007-08-04  1:15   ` Mike Travis
2007-08-04  1:15     ` Mike Travis
2007-10-16 15:02   ` Christoph Lameter
2007-10-16 15:02     ` Christoph Lameter

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=20070925003127.GQ11455@redhat.com \
    --to=davej@redhat.com \
    --cc=12o3l@tiscali.nl \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=clameter@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=steiner@sgi.com \
    --cc=travis@sgi.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.