mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Johannes Thumshirn <jthumshirn@suse.de>
To: John Garry <john.garry@huawei.com>,
	jejb@linux.vnet.ibm.com, martin.petersen@oracle.com
Cc: linuxarm@huawei.com, linux-kernel@vger.kernel.org,
	linux-scsi@vger.kernel.org,
	Xiang Chen <chenxiang66@hisilicon.com>
Subject: Re: [PATCH v4 2/5] scsi: hisi_sas: Relocate some code to reduce complexity
Date: Thu, 6 Dec 2018 15:17:35 +0100	[thread overview]
Message-ID: <c7ec9e23-6da8-35e0-1996-02db3d640f4b@suse.de> (raw)
In-Reply-To: <1544103284-100497-3-git-send-email-john.garry@huawei.com>

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

  reply	other threads:[~2018-12-06 14:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-06 13:34 [PATCH v4 0/5] hisi_sas: DIF support John Garry
2018-12-06 13:34 ` [PATCH v4 1/5] scsi: hisi_sas: Fix warnings detected by sparse John Garry
2018-12-06 13:34 ` [PATCH v4 2/5] scsi: hisi_sas: Relocate some code to reduce complexity John Garry
2018-12-06 14:17   ` Johannes Thumshirn [this message]
2018-12-06 15:37     ` John Garry
2018-12-06 16:20       ` Johannes Thumshirn
2018-12-07 10:07         ` John Garry
2018-12-07 10:53           ` Johannes Thumshirn
2018-12-06 13:34 ` [PATCH v4 3/5] scsi: hisi_sas: Make sg_tablesize consistent value John Garry
2018-12-06 13:34 ` [PATCH v4 4/5] scsi: hisi_sas: Add support for DIF feature for v3 hw John Garry
2018-12-13  2:20   ` Martin K. Petersen
2018-12-13 13:35     ` John Garry
2018-12-17 14:51       ` John Garry
2018-12-18  3:31         ` Martin K. Petersen
2018-12-06 13:34 ` [RFC PATCH v4 5/5] scsi: hisi_sas: Add support for DIX feature for v3 hw as experimental John Garry
2018-12-13  2:23 ` [PATCH v4 0/5] hisi_sas: DIF support Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c7ec9e23-6da8-35e0-1996-02db3d640f4b@suse.de \
    --to=jthumshirn@suse.de \
    --cc=chenxiang66@hisilicon.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=john.garry@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®