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]
Message-ID: <alpine.LFD.2.00.0901081227360.3283@localhost.localdomain>
Date:	Thu, 8 Jan 2009 12:33:38 -0800 (PST)
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	David Daney <ddaney@...iumnetworks.com>
cc:	rusty@...tcorp.com.au, linux-kernel@...r.kernel.org,
	linux-mips@...ux-mips.org
Subject: Re: [PATCH] cpumask fallout: Initialize irq_default_affinity
 earlier.



On Thu, 8 Jan 2009, David Daney wrote:
>  
> +#ifdef CONFIG_SMP
> +	init_irq_default_affinity();
> +#endif

Don't do this. It's horrible. It makes the code much harder to read.

What's so wrong with initializing affinity on UP? It's still conceptually 
a fine thing to do, although it's obviously trivially a no-op.

Also, since it's only used in "handle.c", why not just move it there? 
Then, just make it static, and make it a no-op for the non-SMP case. Ok?

In fact, I think it already is a no-op in the UP case, and you can 
literally just do

	static inline void __init init_irq_default_affinity(void)
	{
	 	alloc_cpumask_var(&irq_default_affinity, GFP_KERNEL);
	 	cpumask_setall(irq_default_affinity);
	}

and be done with it. I think it should all compile away to nothing if 
CONFIG_SMP isn't set.

			Linus
--
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