Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S969704AbXEHXaY (ORCPT ); Tue, 8 May 2007 19:30:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S969032AbXEHXaI (ORCPT ); Tue, 8 May 2007 19:30:08 -0400 Received: from mx.chubb.wattle.id.au ([66.29.2.6]:1572 "EHLO mx.chubb.wattle.id.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968880AbXEHXaG (ORCPT ); Tue, 8 May 2007 19:30:06 -0400 X-Greylist: delayed 1667 seconds by postgrey-1.27 at vger.kernel.org; Tue, 08 May 2007 19:30:06 EDT Date: Wed, 09 May 2007 09:01:44 +1000 Message-ID: <871whqapif.wl%peterc@chubb.wattle.id.au> From: Peter Chubb To: John Keller Cc: linux-kernel@vger.kernel.org, akpm@osdl.org, steiner@sgi.com, linux-ia64@vger.kernel.org In-Reply-To: <20070508152315.26329.8428.64771@attica.americas.sgi.com> References: <20070508152315.26329.8428.64771@attica.americas.sgi.com> User-Agent: Wanderlust/2.15.5 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 MULE XEmacs/21.4 (patch 20) (Double Solitaire) (x86_64-linux-gnu) X-Face: GgFg(Z>fx((4\32hvXq<)|jndSniCH~~$D)Ka:P@e@JR1P%Vr}EwUdfwf-4j\rUs#JR{'h# !]])6%Jh~b$VA|ALhnpPiHu[-x~@<"@Iv&|%R)Fq[[,(&Z'O)Q)xCqe1\M[F8#9l8~}#u$S$Rm`S9% \'T@`:&8>Sb*c5d'=eDYI&GF`+t[LfDH="MP5rwOO]w>ALi7'=QJHz&y&C&TE_3j! MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") X-SA-Exim-Connect-IP: 203.143.174.122 X-SA-Exim-Rcpt-To: jpk@sgi.com, linux-kernel@vger.kernel.org, akpm@osdl.org, steiner@sgi.com, linux-ia64@vger.kernel.org X-SA-Exim-Mail-From: peterc@chubb.wattle.id.au Subject: Re: [PATCH Resend] - SN: validate smp_affinity mask on intr redirect Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Version: 4.2.1 (built Tue, 03 Apr 2007 15:04:56 +0000) X-SA-Exim-Scanned: Yes (on mx.chubb.wattle.id.au) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 923 Lines: 28 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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/