]> git.hungrycats.org Git - linux/commitdiff
Small batch of IDE code cleanups from Pavel Machek
authorJens Axboe <axboe@burns.home.kernel.dk>
Mon, 11 Feb 2002 10:44:06 +0000 (11:44 +0100)
committerJens Axboe <axboe@burns.home.kernel.dk>
Mon, 11 Feb 2002 10:44:06 +0000 (11:44 +0100)
drivers/ide/ide-disk.c
drivers/ide/ide-proc.c
include/linux/ide.h

index 27e3aebb2ce2a778a244edb4effe05ac588b003d..a76f6c69902ee24f1d92bdae799f2d34c03029db 100644 (file)
@@ -123,29 +123,24 @@ static ide_startstop_t lba_48_rw_disk (ide_drive_t *drive, struct request *rq, u
  */
 static ide_startstop_t do_rw_disk (ide_drive_t *drive, struct request *rq, unsigned long block)
 {
-       if (rq->flags & REQ_CMD)
-               goto good_command;
-
-       blk_dump_rq_flags(rq, "do_rw_disk, bad command");
-       ide_end_request(0, HWGROUP(drive));
-       return ide_stopped;
-
-good_command:
+       if (!(rq->flags & REQ_CMD)) {
+               blk_dump_rq_flags(rq, "do_rw_disk, bad command");
+               ide_end_request(0, HWGROUP(drive));
+               return ide_stopped;
+       }
 
-#ifdef CONFIG_BLK_DEV_PDC4030
        if (IS_PDC4030_DRIVE) {
                extern ide_startstop_t promise_rw_disk(ide_drive_t *, struct request *, unsigned long);
                return promise_rw_disk(drive, rq, block);
        }
-#endif /* CONFIG_BLK_DEV_PDC4030 */
 
        if ((drive->id->cfs_enable_2 & 0x0400) && (drive->addressing))  /* 48-bit LBA */
-               return lba_48_rw_disk(drive, rq, (unsigned long long) block);
+               return lba_48_rw_disk(drive, rq, block);
        if (drive->select.b.lba)                /* 28-bit LBA */
-               return lba_28_rw_disk(drive, rq, (unsigned long) block);
+               return lba_28_rw_disk(drive, rq, block);
 
        /* 28-bit CHS : DIE DIE DIE piece of legacy crap!!! */
-       return chs_rw_disk(drive, rq, (unsigned long) block);
+       return chs_rw_disk(drive, rq, block);
 }
 
 static task_ioreg_t get_command (ide_drive_t *drive, int cmd)
index 82dd2704b3963f1765ff442ad37f447463839a32..2476e71494f7c78b1516314f0374cb15e281633c 100644 (file)
@@ -629,7 +629,7 @@ static int proc_ide_read_driver
        (char *page, char **start, off_t off, int count, int *eof, void *data)
 {
        ide_drive_t     *drive = (ide_drive_t *) data;
-       ide_driver_t    *driver = (ide_driver_t *) drive->driver;
+       ide_driver_t    *driver = drive->driver;
        int             len;
 
        if (!driver)
@@ -746,7 +746,6 @@ void recreate_proc_ide_device(ide_hwif_t *hwif, ide_drive_t *drive)
        struct proc_dir_entry *ent;
        struct proc_dir_entry *parent = hwif->proc;
        char name[64];
-//     ide_driver_t *driver = drive->driver;
 
        if (drive->present && !drive->proc) {
                drive->proc = proc_mkdir(drive->name, parent);
index 8b81bcc98cb3fa22fe1f88462fa1775638c2e6e2..519201bc24c9e104d1a96d0e6291e0570614389b 100644 (file)
@@ -424,12 +424,12 @@ typedef struct ide_drive_s {
        unsigned long   capacity;       /* total number of sectors */
        unsigned long long capacity48;  /* total number of sectors */
        unsigned int    drive_data;     /* for use by tuneproc/selectproc as needed */
-       void              *hwif;        /* actually (ide_hwif_t *) */
+       struct hwif_s   *hwif;          /* actually (ide_hwif_t *) */
        wait_queue_head_t wqueue;       /* used to wait for drive in open() */
        struct hd_driveid *id;          /* drive model identification info */
        struct hd_struct  *part;        /* drive partition table */
        char            name[4];        /* drive name, such as "hda" */
-       void            *driver;        /* (ide_driver_t *) */
+       struct ide_driver_s *driver;    /* (ide_driver_t *) */
        void            *driver_data;   /* extra driver data */
        devfs_handle_t  de;             /* directory for device */
        struct proc_dir_entry *proc;    /* /proc/ide/ directory entry */