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:	Thu, 22 Jan 2015 10:01:01 +0100
From:	Nicholas Mc Guire <der.herr@...r.at>
To:	???? <micky_ching@...lsil.com.cn>
Cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	"devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>,
	Keerthimai Janarthanan <keerthimaipb@...il.com>,
	Sarah Sharp <sarah.a.sharp@...ux.intel.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Fabio Falzoi <fabio.falzoi84@...il.com>,
	Tina Johnson <tinajohnson.1234@...il.com>,
	Surya Seetharaman <surya.seetharaman9@...il.com>
Subject: Re: [PATCH] staging: rts5028: use msecs_to_jiffies for timeouts

On Thu, 22 Jan 2015, ???? wrote:

> the title should be 5208.

sorry - that was a typo - should this be 
resubmitted for traceability or is that not
necessary ?

> 
> On 01/19/2015 03:25 PM, Nicholas Mc Guire wrote:
> > This is only an API consolidation and should make things more readable
> >
> > Signed-off-by: Nicholas Mc Guire <der.herr@...r.at>
> > ---
> >
> > Converting milliseconds to jiffies by val * HZ / 1000 is technically
> > not wrong but msecs_to_jiffies(val) is the cleaner solution and handles
> > corner cases correctly.
> >
> > This patch was only compile tested with x86_64_defconfig + CONFIG_STAGING=y,
> > CONFIG_RTS5208=m
> >
> > Patch is against 3.19.0-rc4 -next-20150116
> >
> >   drivers/staging/rts5208/rtsx_transport.c |   12 ++++++------
> >   1 file changed, 6 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/staging/rts5208/rtsx_transport.c b/drivers/staging/rts5208/rtsx_transport.c
> > index 756a968..dab1995 100644
> > --- a/drivers/staging/rts5208/rtsx_transport.c
> > +++ b/drivers/staging/rts5208/rtsx_transport.c
> > @@ -271,7 +271,7 @@ int rtsx_send_cmd(struct rtsx_chip *chip, u8 card, int timeout)
> >   
> >   	/* Wait for TRANS_OK_INT */
> >   	timeleft = wait_for_completion_interruptible_timeout(
> > -		&trans_done, timeout * HZ / 1000);
> > +		&trans_done, msecs_to_jiffies(timeout));
> >   	if (timeleft <= 0) {
> >   		dev_dbg(rtsx_dev(chip), "chip->int_reg = 0x%x\n",
> >   			chip->int_reg);
> > @@ -431,7 +431,7 @@ static int rtsx_transfer_sglist_adma_partial(struct rtsx_chip *chip, u8 card,
> >   	spin_unlock_irq(&rtsx->reg_lock);
> >   
> >   	timeleft = wait_for_completion_interruptible_timeout(
> > -		&trans_done, timeout * HZ / 1000);
> > +		&trans_done, msecs_to_jiffies(timeout));
> >   	if (timeleft <= 0) {
> >   		dev_dbg(rtsx_dev(chip), "Timeout (%s %d)\n",
> >   			__func__, __LINE__);
> > @@ -455,7 +455,7 @@ static int rtsx_transfer_sglist_adma_partial(struct rtsx_chip *chip, u8 card,
> >   		init_completion(&trans_done);
> >   		spin_unlock_irq(&rtsx->reg_lock);
> >   		timeleft = wait_for_completion_interruptible_timeout(
> > -			&trans_done, timeout * HZ / 1000);
> > +			&trans_done, msecs_to_jiffies(timeout));
> >   		if (timeleft <= 0) {
> >   			dev_dbg(rtsx_dev(chip), "Timeout (%s %d)\n",
> >   				__func__, __LINE__);
> > @@ -575,7 +575,7 @@ static int rtsx_transfer_sglist_adma(struct rtsx_chip *chip, u8 card,
> >   		spin_unlock_irq(&rtsx->reg_lock);
> >   
> >   		timeleft = wait_for_completion_interruptible_timeout(
> > -			&trans_done, timeout * HZ / 1000);
> > +			&trans_done, msecs_to_jiffies(timeout));
> >   		if (timeleft <= 0) {
> >   			dev_dbg(rtsx_dev(chip), "Timeout (%s %d)\n",
> >   				__func__, __LINE__);
> > @@ -602,7 +602,7 @@ static int rtsx_transfer_sglist_adma(struct rtsx_chip *chip, u8 card,
> >   		init_completion(&trans_done);
> >   		spin_unlock_irq(&rtsx->reg_lock);
> >   		timeleft = wait_for_completion_interruptible_timeout(
> > -			&trans_done, timeout * HZ / 1000);
> > +			&trans_done, msecs_to_jiffies(timeout));
> >   		if (timeleft <= 0) {
> >   			dev_dbg(rtsx_dev(chip), "Timeout (%s %d)\n",
> >   				__func__, __LINE__);
> > @@ -688,7 +688,7 @@ static int rtsx_transfer_buf(struct rtsx_chip *chip, u8 card, void *buf,
> >   
> >   	/* Wait for TRANS_OK_INT */
> >   	timeleft = wait_for_completion_interruptible_timeout(
> > -		&trans_done, timeout * HZ / 1000);
> > +		&trans_done, msecs_to_jiffies(timeout));
> >   	if (timeleft <= 0) {
> >   		dev_dbg(rtsx_dev(chip), "Timeout (%s %d)\n",
> >   			__func__, __LINE__);

thx!
hofrat
--
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