From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: linux-ide@vger.kernel.org
Subject: [PATCH 6/18] ide: fix registers loading order in ide_dump_ata_status()
Date: Mon, 5 Nov 2007 00:20:57 +0100 [thread overview]
Message-ID: <200711050020.57782.bzolnier@gmail.com> (raw)
Fix registers loading order in ide_dump_ata_status()/ide_read_24().
Load registers in this order:
* IDE_SECTOR_REG
* IDE_LCYL_REG
* IDE_HCYL_REG
* IDE_SELECT_REG
It shouldn't affect anything (just a usual paranoia to separate changes
which change the way in which hardware is accessed from code cleanups).
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/ide-iops.c | 4 ++--
drivers/ide/ide-lib.c | 23 ++++++++++++++---------
2 files changed, 16 insertions(+), 11 deletions(-)
Index: b/drivers/ide/ide-iops.c
===================================================================
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -160,9 +160,9 @@ EXPORT_SYMBOL(default_hwif_mmiops);
u32 ide_read_24 (ide_drive_t *drive)
{
- u8 hcyl = HWIF(drive)->INB(IDE_HCYL_REG);
- u8 lcyl = HWIF(drive)->INB(IDE_LCYL_REG);
u8 sect = HWIF(drive)->INB(IDE_SECTOR_REG);
+ u8 lcyl = HWIF(drive)->INB(IDE_LCYL_REG);
+ u8 hcyl = HWIF(drive)->INB(IDE_HCYL_REG);
return (hcyl<<16)|(lcyl<<8)|sect;
}
Index: b/drivers/ide/ide-lib.c
===================================================================
--- a/drivers/ide/ide-lib.c
+++ b/drivers/ide/ide-lib.c
@@ -521,19 +521,24 @@ static u8 ide_dump_ata_status(ide_drive_
(unsigned long long) sectors,
high, low);
} else {
- u8 cur = hwif->INB(IDE_SELECT_REG);
+ u8 sector, lcyl, hcyl, cur;
+
+ sector = hwif->INB(IDE_SECTOR_REG);
+ lcyl = hwif->INB(IDE_LCYL_REG);
+ hcyl = hwif->INB(IDE_HCYL_REG);
+ cur = hwif->INB(IDE_SELECT_REG);
+
if (cur & 0x40) { /* using LBA? */
printk(", LBAsect=%ld", (unsigned long)
- ((cur&0xf)<<24)
- |(hwif->INB(IDE_HCYL_REG)<<16)
- |(hwif->INB(IDE_LCYL_REG)<<8)
- | hwif->INB(IDE_SECTOR_REG));
+ ((cur & 0xf) << 24) |
+ (hcyl << 16) |
+ (lcyl << 8) |
+ sector);
} else {
printk(", CHS=%d/%d/%d",
- (hwif->INB(IDE_HCYL_REG)<<8) +
- hwif->INB(IDE_LCYL_REG),
- cur & 0xf,
- hwif->INB(IDE_SECTOR_REG));
+ (hcyl << 8) + lcyl,
+ cur & 0xf,
+ sector);
}
}
if (HWGROUP(drive) && HWGROUP(drive)->rq)
next reply other threads:[~2007-11-04 23:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-04 23:20 Bartlomiej Zolnierkiewicz [this message]
2007-11-09 14:05 ` [PATCH 6/18] ide: fix registers loading order in ide_dump_ata_status() Sergei Shtylyov
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=200711050020.57782.bzolnier@gmail.com \
--to=bzolnier@gmail.com \
--cc=linux-ide@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).