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, 20 May 2015 21:46:45 +0100
From:	Russell King - ARM Linux <linux@....linux.org.uk>
To:	Suravee Suthikulanit <suravee.suthikulpanit@....com>
Cc:	Catalin Marinas <catalin.marinas@....com>,
	Arnd Bergmann <arnd@...db.de>, thomas.lendacky@....com,
	herbert@...dor.apana.org.au, al.stone@...aro.org,
	linaro-acpi@...ts.linaro.org, netdev@...r.kernel.org,
	will.deacon@....com, linux-kernel@...r.kernel.org,
	Rob Herring <robh+dt@...nel.org>, davem@...emloft.net,
	linux-acpi@...r.kernel.org, Murali Karicheri <m-karicheri2@...com>,
	"Rafael J. Wysocki" <rjw@...ysocki.net>, hanjun.guo@...aro.org,
	msalter@...hat.com, grant.likely@...aro.org, leo.duran@....com,
	lenb@...nel.org, bhelgaas@...gle.com,
	David Woodhouse <dwmw2@...radead.org>,
	linux-arm-kernel@...ts.infradead.org, linux-crypto@...r.kernel.org
Subject: Re: [V4 PATCH 3/6] pci: Generic function for setting up PCI device
 DMA coherency

On Wed, May 20, 2015 at 07:00:25AM -0500, Suravee Suthikulanit wrote:
> On 5/20/2015 4:34 AM, Catalin Marinas wrote:
> >We have a dummy of_dma_configure() already when !CONFIG_OF, otherwise
> >we would need #ifndef here. I already replied, I think for other
> >architectures we need this check to avoid a useless host->of_node test.
> 
> It seems that there are several places that have similar check. Would it be
> good to convert this into a macro? Something like:
> 
> #define OF_NODE_ENABLED(dev)	(IS_ENABLED(CONFIG_OF) && dev->of_node)

This /could/ be a useful compile-time optimisation: when CONFIG_OF is
disabled, dev->of_node exists but will always be NULL - but the
compiler doesn't know this.  Your suggestion above would tell the
compiler that when CONFIG_OF is disabled, OF_NODE_ENABLED() will
evaluate to a constant false, which means it can eliminate code.

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ