lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <871whqapif.wl%peterc@chubb.wattle.id.au>
Date:	Wed, 09 May 2007 09:01:44 +1000
From:	Peter Chubb <peterc@...ato.unsw.edu.au>
To:	John Keller <jpk@....com>
Cc:	linux-kernel@...r.kernel.org, akpm@...l.org, steiner@....com,
	linux-ia64@...r.kernel.org
Subject: Re: [PATCH Resend] - SN: validate smp_affinity mask on intr redirect


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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ