From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755647AbbCRHbJ (ORCPT ); Wed, 18 Mar 2015 03:31:09 -0400 Received: from smtprelay0136.hostedemail.com ([216.40.44.136]:51135 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755587AbbCRHbC (ORCPT ); Wed, 18 Mar 2015 03:31:02 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::::::::,RULES_HIT:41:355:379:541:599:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2693:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3874:4250:4321:4470:4605:5007:6119:6261:6742:7903:8660:10004:10400:10848:11026:11232:11473:11658:11914:12438:12517:12519:12555:12740:13019:13069:13148:13161:13229:13230:13311:13357:14096:14097: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: boys38_7cda732436b04 X-Filterd-Recvd-Size: 2802 Message-ID: <1426663856.10043.15.camel@perches.com> Subject: Re: [PATCH] brcmfmac: cfg80211: use msecs_to_jiffies for time conversion From: Joe Perches To: Nicholas Mc Guire Cc: Nicholas Mc Guire , Brett Rudley , Arend van Spriel , "Franky (Zhenhui) Lin" , Hante Meuleman , Kalle Valo , "John W. Linville" , Pieter-Paul Giesberts , Daniel Kim , Johannes Berg , linux-wireless@vger.kernel.org, brcm80211-dev-list@broadcom.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 18 Mar 2015 00:30:56 -0700 In-Reply-To: <20150318064439.GA25924@opentech.at> References: <1426593972-17652-1-git-send-email-hofrat@osadl.org> <1426596159.23897.61.camel@perches.com> <20150318064439.GA25924@opentech.at> 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 On Wed, 2015-03-18 at 07:44 +0100, Nicholas Mc Guire wrote: > On Tue, 17 Mar 2015, Joe Perches wrote: > > On Tue, 2015-03-17 at 08:06 -0400, Nicholas Mc Guire wrote: > > > Converting milliseconds to jiffies by "val * HZ / 1000" is technically > > > OK but msecs_to_jiffies(val) is the cleaner solution and handles all > > > corner cases correctly. This is a minor API consolidation only and > > > should make things more readable. > > These API consolidation changes now always have a function > > call when the compiler may have previously been able to > > optimize out the "constant * HZ / 1000" calculation. > > > > Perhaps the [um]secs_to_jiffies calls should be indirected > > with yet another static inline with a __builtin_constant_p() > > test so that the function calls can again be avoided when > > possible. > > will give it a try OK, thanks. The tricky bit seems to be the movement of the Makefile for kernel/time/timeconst.h. BC kernel/time/timeconst.h as include/linux/time.h would need these calculated #defines #define MSEC_TO_HZ_MUL32 U64_C(0x80000000) #define MSEC_TO_HZ_ADJ32 U64_C(0x0) #define MSEC_TO_HZ_SHR32 31 and the usec ones too. That created file would have to be moved from kernel/time/Makefile to some other location that could be in the normal include path like include/linux/timeconst.h so that it can be used by include/linux/time.h