public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Denis Vlasenko <vda@ilport.com.ua>
To: linux-scsi@vger.kernel.org
Cc: gibbs@scsiguy.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] deinline some functions in aic7xxx drivers, save 80k of text
Date: Mon, 10 Apr 2006 08:49:37 +0300	[thread overview]
Message-ID: <200604100849.37943.vda@ilport.com.ua> (raw)
In-Reply-To: <200604100844.12151.vda@ilport.com.ua>

[-- Attachment #1: Type: text/plain, Size: 271 bytes --]

On Monday 10 April 2006 08:44, Denis Vlasenko wrote:
> I also spotted two bugs in the process, patches
> for those will follow.

ahd_delay(usec) is buggy. Just think how would it work
with usec == 1024*100 + 1...

Signed-off-by: Denis Vlasenko <vda@ilport.com.ua>
--
vda

[-- Attachment #2: 2.6.16.aic7_42.patch --]
[-- Type: text/x-diff, Size: 1113 bytes --]

Fix yet another bug

diff -urpN linux-2.6.16.aic7_2/drivers/scsi/aic7xxx/aic79xx_osm_o.c linux-2.6.16.aic7_3/drivers/scsi/aic7xxx/aic79xx_osm_o.c
--- linux-2.6.16.aic7_2/drivers/scsi/aic7xxx/aic79xx_osm_o.c	Sun Apr  9 21:53:01 2006
+++ linux-2.6.16.aic7_3/drivers/scsi/aic7xxx/aic79xx_osm_o.c	Sun Apr  9 22:25:30 2006
@@ -28,9 +28,11 @@ ahd_delay(long usec)
 	 * multi-millisecond waits.  Wait at most
 	 * 1024us per call.
 	 */
+	udelay(usec & 1023);
+	usec >>= 10;
 	while (usec > 0) {
-		udelay(usec % 1024);
-		usec -= 1024;
+		udelay(1024);
+		usec--;
 	}
 }
 
diff -urpN linux-2.6.16.aic7_2/drivers/scsi/aic7xxx/aic7xxx_osm_o.c linux-2.6.16.aic7_3/drivers/scsi/aic7xxx/aic7xxx_osm_o.c
--- linux-2.6.16.aic7_2/drivers/scsi/aic7xxx/aic7xxx_osm_o.c	Sun Apr  9 21:54:39 2006
+++ linux-2.6.16.aic7_3/drivers/scsi/aic7xxx/aic7xxx_osm_o.c	Sun Apr  9 22:24:59 2006
@@ -14,9 +14,11 @@ ahc_delay(long usec)
 	 * multi-millisecond waits.  Wait at most
 	 * 1024us per call.
 	 */
+	udelay(usec & 1023);
+	usec >>= 10;
 	while (usec > 0) {
-		udelay(usec % 1024);
-		usec -= 1024;
+		udelay(1024);
+		usec--;
 	}
 }
 

  parent reply	other threads:[~2006-04-10  5:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-10  5:44 [PATCH] deinline some functions in aic7xxx drivers, save 80k of text Denis Vlasenko
2006-04-10  5:46 ` Denis Vlasenko
2006-04-10  5:49 ` Denis Vlasenko [this message]
     [not found] ` <200604100903.35431.eike-kernel@sf-tec.de>
     [not found]   ` <200604101015.36869.vda@ilport.com.ua>
2006-04-10  7:19     ` Rolf Eike Beer
2006-04-10  7:54       ` Denis Vlasenko
2006-04-10  9:40       ` Stefan Richter
2006-04-10 10:00         ` Hannes Reinecke
2006-04-10 10:16           ` Stefan Richter
2006-04-10 16:20       ` Arjan van de Ven
2006-04-10  8:43 ` Stefan Richter
2006-04-10  8:56   ` Denis Vlasenko
2006-04-10 10:19     ` Stefan Richter
2006-04-10 14:22 ` Justin T. Gibbs

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=200604100849.37943.vda@ilport.com.ua \
    --to=vda@ilport.com.ua \
    --cc=gibbs@scsiguy.com \
    --cc=linux-kernel@vger.kernel.org \
    --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