Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3906610pxf; Tue, 16 Mar 2021 00:15:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylSu3HNBpjJo1nXdwaOxBi1emPf6s2DCfkrrvoeCzEQZ1oUBx/yYvvf/DfYQQMUNXeqqy6 X-Received: by 2002:a17:906:c414:: with SMTP id u20mr27741240ejz.215.1615878919350; Tue, 16 Mar 2021 00:15:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615878919; cv=none; d=google.com; s=arc-20160816; b=TyMatsPLkHMn4lcgL9flAwcvGOw4Xd1chOrjo4hNT7MkVQIQKRpCeDBawx6G3EcNXr QNsS89ct3S8paLNlSimnHO1FhlSdpZ06kchVaDQZB5dWlkZQVmUWRUCdY79GCVTLYEBO p7xNPmfqYUfqX+yMGMiNGY1MiktZU1bVwbS5hGsLZStBueu3qNlVL1BpOP39YThcQoX0 +eVSkv9/8q7HlxHvl71I6TwJWscVAHCaF3gxIN8+jnR597lsOEDF/TrES0t/0ZEw+C7p usAOd4Eu8UbMez/BLLkpUwJYfAv52AvnLfje44Z6tdAxLSiTtJTN0qpD+i4Ti56B1scL r+hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=zXVjTpDKcRO1h8A+bP2TC8/3uOTqxeE8LyBxwzb/g5s=; b=J+iEdH1vMsjHDhAFwvIX2V71W5JoaxO3Gm3lAVIvivQpBl4QAN7SInEjdu1ua+bPZI G3pGZcX8TY2NXo0NoURxqoGcgNg/5jBU35VZpyzIxGfn/ogX2dI8UcxGhOtQe2bCVn2d CCz6fZZXzBkKhUX8qWJz05W9eNCz4dCw9DzAaGzs4N1MRRnBbSSbzFrJpBqkOhOHoQ3a zsjzN9Ze0hvz1DRjmERFOwSlX8kxvEqEGX0PHb19xfxD5vh5wmlTcBqCCASsl6fZ/jEc chOnUO8g1KohF+6/pnZAh/a7QYWCvEZG/8QwHaEkH3MKmGkgAKGRXb+Zcy7qC19MuX2r useQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hisilicon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i13si12377013ejy.93.2021.03.16.00.14.45; Tue, 16 Mar 2021 00:15:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hisilicon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231876AbhCPB7x (ORCPT + 99 others); Mon, 15 Mar 2021 21:59:53 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:13617 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233801AbhCPB7v (ORCPT ); Mon, 15 Mar 2021 21:59:51 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4DzxJK4szsz17Lk2; Tue, 16 Mar 2021 09:57:53 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.498.0; Tue, 16 Mar 2021 09:59:35 +0800 From: chenxiang To: , , , , CC: , , Xiang Chen Subject: [PATCH v2 1/4] crypto: amlogic - Fix the parameter of dma_unmap_sg() Date: Tue, 16 Mar 2021 09:55:23 +0800 Message-ID: <1615859726-57062-2-git-send-email-chenxiang66@hisilicon.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1615859726-57062-1-git-send-email-chenxiang66@hisilicon.com> References: <1615859726-57062-1-git-send-email-chenxiang66@hisilicon.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: Xiang Chen For function dma_unmap_sg(), the parameter should be number of elements in the scatterlist prior to the mapping, not after the mapping. So fix this usage. Signed-off-by: Xiang Chen --- drivers/crypto/amlogic/amlogic-gxl-cipher.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/amlogic/amlogic-gxl-cipher.c b/drivers/crypto/amlogic/amlogic-gxl-cipher.c index 8b5e073..c6865cbd 100644 --- a/drivers/crypto/amlogic/amlogic-gxl-cipher.c +++ b/drivers/crypto/amlogic/amlogic-gxl-cipher.c @@ -236,10 +236,10 @@ static int meson_cipher(struct skcipher_request *areq) dma_unmap_single(mc->dev, phykeyiv, keyivlen, DMA_TO_DEVICE); if (areq->src == areq->dst) { - dma_unmap_sg(mc->dev, areq->src, nr_sgs, DMA_BIDIRECTIONAL); + dma_unmap_sg(mc->dev, areq->src, sg_nents(areq->src), DMA_BIDIRECTIONAL); } else { - dma_unmap_sg(mc->dev, areq->src, nr_sgs, DMA_TO_DEVICE); - dma_unmap_sg(mc->dev, areq->dst, nr_sgd, DMA_FROM_DEVICE); + dma_unmap_sg(mc->dev, areq->src, sg_nents(areq->src), DMA_TO_DEVICE); + dma_unmap_sg(mc->dev, areq->dst, sg_nents(areq->dst), DMA_FROM_DEVICE); } if (areq->iv && ivsize > 0) { -- 2.8.1