public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: David Brownell <david-b@pacbell.net>
Cc: linux-scsi@vger.kernel.org
Subject: Re: fix compile-time divide-by-zero in scsi_ioctl
Date: Wed, 27 Sep 2006 14:27:10 -0600	[thread overview]
Message-ID: <20060927202710.GV5017@parisc-linux.org> (raw)
In-Reply-To: <20060926154848.CFDC63DAF7@adsl-69-226-248-13.dsl.pltn13.pacbell.net>

On Tue, Sep 26, 2006 at 08:48:48AM -0700, David Brownell wrote:
> This fixes a compiler-reported divide-by-zero when HZ < 100.

Shouldn't we instead be using jiffies_to_clock_t?  Thus:

Index: at91/block/scsi_ioctl.c
===================================================================
--- at91.orig/block/scsi_ioctl.c	2006-07-30 01:17:34.000000000 -0700
+++ at91/block/scsi_ioctl.c	2006-07-30 01:44:17.000000000 -0700
@@ -63,7 +63,7 @@ static int scsi_get_bus(request_queue_t 
 
 static int sg_get_timeout(request_queue_t *q)
 {
-	return q->sg_timeout / (HZ / USER_HZ);
+	return jiffies_to_clock_t(q->sg_timeout);
 }
 
 static int sg_set_timeout(request_queue_t *q, int __user *p)

  reply	other threads:[~2006-09-27 20:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-26 15:48 fix compile-time divide-by-zero in scsi_ioctl David Brownell
2006-09-27 20:27 ` Matthew Wilcox [this message]
2006-09-27 23:28   ` David Brownell
2006-09-28  2:40     ` Matthew Wilcox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060927202710.GV5017@parisc-linux.org \
    --to=matthew@wil.cx \
    --cc=david-b@pacbell.net \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox