Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp271929pxb; Mon, 8 Feb 2021 23:05:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJxMOJy/sUzm/ZBnexvJs0o2ihZygNkIA/ZAKyhnvaGfwJPflAsjJVznyAKGhMAJYcwpKPtx X-Received: by 2002:a17:906:4442:: with SMTP id i2mr21190480ejp.41.1612854346077; Mon, 08 Feb 2021 23:05:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612854346; cv=none; d=google.com; s=arc-20160816; b=lv6FOWrhB6Q7THXtgCgWGelkajE26aadr18B99RAdWiJ8CS8VUuwGeGBRmtUUMNUa0 Wx2iOZQ4F5UzvME8AmxMmk33jEtCPov6u8LQoD/C0yz7cPTmHezjkvhbJUyImZG+xAyr 4647g2qQhkHxTPPRkYYu89oQXf0P2snRy6A/cQQkp6Ui5fAHRotqqpjZY7jg+Jl73nqN 34pR1W9c5O+K18eBWpnhL/5UaKvG5DArSSBKAh9HKQtbLPlZ3UWjlM0CL67wQCKhAERW fqco4CEzlcTafp6DYuXnjgUtIIF6iXq3vXp2s8Qeb5KiTju7A2HkXy27SMG7v1yJB2eb wyEQ== 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=COS3l1WD4and9pgVMUKzmj2o/RuZq25Uh5DcTqCfaQ/mTf8YV5FtHCF50ihbw6JYJh oRCnCKTdTVxNcAgIMZ8/swENugfpEvXJnH2L0N4fvSqIJI4knaSmUh/NaXuwTT3yWpCi KvnCyb4fzw3I0Ku+xTImLE6j+8pAQUKmtv0ybvxHTSJ/qUkVcqEQyuK8Icww5+UcBZId Dh9oAdvLkgbIPktSx21F5rgxPwhga73B+9QCTOwwOTVVv/52fPcuiumQPHSxKqI1dLrN BQpTqZI0Bb3vvdkHDuqd9dNmilBNfBz9EDYd7b3S7SKQad3SSv8Wc+IW9dJ5tlwbkWlC B20A== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k23si2329162ejq.693.2021.02.08.23.05.22; Mon, 08 Feb 2021 23:05:46 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229704AbhBIHEc (ORCPT + 99 others); Tue, 9 Feb 2021 02:04:32 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:11713 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229639AbhBIHEc (ORCPT ); Tue, 9 Feb 2021 02:04:32 -0500 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4DZYjT2pT7zlHvJ; Tue, 9 Feb 2021 15:02:05 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.498.0; Tue, 9 Feb 2021 15:03:30 +0800 From: chenxiang To: , , , , CC: , , , Xiang Chen Subject: [PATCH 1/4] crypto: amlogic - Fix the parameter of dma_unmap_sg() Date: Tue, 9 Feb 2021 14:59:22 +0800 Message-ID: <1612853965-67777-2-git-send-email-chenxiang66@hisilicon.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1612853965-67777-1-git-send-email-chenxiang66@hisilicon.com> References: <1612853965-67777-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