Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp510114rdb; Fri, 26 Jan 2024 02:25:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IFGxRufpxMjBtIeTDm+sdPULDPioouk4wLIMNtLNYuuIHFm2XyOfSeZYr9YP1afqF5dAc5v X-Received: by 2002:a05:6358:590f:b0:176:916a:9744 with SMTP id g15-20020a056358590f00b00176916a9744mr1418929rwf.13.1706264711402; Fri, 26 Jan 2024 02:25:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706264711; cv=pass; d=google.com; s=arc-20160816; b=Tes3ovqdSQ8ypgq90gYoLxfwBhqDDW2sOMj2EUIYaVZMQOwYfARupSs51elt3aLaaT rkvcI/0YiuKPckYFhNaM57n32yq4lZhg9T/iFAO0avw2CUu5OVZ2qdcs9pNtQsWqPRBG Irjb2MRKWL2hqKXd56iCIYwilfrwlwgsduTkealzKdMeWR90OZqvIVwx8R0P+rMX/wfX RcJe6tVJf8lL7SoPTGuAdq/iEmF4j1ikvny/r3hBcFetUQXPAJwSlr5jNvtghTUaZq+T Lso3eU+M7UeVVQ9CunCUG4ttNaNt9mxuy3kKsLshbrUCFHRhhCAQJyG0so3xDvQk1pHX 1+Pg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=O3W+MzfeWzxKh+3ZG6ba1Dzs068EZsnoqLOC52t5Bi4=; fh=wxe9XR9VLnk0wQjyl0lDu7hTfgxy++r9V/gF2e7GfkU=; b=e2rWjt2kmmKyI9lSchjpMN5SPd4lBJN1DOVIaqsgvwq4oNbGPnWybVRv9/BPxH9ZZG ntRd07Y6qV29tZxPu9bduU48tFrdhhdawujTVWn4aGaDU8nWxBfUDvfgln9LeKQaED2K e4u7JRpjKiZkqqE8h4r8iF4fnxStb6pgqXQkNGTErbovoB2KebdRXoBmH17Z5xFVo9kV 4rS8sr0sGUq21tuEnhlmeCYTYADoTmoZQQkXxlgLBzOZ1L7tI+Ss1UC3Gc9sTaY+qwUv br5xv699/4LpgrCFt5gyDNcvi9SiwsT/FqI0WI9jKqFPCXsHoWEG1UvtN2GZHvClgpv6 ivkQ== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-crypto+bounces-1670-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-1670-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id a16-20020aa78e90000000b006dbe30aeb1dsi930742pfr.112.2024.01.26.02.25.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 02:25:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-1670-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-crypto+bounces-1670-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-1670-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 2BBD729D088 for ; Fri, 26 Jan 2024 10:16:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1EE7D6A348; Fri, 26 Jan 2024 09:39:20 +0000 (UTC) X-Original-To: linux-crypto@vger.kernel.org Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0710A6A32C; Fri, 26 Jan 2024 09:39:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706261960; cv=none; b=GoiUGEb4GPGQCTyP5cr3lYxl36G8F7C60LqFYQQ1EhQoXDcihci/HalA8Sgh0Fwj+hOz0Vw30Yel4VSnmtbPJNWBBVX3ThqiAdirXcOkakTXc1QAgUgryAMnh5AV9P1VcHRJoE0CX/vMQCpYUn+/38ENHanw0zXaj7p+oJBjlZA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706261960; c=relaxed/simple; bh=+PBd62Uy6Enf/+GClkZ0QPTz6bpsbkxzJUJyHuJx3ko=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Kpen0EOlXD0pEMeXJyhnyuY4TwVhxuRX5ysx1axcmXF9mbtg/LJiWqR4SSPMEsVe2MDfMOUkE8zPLxy5MDdNdGzQ8QJnhYVFWuwHk0WUUyIWj201jWJqJeL7wCt7GFGZCXXPrP6Le+7KW09LNjNK4B33LdH946DX4R9nOYSMrHs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4TLt0Q3pDSzXgnW; Fri, 26 Jan 2024 17:37:58 +0800 (CST) Received: from dggpeml500001.china.huawei.com (unknown [7.185.36.227]) by mail.maildlp.com (Postfix) with ESMTPS id BD92818007D; Fri, 26 Jan 2024 17:39:13 +0800 (CST) Received: from huawei.com (10.69.192.56) by dggpeml500001.china.huawei.com (7.185.36.227) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 26 Jan 2024 17:39:13 +0800 From: Qi Tao To: , , CC: , Subject: [PATCH v2 2/4] crypto: hisilicon/sec2 - modify nested macro call Date: Fri, 26 Jan 2024 17:38:26 +0800 Message-ID: <20240126093828.14131-3-taoqi10@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240126093828.14131-1-taoqi10@huawei.com> References: <20240126093828.14131-1-taoqi10@huawei.com> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500001.china.huawei.com (7.185.36.227) Nested macros are integrated into a single macro, making the code simpler. Signed-off-by: Qi Tao --- drivers/crypto/hisilicon/sec2/sec_crypto.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/crypto/hisilicon/sec2/sec_crypto.c b/drivers/crypto/hisilicon/sec2/sec_crypto.c index f028dcfd0ead..692ba3213cc6 100644 --- a/drivers/crypto/hisilicon/sec2/sec_crypto.c +++ b/drivers/crypto/hisilicon/sec2/sec_crypto.c @@ -2145,8 +2145,8 @@ static int sec_skcipher_decrypt(struct skcipher_request *sk_req) return sec_skcipher_crypto(sk_req, false); } -#define SEC_SKCIPHER_GEN_ALG(sec_cra_name, sec_set_key, sec_min_key_size, \ - sec_max_key_size, ctx_init, ctx_exit, blk_size, iv_size)\ +#define SEC_SKCIPHER_ALG(sec_cra_name, sec_set_key, \ + sec_min_key_size, sec_max_key_size, blk_size, iv_size)\ {\ .base = {\ .cra_name = sec_cra_name,\ @@ -2158,8 +2158,8 @@ static int sec_skcipher_decrypt(struct skcipher_request *sk_req) .cra_ctxsize = sizeof(struct sec_ctx),\ .cra_module = THIS_MODULE,\ },\ - .init = ctx_init,\ - .exit = ctx_exit,\ + .init = sec_skcipher_ctx_init,\ + .exit = sec_skcipher_ctx_exit,\ .setkey = sec_set_key,\ .decrypt = sec_skcipher_decrypt,\ .encrypt = sec_skcipher_encrypt,\ @@ -2168,11 +2168,6 @@ static int sec_skcipher_decrypt(struct skcipher_request *sk_req) .ivsize = iv_size,\ } -#define SEC_SKCIPHER_ALG(name, key_func, min_key_size, \ - max_key_size, blk_size, iv_size) \ - SEC_SKCIPHER_GEN_ALG(name, key_func, min_key_size, max_key_size, \ - sec_skcipher_ctx_init, sec_skcipher_ctx_exit, blk_size, iv_size) - static struct sec_skcipher sec_skciphers[] = { { .alg_msk = BIT(0), -- 2.33.0