[PATCH] CLKDEV: Add helper routines to allocate and add clkdevs for given struct clk *

Viresh Kumar viresh.kumar at st.com
Mon Apr 16 23:39:15 EDT 2012


On 4/17/2012 2:21 AM, s.hauer at pengutronix.de wrote:
>>> > > +struct clk_lookup * __init_refok
>>> > > +clkdev_alloc(struct clk *clk, const char *con_id, const char *dev_fmt, ...)
>>> > > +{
>>> > > +	struct clk_lookup * cl;
>>> > > +	va_list ap = NULL;

>> > so I finally tested it with this modification:
>> > 
>> > 	if (dev_fmt) {
>> > 		va_start(ap, dev_fmt);
>> > 		cl = clkdev_alloc_valist(clk, con_id, dev_fmt, ap);
>> > 		va_end(ap);
>> > 	} else
>> > 		cl = clkdev_alloc(clk, con_id, NULL);

> Same here. The correct fix is simply not to initialize ap.

As this will turn into an infinite loop, we can simple pass ap instead
of NULL in the earlier implementation. As clkdev_alloc_valist() always
checks dev_fmt before accessing ap, it will work fine.

-- 
viresh



More information about the linux-arm-kernel mailing list