From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756129AbbCCKhc (ORCPT ); Tue, 3 Mar 2015 05:37:32 -0500 Received: from smtprelay0012.hostedemail.com ([216.40.44.12]:56847 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755796AbbCCKha (ORCPT ); Tue, 3 Mar 2015 05:37:30 -0500 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:1541:1593:1594:1711:1730:1747:1777:1792:2194:2199:2393:2559:2562:2693:2828:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3871:3872:3873:3874:4321:5007:6119:6261:7875:10004:10400:10848:11026:11232:11473:11658:11914:12043:12517:12519:12740:13069:13161:13229: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: man42_7192351ef74f X-Filterd-Recvd-Size: 2120 Message-ID: <1425379047.17273.11.camel@perches.com> Subject: Re: [PATCH] ide_tape: convert jiffies with jiffies_to_msecs From: Joe Perches To: Nicholas Mc Guire Cc: "David S. Miller" , linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 03 Mar 2015 02:37:27 -0800 In-Reply-To: <1425378228-6095-1-git-send-email-hofrat@osadl.org> References: <1425378228-6095-1-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 On Tue, 2015-03-03 at 05:23 -0500, Nicholas Mc Guire wrote: > Use jiffies_to_msecs for converting jiffies as it handles all of the corner > cases reliably and also helps readability. The printk format is fixed up > as jiffies_to_msecs returns unsigned int not unsigned long. Then ideally you'd use %u not %d. > Note that this patch will give a checkpatch warning due to "quoted string > split across lines" but thats not related to this change - not sure if this > should be fixed - looks intentional to me. It's not. It'd be better coalesced. > diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c [] > @@ -1793,11 +1793,11 @@ static void idetape_setup(ide_drive_t *drive, idetape_tape_t *tape, int minor) > tape->best_dsc_rw_freq = clamp_t(unsigned long, t, IDETAPE_DSC_RW_MIN, > IDETAPE_DSC_RW_MAX); > printk(KERN_INFO "ide-tape: %s <-> %s: %dKBps, %d*%dkB buffer, " > - "%lums tDSC%s\n", > + "%dms tDSC%s\n", > drive->name, tape->name, *(u16 *)&tape->caps[14], > (*(u16 *)&tape->caps[16] * 512) / tape->buffer_size, > tape->buffer_size / 1024, > - tape->best_dsc_rw_freq * 1000 / HZ, > + jiffies_to_msecs(tape->best_dsc_rw_freq), > (drive->dev_flags & IDE_DFLAG_USING_DMA) ? ", DMA" : "");