lkml.org 
[lkml]   [2018]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v4 2/5] scsi: hisi_sas: Relocate some code to reduce complexity
From
Date
On 06/12/2018 14:34, John Garry wrote:
[...]
> +static void hisi_sas_dma_unmap(struct hisi_hba *hisi_hba,
> + struct sas_task *task, int n_elem,
> + int n_elem_req, int n_elem_resp)
> +{
> + struct device *dev = hisi_hba->dev;
> +
> + if (!sas_protocol_ata(task->task_proto)) {
> + if (task->num_scatter) {
> + if (n_elem)
> + dma_unmap_sg(dev, task->scatter,
> + task->num_scatter,
> + task->data_dir);
> + } else if (task->task_proto & SAS_PROTOCOL_SMP) {
> + if (n_elem_req)
> + dma_unmap_sg(dev, &task->smp_task.smp_req,
> + 1, DMA_TO_DEVICE);
> + if (n_elem_resp)
> + dma_unmap_sg(dev, &task->smp_task.smp_resp,
> + 1, DMA_FROM_DEVICE);
> + }
> + }

if (sas_protocol_ata(task->task_proto))
return;

Would save you a level of indentation and make the above more readable.


--
Johannes Thumshirn SUSE Labs Filesystems
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

\
 
 \ /
  Last update: 2018-12-06 15:17    [W:0.109 / U:5.876 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site