public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Siddha, Suresh B" <suresh.b.siddha@intel.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: "Siddha, Suresh B" <suresh.b.siddha@intel.com>,
	Andrew Morton <akpm@osdl.org>,
	mbligh@mbligh.org, linux-kernel@vger.kernel.org,
	apw@shadowen.org
Subject: Re: [patch] sched: fix macro -> inline function conversion bug
Date: Wed, 5 Jul 2006 14:21:04 -0700	[thread overview]
Message-ID: <20060705142104.C7271@unix-os.sc.intel.com> (raw)
In-Reply-To: <20060705211702.GA24961@elte.hu>; from mingo@elte.hu on Wed, Jul 05, 2006 at 11:17:02PM +0200

On Wed, Jul 05, 2006 at 11:17:02PM +0200, Ingo Molnar wrote:
> 
> * Siddha, Suresh B <suresh.b.siddha@intel.com> wrote:
> 
> > On Wed, Jul 05, 2006 at 10:02:45PM +0200, Ingo Molnar wrote:
> > > 
> > > * Siddha, Suresh B <suresh.b.siddha@intel.com> wrote:
> > > 
> > > > -		if (sd && sd->flags & flag)
> > > > +		if (sd && !(sd->flags & flag))
> > > 
> > > use test_sd_flag() here, as i did in my fix patch.
> > > 
> > > > -#define test_sd_flag(sd, flag)	((sd && sd->flags & flag) ? 1 : 0)
> > > > +#define test_sd_flag(sd, flag)	((sd && (sd->flags & flag)) ? 1 : 0)
> > > 
> > > remove the 'sd' check in test_sd_flag. In the other cases we know that 
> > > there's an sd. (it's usually a sign of spaghetti code if tests like this 
> > > include a check for the existence of the object checked)
> > 
> > In other cases, we are passing sd->parent as the first argument to 
> > test_sd_flag(). We know that there is a 'sd' but not sure about 
> > sd->parent or sd->child.
> 
> ok. But the first issue above should be fixed.

I can't simply change it to test_sd_flag(). In sched_balance_self(), paths for
sd == 0 and a 'flag' not set in sd->flags are different.

I can change that piece of code to (sd && !test_sd_flag(sd, flag)) though..
but that is not clean, right?

thanks,
suresh

  reply	other threads:[~2006-07-05 21:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-02 23:27 2.6.17-mm5 Martin J. Bligh
2006-07-02 23:41 ` 2.6.17-mm5 Andrew Morton
2006-07-03  5:25   ` [patch] sched: fix macro -> inline function conversion bug Ingo Molnar
2006-07-03  5:42     ` Andrew Morton
2006-07-03  6:03       ` Ingo Molnar
2006-07-03  6:08         ` Ingo Molnar
2006-07-05 19:36           ` Siddha, Suresh B
2006-07-05 20:02             ` Ingo Molnar
2006-07-05 21:09               ` Siddha, Suresh B
2006-07-05 21:17                 ` Ingo Molnar
2006-07-05 21:21                   ` Siddha, Suresh B [this message]
2006-07-06  8:27             ` Andy Whitcroft
2006-07-03  6:06       ` Peter Williams
2006-07-03  8:23   ` 2.6.17-mm5 Andy Whitcroft
2006-07-03 14:19     ` 2.6.17-mm5 Andy Whitcroft

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=20060705142104.C7271@unix-os.sc.intel.com \
    --to=suresh.b.siddha@intel.com \
    --cc=akpm@osdl.org \
    --cc=apw@shadowen.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbligh@mbligh.org \
    --cc=mingo@elte.hu \
    /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