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] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 25 Mar 2009 15:41:11 +1030
From:	Rusty Russell <rusty@...tcorp.com.au>
To:	Nikanth Karthikesan <knikanth@...ell.com>
Cc:	nikanth@...il.com, linux-kernel@...r.kernel.org
Subject: Re: Strange code in include/linux/cpumask.h

On Wednesday 25 March 2009 15:21:13 Nikanth Karthikesan wrote:
> Hi Rusty
> 
> I do not understand this code.

Hi Nikanth,

   That's OK, it's a little tricky.

> The conditional operator would always evaluates to true and return bitmap. So 
> all it seems to does is
> #define to_cpumansk(bitmap) (struct cpumask *)(bitmap)

Yes, except that this insists that bitmap be an unsigned long * or you'll get
a warning.  Otherwise the macro could be used on anything.  And it needs to be
a macro to use it as a static initializer.

As the NR_CPUS bit arrays vanish, this macro will be used less and less; but
some of them will probably take a while.

Thanks for the question,
Rusty.
--
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