Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933132AbbDVOSh (ORCPT ); Wed, 22 Apr 2015 10:18:37 -0400 Received: from smtprelay0115.hostedemail.com ([216.40.44.115]:51208 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932338AbbDVOSe (ORCPT ); Wed, 22 Apr 2015 10:18:34 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::,RULES_HIT:41:355:379:541:599:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1539:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3867:3868:3870:3872:3874:4321:5007:6120:6261:6742:7901:10004:10400:10848:11026:11232:11473:11658:11914:12438:12517:12519:12740:13019:13069:13311:13357:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: hall91_2d5196d1c3f03 X-Filterd-Recvd-Size: 2050 Message-ID: <1429712309.32612.10.camel@perches.com> Subject: Re: [PATCH 2/3 V2] time: allow gcc to fold constants when using From: Joe Perches To: Thomas Gleixner Cc: 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 Date: Wed, 22 Apr 2015 07:18:29 -0700 In-Reply-To: References: <1428840815-21974-1-git-send-email-hofrat@osadl.org> <1428840815-21974-3-git-send-email-hofrat@osadl.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1017 Lines: 30 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. > 2) Add the __builtin_constant_p() check And please add the usecs_to_jiffies variants in a similar patch set. -- 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/