From 4ede0350ba7bc8682ceae0d256d8d8d5d244aecf Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Tue, 29 Apr 2003 21:12:00 -0700 Subject: [PATCH] Kill dups of read_24(), rename it to ide_read_24(). - kill dups in ide.c and ide-disk.c - read_24() is exported so rename it to ide_read_24() - add it ide.h --- drivers/ide/ide-disk.c | 12 ++---------- drivers/ide/ide-iops.c | 4 ++-- drivers/ide/ide.c | 11 ++--------- include/linux/ide.h | 2 ++ 4 files changed, 8 insertions(+), 21 deletions(-) diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 16cecbc6c4dd..67086a431c40 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c @@ -72,14 +72,6 @@ #include "legacy/pdc4030.h" -static inline u32 idedisk_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); - return (hcyl<<16)|(lcyl<<8)|sect; -} - /* * lba_capacity_is_ok() performs a sanity check on the claimed "lba_capacity" * value for this drive (from its reported identification information). @@ -812,9 +804,9 @@ static u8 idedisk_dump_status (ide_drive_t *drive, const char *msg, u8 stat) if (drive->addressing == 1) { __u64 sectors = 0; u32 low = 0, high = 0; - low = idedisk_read_24(drive); + low = ide_read_24(drive); hwif->OUTB(drive->ctl|0x80, IDE_CONTROL_REG); - high = idedisk_read_24(drive); + high = ide_read_24(drive); sectors = ((__u64)high << 24) | low; printk(", LBAsect=%llu, high=%d, low=%d", (unsigned long long) sectors, diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c index 56f991a8d88b..72df917205ab 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c @@ -263,7 +263,7 @@ void default_hwif_transport (ide_hwif_t *hwif) EXPORT_SYMBOL(default_hwif_transport); -u32 read_24 (ide_drive_t *drive) +u32 ide_read_24 (ide_drive_t *drive) { u8 hcyl = HWIF(drive)->INB(IDE_HCYL_REG); u8 lcyl = HWIF(drive)->INB(IDE_LCYL_REG); @@ -271,7 +271,7 @@ u32 read_24 (ide_drive_t *drive) return (hcyl<<16)|(lcyl<<8)|sect; } -EXPORT_SYMBOL(read_24); +EXPORT_SYMBOL(ide_read_24); void SELECT_DRIVE (ide_drive_t *drive) { diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 474876725c59..5967fe433778 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c @@ -359,13 +359,6 @@ unsigned long current_capacity (ide_drive_t *drive) EXPORT_SYMBOL(current_capacity); -static inline u32 read_24 (ide_drive_t *drive) -{ - return (HWIF(drive)->INB(IDE_HCYL_REG)<<16) | - (HWIF(drive)->INB(IDE_LCYL_REG)<<8) | - HWIF(drive)->INB(IDE_SECTOR_REG); -} - /* * Error reporting, in human readable form (luxurious, but a memory hog). */ @@ -412,9 +405,9 @@ u8 ide_dump_status (ide_drive_t *drive, const char *msg, u8 stat) (drive->addressing == 1)) { u64 sectors = 0; u32 high = 0; - u32 low = read_24(drive); + u32 low = ide_read_24(drive); hwif->OUTB(drive->ctl|0x80, IDE_CONTROL_REG); - high = read_24(drive); + high = ide_read_24(drive); sectors = ((u64)high << 24) | low; printk(", LBAsect=%llu, high=%d, low=%d", diff --git a/include/linux/ide.h b/include/linux/ide.h index 082fd9b7687b..f773ff4268a9 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -1408,6 +1408,8 @@ typedef struct pkt_task_s { void *special; } pkt_task_t; +extern inline u32 ide_read_24(ide_drive_t *); + extern inline void SELECT_DRIVE(ide_drive_t *); extern inline void SELECT_INTERRUPT(ide_drive_t *); extern inline void SELECT_MASK(ide_drive_t *, int); -- cgit v1.2.3