lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 03 Mar 2015 02:37:27 -0800
From:	Joe Perches <joe@...ches.com>
To:	Nicholas Mc Guire <hofrat@...dl.org>
Cc:	"David S. Miller" <davem@...emloft.net>, linux-ide@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ide_tape: convert jiffies with jiffies_to_msecs

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" : "");


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ