[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150307091835.GA30888@gmail.com>
Date: Sat, 7 Mar 2015 10:18:35 +0100
From: Ingo Molnar <mingo@...nel.org>
To: John Stultz <john.stultz@...aro.org>
Cc: lkml <linux-kernel@...r.kernel.org>,
Dave Jones <davej@...emonkey.org.uk>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Richard Cochran <richardcochran@...il.com>,
Prarit Bhargava <prarit@...hat.com>,
Stephen Boyd <sboyd@...eaurora.org>,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH 03/12] clocksource: Remove clocksource_max_deferment()
* John Stultz <john.stultz@...aro.org> wrote:
> clocksource_max_deferment() doesn't do anything useful
> anymore, so zap it.
Well, it does something useful, it encapsulates the max_deferment
property of the clocksource:
> -static u64 clocksource_max_deferment(struct clocksource *cs)
> -{
> - u64 max_nsecs;
> -
> - max_nsecs = clocks_calc_max_nsecs(cs->mult, cs->shift, cs->maxadj,
> - cs->mask);
> - return max_nsecs;
> -}
Which could be written in a shorter form, using:
static u64 clocksource_max_deferment(struct clocksource *cs)
{
return clocks_calc_max_nsecs(cs->mult, cs->shift, cs->maxadj, cs->mask);
}
Which all allows short forms of:
cs->max_idle_ns = clocksource_max_deferment(cs);
without writing out all the arguments.
Instead of that, you've introduced:
> + cs->max_idle_ns = clocks_calc_max_nsecs(cs->mult, cs->shift,
> + cs->maxadj, cs->mask);
> + cs->max_idle_ns = clocks_calc_max_nsecs(cs->mult, cs->shift,
> + cs->maxadj, cs->mask);
Which in the next patch gets even worse:
> cs->max_idle_ns = clocks_calc_max_nsecs(cs->mult, cs->shift,
> + cs->maxadj, cs->mask,
> + &cs->max_cycles);
> /* calculate max idle time permitted for this clocksource */
> cs->max_idle_ns = clocks_calc_max_nsecs(cs->mult, cs->shift,
> + cs->maxadj, cs->mask,
> + &cs->max_cycles);
While with the helper function it would still be the same sweet:
cs->max_idle_ns = clocksource_max_deferment(cs);
So I don't think this cleanup is an improvement ...
Thanks,
Ingo
--
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