linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Denis Vlasenko <vda.linux@googlemail.com>
To: linux-scsi@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 4/4] aic7xxx: remove excessive inlining
Date: Sun, 13 Aug 2006 15:05:58 +0200	[thread overview]
Message-ID: <200608131505.58608.vda.linux@googlemail.com> (raw)
In-Reply-To: <200608131503.07987.vda.linux@googlemail.com>

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

On Sunday 13 August 2006 15:03, Denis Vlasenko wrote:
> Basically, patches deinline some functions, mainly those
> which perform port I/O.

Comment says "Read high byte first as some registers increment..."
but code doesn't guarantee that, I think:
	return ((ahd_inb(ahd, port+1) << 8) | ahd_inb(ahd, port));
Compiler can reorder it.

Make the order explicit.
--
vda

[-- Attachment #2: 4.inb_order.diff --]
[-- Type: text/x-diff, Size: 716 bytes --]

diff -urpN -U4 linux-2.6.17.8.aic3/drivers/scsi/aic7xxx/aic79xx_core.c linux-2.6.17.8.aic4/drivers/scsi/aic7xxx/aic79xx_core.c
--- linux-2.6.17.8.aic3/drivers/scsi/aic7xxx/aic79xx_core.c	2006-08-13 12:01:42.000000000 +0200
+++ linux-2.6.17.8.aic4/drivers/scsi/aic7xxx/aic79xx_core.c	2006-08-13 12:14:13.000000000 +0200
@@ -341,9 +341,11 @@ ahd_inw(struct ahd_softc *ahd, u_int por
 	 * Read high byte first as some registers increment
 	 * or have other side effects when the low byte is
 	 * read.
 	 */
-	return ((ahd_inb(ahd, port+1) << 8) | ahd_inb(ahd, port));
+	uint16_t r = ahd_inb(ahd, port+1) << 8;
+	r |= ahd_inb(ahd, port);
+	return r;
 }
 
 void
 ahd_outw(struct ahd_softc *ahd, u_int port, u_int value)

  parent reply	other threads:[~2006-08-13 13:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-13 12:57 [PATCH 0/4] aic7xxx: remove excessive inlining Denis Vlasenko
2006-08-13 12:58 ` [PATCH 1/4] " Denis Vlasenko
2006-08-13 13:02   ` [PATCH 2/4] " Denis Vlasenko
2006-08-13 13:03     ` [PATCH 3/4] " Denis Vlasenko
2006-08-13 13:05       ` Denis Vlasenko
2006-08-13 13:05       ` Denis Vlasenko [this message]
2006-08-14 23:14 ` [PATCH 0/4] " Andrew Morton
2006-08-14 23:25   ` Randy.Dunlap
2006-08-15 16:20     ` 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=200608131505.58608.vda.linux@googlemail.com \
    --to=vda.linux@googlemail.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;
as well as URLs for NNTP newsgroup(s).