Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp220685ybg; Fri, 25 Oct 2019 20:02:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqzBjPXbY06P2Jwccc3AJNZNfvdIEXE+uqaBdHJEy/IlCiWz/yULy5UtmTS3hnE8nl+9y37Q X-Received: by 2002:a50:b6e1:: with SMTP id f30mr7493548ede.212.1572058927505; Fri, 25 Oct 2019 20:02:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572058927; cv=none; d=google.com; s=arc-20160816; b=S9QvPH8BCVbv5sgKfK/l+56kFJHU49A+wYA8vj+FbMRO6U8hOX0MAJJpndd9kGBTcq oXDLqzr0PFrmPAMc46exUFEm8x6Bq66cG9Kqu/tupTDoYfqX1djZwRIto7nlhlW3nI2I YBUmseE4+gOTxkqx0MoMj7wyiONrIUTbbDduC7GRbiDxSSpa7KrLM1Xvawtp8xWvIPdR bIKjkL798hB5I4WzjtToRpOitix6TOArZ/ZRb8kweTFupKDDjRktnzmO3T2OLfGEyZX+ 5jIKTJNCFrpwjrvHIpFiMS+JdlQ6QQkytDqGOSOkWCgk109lXPM48KKUYVnG4XNczG1g qlUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=jzUhOibosUuZYSZJZYHOYx9Kn2E2cbga5yOg0rHzIhQ=; b=LbEmgUoZc7iy2uOlBY1I5Gh8y1IPePpGD+jdEjXus1pk+2/vrcypzcEh0xUe7infq+ P2F9UtvKaryenieZXS9hBYYixtE3u7qJ6U7yXYod1wMbIwYKQFZboDHv81eW5x/nSdo1 DQJ7V2kbrgZ4EgbZiO19cMHq8BRls0HjSkJgsAKehWhhwUl/GqYUHGeBD4o+7un1qwz6 Akskbspn3HresKeh2rAjrZogmcTksm5/PSwF5aHInpFaC2zs17wnhPit2n/za0XVPlRZ DqVs97h3K+fhdRPIJ6Eefhfr75/tvFDTogqVav/Ls9RVGLqy/MzqSLVq1iwpq3Zq4Q3t gdEg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f12si2925696edc.1.2019.10.25.20.01.29; Fri, 25 Oct 2019 20:02:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725997AbfJZDB2 (ORCPT + 99 others); Fri, 25 Oct 2019 23:01:28 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:33558 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725957AbfJZDB2 (ORCPT ); Fri, 25 Oct 2019 23:01:28 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 505A5BCBC53AA533256D; Sat, 26 Oct 2019 11:01:25 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.439.0; Sat, 26 Oct 2019 11:01:18 +0800 From: Zhou Wang To: Herbert Xu , "David S. Miller" CC: , Zhou Wang Subject: [PATCH] crypto: hisilicon - use sgl API to get sgl dma addr and len Date: Sat, 26 Oct 2019 10:57:21 +0800 Message-ID: <1572058641-173376-1-git-send-email-wangzhou1@hisilicon.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Use sgl API to get sgl dma addr and len, this will help to avoid compile error in some platforms. So NEED_SG_DMA_LENGTH can be removed here, which can only be selected by arch code. Signed-off-by: Zhou Wang Suggested-by: Herbert Xu --- drivers/crypto/hisilicon/Kconfig | 1 - drivers/crypto/hisilicon/sgl.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/hisilicon/Kconfig b/drivers/crypto/hisilicon/Kconfig index a71f2bf..82fb810d 100644 --- a/drivers/crypto/hisilicon/Kconfig +++ b/drivers/crypto/hisilicon/Kconfig @@ -18,7 +18,6 @@ config CRYPTO_DEV_HISI_QM tristate depends on ARM64 || COMPILE_TEST depends on PCI && PCI_MSI - select NEED_SG_DMA_LENGTH help HiSilicon accelerator engines use a common queue management interface. Specific engine driver may use this module. diff --git a/drivers/crypto/hisilicon/sgl.c b/drivers/crypto/hisilicon/sgl.c index bf72603..012023c 100644 --- a/drivers/crypto/hisilicon/sgl.c +++ b/drivers/crypto/hisilicon/sgl.c @@ -164,8 +164,8 @@ static struct hisi_acc_hw_sgl *acc_get_sgl(struct hisi_acc_sgl_pool *pool, static void sg_map_to_hw_sg(struct scatterlist *sgl, struct acc_hw_sge *hw_sge) { - hw_sge->buf = sgl->dma_address; - hw_sge->len = cpu_to_le32(sgl->dma_length); + hw_sge->buf = sg_dma_address(sgl); + hw_sge->len = cpu_to_le32(sg_dma_len(sgl)); } static void inc_hw_sgl_sge(struct hisi_acc_hw_sgl *hw_sgl) -- 2.8.1