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:	Tue, 7 Apr 2009 07:50:38 -0700 (PDT)
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Ingo Molnar <mingo@...e.hu>
cc:	David Woodhouse <dwmw2@...radead.org>,
	iommu@...ts.linux-foundation.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] intel-iommu: fix build with CONFIG_BRANCH_TRACER=y



On Tue, 7 Apr 2009, Ingo Molnar wrote:
> 
> Switch it to a braced group statement.

No, the way to do that is to just clean it up (or in the worst case just 
add another set of parenthesis, not a statement expression).

That said, whoever made "if()" a macro should be shot. That 
PROFILE_ALL_BRANCHES thing is crazy, crazy.

Anyway, in this case, I think

>  #define for_each_active_iommu(i, drhd)					\
>  	list_for_each_entry(drhd, &dmar_drhd_units, list)		\
> -		if (i=drhd->iommu, drhd->ignored) {} else
> +		if (({i=drhd->iommu, drhd->ignored;})) {} else

Just do it like

	if ( (i=drhd->iommu, drhd->ignored) ) {} else

is still not pretty, but better than using ({..}) I think. And just a 
single set of parenthesis will protect the macro expansion.

But that '#define if(cond)' for the branch profiling is really the core 
problem there. Wow. I never realized quite _how_ ugly tricks it played.

		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