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: <50ABEA52.6070405@wwwdotorg.org>
Date:	Tue, 20 Nov 2012 13:38:42 -0700
From:	Stephen Warren <swarren@...dotorg.org>
To:	Josh Cartwright <josh.cartwright@...il.com>
CC:	John Stultz <johnstul@...ibm.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>,
	Stephen Warren <swarren@...dia.com>,
	Arnd Bergmann <arnd@...db.de>, linux-kernel@...r.kernel.org,
	linux-tegra@...r.kernel.org, Olof Johansson <olof@...om.net>,
	linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH V3 1/2] clocksource: add common of_clksrc_init() function

On 11/20/2012 01:10 PM, Josh Cartwright wrote:
> On Tue, Nov 20, 2012 at 12:20:05PM -0700, Stephen Warren wrote:
>> From: Stephen Warren <swarren@...dia.com>
>>
>> It is desirable to move all clocksource drivers to drivers/clocksource,
>> yet each requires its own initialization function. We'd rather not
>> pollute <linux/> with a header for each function. Instead, create a
>> single of_clksrc_init() function which will determine which clocksource
>> driver to initialize based on device tree.
>>
>> Inspired by a similar patch for drivers/irqchip by Thomas Petazzoni.
>>
>> Signed-off-by: Stephen Warren <swarren@...dia.com>
>> ---
>> v3: Use a linker section to replace manually maintained table.
>> v2: New patch.
>>
> [..]
>> --- /dev/null
>> +++ b/drivers/clocksource/clksrc-of.c

>> +void __init clocksource_of_init(void)
...
>> +	for ( ; table < stop; table++) {
>> +		for_each_matching_node(np, *table) {
>> +			match = of_match_node(*table, np);
>> +			init_func = match->data;
>> +			init_func();
> 
> Hmm.  Am I crazy, or does this for_each_matching_node()/of_match_node()
> pattern end up walking the match table twice, unnecessarily?

Yes, that's true.

> I'm wondering if we can come up with a for_each_matching_node_id() macro
> that also provides a pointer to the matching of_device_id...

Good idea; I'll do that.
--
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