scsi: core: Drop dev->dma_mask check in evaluating max_sectors

When evaluating shost->max_sectors, we currently check dma_dev->dma_mask is
non-NULL, as dma_max_mapping_size(dma_dev) could previously not handle
unset dma_dev->dma_mask - this is no longer the case.

Signed-off-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://patch.msgid.link/20260629085310.2298552-3-john.g.garry@oracle.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
John Garry 2026-06-29 08:53:10 +00:00 committed by Martin K. Petersen
parent 81d273096f
commit 6e468644fc

View File

@ -252,10 +252,8 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
shost->dma_dev = dma_dev;
if (dma_dev->dma_mask) {
shost->max_sectors = min_t(unsigned int, shost->max_sectors,
dma_max_mapping_size(dma_dev) >> SECTOR_SHIFT);
}
shost->max_sectors = min_not_zero(shost->max_sectors,
dma_max_mapping_size(dma_dev) >> SECTOR_SHIFT);
error = scsi_mq_setup_tags(shost);
if (error)