Tejun Heo wrote:
+static struct ata_device * ata_find_dev(struct ata_port *ap, int id) +{ + if (likely(id == 0 || (id == 1 && ap->flags & ATA_FLAG_SLAVE_POSS))) + return &ap->device[id]; + return NULL;
static struct ata_device * ata_scsi_find_dev(struct ata_port *ap, const struct scsi_device *scsidev) { - struct ata_device *dev; - - /* skip commands not addressed to targets we simulate */ - if (likely(scsidev->id < ATA_MAX_DEVICES)) - dev = &ap->device[scsidev->id]; - else - return NULL;
You replace a '<' test with a more complex test, which must then be modified when we start supporting Port Multipliers.
It is more simple, and easier, to keep the 'id < ATA_MAX_DEVICES' test AFAICS.
Jeff - : send the line "unsubscribe linux-ide" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html