mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Chubb <peterc@gelato.unsw.edu.au>
To: John Keller <jpk@sgi.com>
Cc: linux-kernel@vger.kernel.org, akpm@osdl.org, steiner@sgi.com,
	linux-ia64@vger.kernel.org
Subject: Re: [PATCH Resend] - SN: validate smp_affinity mask on intr redirect
Date: Wed, 09 May 2007 09:01:44 +1000	[thread overview]
Message-ID: <871whqapif.wl%peterc@chubb.wattle.id.au> (raw)
In-Reply-To: <20070508152315.26329.8428.64771@attica.americas.sgi.com>


Jack>  }
Jack> +
Jack> +bool is_affinity_mask_valid(cpumask_t cpumask)
Jack> +{
Jack> +	if (ia64_platform_is("sn2")) {
Jack> +		/* Only allow one CPU to be specified in the smp_affinity mask */
Jack> +		if (cpus_weight(cpumask) != 1)
Jack> +			return false;

Why not just:
		return cpus_weight(cpumask) == 1;


It's a Boolean; treat it as one.
(If you thought the average kernel programmer (who's s/he?) understood
the logical implication rule it could be:
	return !ia64_platform_is("sn2") || cpus_weight(cpumask) == 1;
)
--
Dr Peter Chubb  http://www.gelato.unsw.edu.au  peterc AT gelato.unsw.edu.au
http://www.ertos.nicta.com.au           ERTOS within National ICT Australia


      parent reply	other threads:[~2007-05-08 23:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-08 15:23 John Keller
2007-05-08 18:03 ` Luck, Tony
2007-05-08 19:19   ` Andrew Morton
2007-05-08 20:14     ` Luck, Tony
2007-05-08 20:34       ` Andrew Morton
2007-05-08 22:14         ` [PATCH Resend] - SN: validate smp_affinity mask on intr John Keller
2007-05-08 23:01 ` Peter Chubb [this message]

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=871whqapif.wl%peterc@chubb.wattle.id.au \
    --to=peterc@gelato.unsw.edu.au \
    --cc=akpm@osdl.org \
    --cc=jpk@sgi.com \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=steiner@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®