From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756962AbbCGJSp (ORCPT ); Sat, 7 Mar 2015 04:18:45 -0500 Received: from mail-wi0-f170.google.com ([209.85.212.170]:35990 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751777AbbCGJSl (ORCPT ); Sat, 7 Mar 2015 04:18:41 -0500 Date: Sat, 7 Mar 2015 10:18:35 +0100 From: Ingo Molnar To: John Stultz Cc: lkml , Dave Jones , Linus Torvalds , Thomas Gleixner , Richard Cochran , Prarit Bhargava , Stephen Boyd , Peter Zijlstra Subject: Re: [PATCH 03/12] clocksource: Remove clocksource_max_deferment() Message-ID: <20150307091835.GA30888@gmail.com> References: <1425696603-16878-1-git-send-email-john.stultz@linaro.org> <1425696603-16878-4-git-send-email-john.stultz@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1425696603-16878-4-git-send-email-john.stultz@linaro.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * John Stultz 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