ide: remove ->supports_dsc_overlap field from ide_driver_t
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Fri, 10 Oct 2008 20:39:29 +0000 (22:39 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Fri, 10 Oct 2008 20:39:29 +0000 (22:39 +0200)
* Use drive->media and drive->scsi to check if ->dsc_overlap
  can be set by HDIO_SET_NICE ioctl in generic_ide_ioctl().

* Remove unused ->supports_dsc_overlap field from ide_driver_t.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ide-cd.c
drivers/ide/ide-disk.c
drivers/ide/ide-floppy.c
drivers/ide/ide-tape.c
drivers/ide/ide.c
drivers/scsi/ide-scsi.c
include/linux/ide.h

index 1f5652326489f27ffdd7bac6eb6e33cb110c2540..7ea90de550582d9c0f78a53789150b92ea3edbc1 100644 (file)
@@ -1969,7 +1969,6 @@ static ide_driver_t ide_cdrom_driver = {
        .remove                 = ide_cd_remove,
        .version                = IDECD_VERSION,
        .media                  = ide_cdrom,
-       .supports_dsc_overlap   = 1,
        .do_request             = ide_cd_do_request,
        .end_request            = ide_end_request,
        .error                  = __ide_error,
index 474070c1ddb6bb2f29cc9c3a568eb039420255a2..08f47cb134256b72665717e7220c865a00d0c4a8 100644 (file)
@@ -980,7 +980,6 @@ static ide_driver_t idedisk_driver = {
        .shutdown               = ide_device_shutdown,
        .version                = IDEDISK_VERSION,
        .media                  = ide_disk,
-       .supports_dsc_overlap   = 0,
        .do_request             = ide_do_rw_disk,
        .end_request            = ide_end_request,
        .error                  = __ide_error,
index 673644fdb6f2f8be6cd5a5c21d36ff4112bd4434..de8d42b3f698faff87fcdc4c51aa610aac486fd6 100644 (file)
@@ -1130,7 +1130,6 @@ static ide_driver_t idefloppy_driver = {
        .remove                 = ide_floppy_remove,
        .version                = IDEFLOPPY_VERSION,
        .media                  = ide_floppy,
-       .supports_dsc_overlap   = 0,
        .do_request             = idefloppy_do_request,
        .end_request            = idefloppy_end_request,
        .error                  = __ide_error,
index 7037accb0589df1822d100df9e60a9f5e3784156..1fc1c2a6888fe78aefee3f831cbdc0df792b46e8 100644 (file)
@@ -2607,7 +2607,6 @@ static ide_driver_t idetape_driver = {
        .remove                 = ide_tape_remove,
        .version                = IDETAPE_VERSION,
        .media                  = ide_tape,
-       .supports_dsc_overlap   = 1,
        .do_request             = idetape_do_request,
        .end_request            = idetape_end_request,
        .error                  = __ide_error,
index 5b3bfc78dcddc841ef79dd4758d73e004636e777..4d0c661e78a5b78885e7c40262f5f6c2417630b2 100644 (file)
@@ -562,7 +562,6 @@ int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device
                        unsigned int cmd, unsigned long arg)
 {
        unsigned long flags;
-       ide_driver_t *drv;
        int err = 0, (*getfunc)(ide_drive_t *), (*setfunc)(ide_drive_t *, int);
 
        switch (cmd) {
@@ -612,12 +611,12 @@ int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device
                        if (!capable(CAP_SYS_ADMIN)) return -EACCES;
                        if (arg != (arg & ((1 << IDE_NICE_DSC_OVERLAP) | (1 << IDE_NICE_1))))
                                return -EPERM;
-                       drive->dsc_overlap = (arg >> IDE_NICE_DSC_OVERLAP) & 1;
-                       drv = *(ide_driver_t **)bdev->bd_disk->private_data;
-                       if (drive->dsc_overlap && !drv->supports_dsc_overlap) {
-                               drive->dsc_overlap = 0;
+                       if (((arg >> IDE_NICE_DSC_OVERLAP) & 1) &&
+                           (drive->media == ide_disk ||
+                            drive->media == ide_floppy ||
+                            drive->scsi))
                                return -EPERM;
-                       }
+                       drive->dsc_overlap = (arg >> IDE_NICE_DSC_OVERLAP) & 1;
                        drive->nice1 = (arg >> IDE_NICE_1) & 1;
                        return 0;
                case HDIO_DRIVE_RESET:
index 65cf84b222c57d33c1af31c90d74d381027e663f..a2d003c5e85f373f20226b6768343d1eb446ee2a 100644 (file)
@@ -522,7 +522,6 @@ static ide_driver_t idescsi_driver = {
        .remove                 = ide_scsi_remove,
        .version                = IDESCSI_VERSION,
        .media                  = ide_scsi,
-       .supports_dsc_overlap   = 0,
        .do_request             = idescsi_do_request,
        .end_request            = idescsi_end_request,
        .error                  = idescsi_atapi_error,
index 9cb935f2e7cee28e28b227fc9bfa3f4203ac0f46..e5622bb5a4a1fbac590f97f441ba3bfcbb50fbda 100644 (file)
@@ -912,7 +912,6 @@ enum {
 struct ide_driver_s {
        const char                      *version;
        u8                              media;
-       unsigned supports_dsc_overlap   : 1;
        ide_startstop_t (*do_request)(ide_drive_t *, struct request *, sector_t);
        int             (*end_request)(ide_drive_t *, int, int);
        ide_startstop_t (*error)(ide_drive_t *, struct request *rq, u8, u8);