lkml.org 
[lkml]   [2022]   [May]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 3/4] scsi: core: Cap shost max_sectors according to DMA optimum mapping limits
From
On 21/05/2022 00:30, Damien Le Moal wrote:
>> diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
>> index f69b77cbf538..a3ae6345473b 100644
>> --- a/drivers/scsi/hosts.c
>> +++ b/drivers/scsi/hosts.c
>> @@ -225,6 +225,11 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
>> shost->cmd_per_lun = min_t(int, shost->cmd_per_lun,
>> shost->can_queue);
>>

Hi Damien,

>> + if (dma_dev->dma_mask) {
>> + shost->max_sectors = min_t(unsigned int, shost->max_sectors,
>> + dma_opt_mapping_size(dma_dev) >> SECTOR_SHIFT);
>> + }
> Nit: you could drop the curly brackets here.

Some people prefer this style - multi-line statements have curly
brackets, while single-line statements conform to the official coding
style (and don't use brackets).

I'll just stick with what we have unless there is a consensus to change.

Thanks,
John

>
>> +
>> error = scsi_init_sense_cache(shost);
>> if (error)
>> goto fail;

\
 
 \ /
  Last update: 2022-05-23 09:21    [W:0.067 / U:0.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site