From: Denis Vlasenko <vda.linux@googlemail.com>
To: linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>,
Russell King <rmk@arm.linux.org.uk>
Subject: [PATCH 2/3] delay: remove references to MAX_UDELAY_MS; fix comment
Date: Fri, 22 Sep 2006 09:58:52 +0200 [thread overview]
Message-ID: <200609220958.52736.vda.linux@googlemail.com> (raw)
In-Reply-To: <200609220957.43127.vda.linux@googlemail.com>
[-- Attachment #1: Type: text/plain, Size: 253 bytes --]
We are going to kill MAX_UDELAY_MS, so replace it
in common code with 1. Also fix a buglet on the way:
mpc83xx_spi->nsecs > MAX_UDELAY_MS * 1000
was comparing nanoseconds to microseconds.
Signed-off-by: Denis Vlasenko <vda.linux@googlemail.com>
--
vda
[-- Attachment #2: delay8.2.patch --]
[-- Type: text/x-diff, Size: 2356 bytes --]
diff -urpN linux-2.6.18.new.1/drivers/scsi/ipr.c linux-2.6.18.new.2/drivers/scsi/ipr.c
--- linux-2.6.18.new.1/drivers/scsi/ipr.c 2006-09-20 05:42:06.000000000 +0200
+++ linux-2.6.18.new.2/drivers/scsi/ipr.c 2006-09-22 00:00:48.000000000 +0200
@@ -1596,11 +1596,7 @@ static int ipr_wait_iodbg_ack(struct ipr
if (pcii_reg & IPR_PCII_IO_DEBUG_ACKNOWLEDGE)
return 0;
- /* udelay cannot be used if delay is more than a few milliseconds */
- if ((delay / 1000) > MAX_UDELAY_MS)
- mdelay(delay / 1000);
- else
- udelay(delay);
+ udelay(delay);
delay += delay;
}
diff -urpN linux-2.6.18.new.1/drivers/spi/spi_bitbang.c linux-2.6.18.new.2/drivers/spi/spi_bitbang.c
--- linux-2.6.18.new.1/drivers/spi/spi_bitbang.c 2006-09-20 05:42:06.000000000 +0200
+++ linux-2.6.18.new.2/drivers/spi/spi_bitbang.c 2006-09-22 00:00:48.000000000 +0200
@@ -168,7 +168,7 @@ int spi_bitbang_setup_transfer(struct sp
hz = spi->max_speed_hz;
if (hz) {
cs->nsecs = (1000000000/2) / hz;
- if (cs->nsecs > (MAX_UDELAY_MS * 1000 * 1000))
+ if (cs->nsecs > (1000 * 1000))
return -EINVAL;
}
diff -urpN linux-2.6.18.new.1/drivers/spi/spi_mpc83xx.c linux-2.6.18.new.2/drivers/spi/spi_mpc83xx.c
--- linux-2.6.18.new.1/drivers/spi/spi_mpc83xx.c 2006-09-20 05:42:06.000000000 +0200
+++ linux-2.6.18.new.2/drivers/spi/spi_mpc83xx.c 2006-09-22 00:00:48.000000000 +0200
@@ -211,7 +211,7 @@ int mpc83xx_spi_setup_transfer(struct sp
if (!hz)
hz = spi->max_speed_hz;
mpc83xx_spi->nsecs = (1000000000 / 2) / hz;
- if (mpc83xx_spi->nsecs > MAX_UDELAY_MS * 1000)
+ if (mpc83xx_spi->nsecs > (1000 * 1000))
return -EINVAL;
if (bits_per_word == 32)
diff -urpN linux-2.6.18.new.1/include/asm-parisc/delay.h linux-2.6.18.new.2/include/asm-parisc/delay.h
--- linux-2.6.18.new.1/include/asm-parisc/delay.h 2006-09-20 05:42:06.000000000 +0200
+++ linux-2.6.18.new.2/include/asm-parisc/delay.h 2006-09-22 00:00:48.000000000 +0200
@@ -24,9 +24,8 @@ static __inline__ void __cr16_delay(unsi
/*
* Note: Due to unsigned math, cr16 rollovers shouldn't be
- * a problem here. However, on 32 bit, we need to make sure
- * we don't pass in too big a value. The current default
- * value of MAX_UDELAY_MS should help prevent this.
+ * a problem here. On 32 bit, we are protected in udelay()
+ * from passing in too big a value.
*/
start = mfctl(16);
next prev parent reply other threads:[~2006-09-22 8:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200609220955.35826.vda.linux@googlemail.com>
2006-09-22 7:57 ` [PATCH 1/3] delay: s/#include <asm/delay.h>/#include <linux/delay.h>/ Denis Vlasenko
2006-09-22 7:58 ` Denis Vlasenko [this message]
2006-09-22 8:00 ` [PATCH 3/3] delay: add generic udelay(), mdelay() and ssleep() Denis Vlasenko
2006-09-22 9:36 ` Russell King
2006-09-22 13:46 ` Denis Vlasenko
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=200609220958.52736.vda.linux@googlemail.com \
--to=vda.linux@googlemail.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk@arm.linux.org.uk \
/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