Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934336AbbDVPMU (ORCPT ); Wed, 22 Apr 2015 11:12:20 -0400 Received: from hofr.at ([212.69.189.236]:51555 "EHLO mail.hofr.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934312AbbDVPMQ (ORCPT ); Wed, 22 Apr 2015 11:12:16 -0400 Date: Wed, 22 Apr 2015 17:12:14 +0200 From: Nicholas Mc Guire To: Joe Perches Cc: Thomas Gleixner , Nicholas Mc Guire , Michal Marek , Masahiro Yamada , Sam Ravnborg , "H. Peter Alvin" , John Stultz , Andrew Hunter , Paul Turner , Aaron Sierra , Brian Norris , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3 V2] time: allow gcc to fold constants when using Message-ID: <20150422151214.GA3464@opentech.at> References: <1428840815-21974-1-git-send-email-hofrat@osadl.org> <1428840815-21974-3-git-send-email-hofrat@osadl.org> <1429712309.32612.10.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1429712309.32612.10.camel@perches.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1465 Lines: 42 On Wed, 22 Apr 2015, Joe Perches wrote: > On Wed, 2015-04-22 at 14:00 +0200, Thomas Gleixner wrote: > > On Sun, 12 Apr 2015, Nicholas Mc Guire wrote: > > > +extern unsigned long __msecs_to_jiffies(const unsigned int m); > > > +#if HZ <= MSEC_PER_SEC && !(MSEC_PER_SEC % HZ) > > > +static inline unsigned long _msecs_to_jiffies(const unsigned int m) > > > +{ > > > > This should move the comments explaining the logic for each variant as > > well. > [] > > It'd be nice to have this as two patches: > > > > 1) Factor out the code into inline helpers w/o adding anything > > It also might be nice to use a single static inline > with #ifdef blocks inside that inline rather than > have 3 separate static inline msecs_to_jiffies. That was actually intentional to make it more readable - atleast I thought its more readable this way than it was before. > > > 2) Add the __builtin_constant_p() check > > And please add the usecs_to_jiffies variants in a > similar patch set. > yup - as soon as its clean for msecs_to_jiffies applying the same refactoring for usecs_to_jiffies is streight forward so basically just waiting for the feedback on the first one before pushing the usecs_to_jiffies case out. thx! hofrat -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/