[PATCH v6] clocksource:arm_global_timer: Add ARM global timer support.

Thomas Gleixner tglx at linutronix.de
Wed Jun 26 00:00:25 EST 2013


On Tue, 25 Jun 2013, Srinivas KANDAGATLA wrote:
> On 25/06/13 14:17, Thomas Gleixner wrote:
> > On Tue, 25 Jun 2013, Srinivas KANDAGATLA wrote:
> >> +static void gt_compare_set(unsigned long delta, int periodic)
> >> +{
> >> +	u64 counter = gt_counter_read();
> >> +	unsigned long ctrl = readl(gt_base + GT_CONTROL);
> > 
> > Why are you reading the control register back over and over? All you
> > need to preserve is the GT_CONTROL_TIMER_ENABLE bit. So you can spare
> > that read out and just do
> > 
> > 	ctrl = GT_CONTROL_TIMER_ENABLE;
> > 	writel(ctrl, gt_base + GT_CONTROL);
> 
> Logically you are right we could do as you suggested, However its not
> implicit that which bits are going to be cleared. Its more to do with
> readability of the code.
> If you still insist I can change it.

I'm not insisting. I just pointed out, that you can save cycles in a
hotpath. :)

Thanks,

	tglx


More information about the devicetree-discuss mailing list