Re: [PATCH 01/40] clkdev: add clkname to struct clk_lookup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

On Fri, Apr 13, 2012 at 03:32:43PM +0530, Viresh Kumar wrote:
> On 4/13/2012 3:06 PM, Russell King - ARM Linux wrote:
> > You're not convincing me that you're approach here is correct, and
> 
> :(
> 
> > I really doubt that this will have any effect at saving lines of code -
> > your argument list is soo long that you'll have to wrap it onto several
> > lines.
> 
> There are two ways here:
> 1. Leave clk_register() untouched and create lookups in machine code.
> 2. change clk_register():
> 	A. pass all arguments as i mentioned in my patch
> 	B. pass structure instead of all so many args.
> 
> Option 2 will have much lesser code than option 1, with both option A & B.
> In option 2.A.: we can create separate registration routines to save extra
> arguments passed, like:
> 
>  struct clk *clk_register_gate(struct device *dev, const char *name,
>  		const char *parent_name, unsigned long flags,
>  		void __iomem *reg, u8 bit_idx,
> 		u8 clk_gate_flags, spinlock_t *lock, struct clk_lookup **cl,
> 		const char *dev_id, const char *con_id);

So you're going to have something around 4-5 lines of arguments per
function call to use this function.  That's not elegant, that's not
easy to use, that's not nice.  And I doubt that it really solves any
code space concern because the compiler will have to store pointers
and values somewhere, and shuffle those into registers and onto the
stack for every function call using additional code to do that.

I really don't get why you think this is an improvement.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel


[Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [PDAs]     [Linux]     [Linux MIPS]     [Yosemite Campsites]     [Photos]

Add to Google Follow linuxarm on Twitter