Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d32444771b154c3ec37ebf6439004653560c2411
Commit:     d32444771b154c3ec37ebf6439004653560c2411
Parent:     f6e29e35cc0f9facf2eb0b0454f9b09021b5aa6f
Author:     Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Fri Jan 25 22:17:17 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Fri Jan 25 22:17:17 2008 +0100

    ide: fix registers loading order in ide_dump_ata_status()
    
    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).
    
    Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
    Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-iops.c |    4 ++--
 drivers/ide/ide-lib.c  |   23 ++++++++++++++---------
 2 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index 1064542..38d6b15 100644
--- 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;
 }
 
diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c
index 562f5ef..0010858 100644
--- a/drivers/ide/ide-lib.c
+++ b/drivers/ide/ide-lib.c
@@ -524,19 +524,24 @@ static u8 ide_dump_ata_status(ide_drive_t *drive, const 
char *msg, u8 stat)
                                       (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)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to