Merge tag 'mailbox-v5.20' of git://git.linaro.org/landing-teams/working/fujitsu/integ...
[linux-2.6-microblaze.git] / drivers / ata / libata-scsi.c
index 86dbb1c..29e2f55 100644 (file)
@@ -539,13 +539,13 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg)
        return rc;
 }
 
-static int ata_ioc32(struct ata_port *ap)
+static bool ata_ioc32(struct ata_port *ap)
 {
        if (ap->flags & ATA_FLAG_PIO_DMA)
-               return 1;
+               return true;
        if (ap->pflags & ATA_PFLAG_PIO32)
-               return 1;
-       return 0;
+               return true;
+       return false;
 }
 
 /*
@@ -1060,6 +1060,7 @@ int ata_scsi_dev_config(struct scsi_device *sdev, struct ata_device *dev)
                dev->flags |= ATA_DFLAG_NO_UNLOAD;
 
        /* configure max sectors */
+       dev->max_sectors = min(dev->max_sectors, sdev->host->max_sectors);
        blk_queue_max_hw_sectors(q, dev->max_sectors);
 
        if (dev->class == ATA_DEV_ATAPI) {