Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1454570pxb; Thu, 4 Nov 2021 02:34:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztd5pW2OX9YhPMthg+1sNQ9SVrx0N8wcSDnLZUtkqPHihUBbVp4OECpFWt4+UP38HSqCtj X-Received: by 2002:a17:906:3b95:: with SMTP id u21mr32912230ejf.156.1636018495152; Thu, 04 Nov 2021 02:34:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636018495; cv=none; d=google.com; s=arc-20160816; b=HmNekOvgnx/6u9Cp3nHbg+pz/7P+rNv/JX+up4PtdrmWzXreUxL28mBgHh4d62f0Ij aM0oJ1I1ay20hnW5jA7ZRwelW3jTI/jzOx0rz7mINfHzG3a6qC0T5B++d9q6H9YqEvsr LmWKp5q5wiWARAlbYch7tKqml6fpwflwUqMXNPQRF3bvsESz7Hk4czVTzCsCx8Wq/FTS mR49twDD8nrbmr413Apw5ZcApXAFDXK6hc2n6bfKhbSjBfnT3EheIj1QRdvxEZdjG5et Db79VQslm9XLeKmUwpUHl9ga9udl85ae5tQezF37iJ08XVr+2y4EoiZxAfSvgeQpMscJ 2J6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=hq52cffmB9qZwG8LmfaCnYv5ayTm8p9Eaj6MlvgabTA=; b=f9QJSIEgZcL/F7rI8IMyFOLcudDfWwE9lK5DZTrbfOdkW107kQeIQThdrB5QTqyn5N Nj1+NiUPQiWGkwe2ADXQn7OwQmvgiNG1dah9622tpjUTEQct61FonWywN+SDwdYyt5/l E1xF7TnVTymAVtAYDw//kX7eUhr6DbQUrH8DugWS+u44r0jawAgjzygvY1KMo2SqGuWq Zh+X2TDEShAZY/4I81I+tvSw169CB3kM09D0N1o30r/uLVAHb262YOh6k4pPtW0BI51q +sp3S6+5UXyHpm14nh5IuTx+5lYCBqdFSnf+vRObGUbQikVZEaeD0SOLv1n3rSG/QGwH 0thw== 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=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w13si8393203edc.579.2021.11.04.02.34.15; Thu, 04 Nov 2021 02:34:55 -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=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230450AbhKDJgt (ORCPT + 99 others); Thu, 4 Nov 2021 05:36:49 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:30920 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230365AbhKDJgs (ORCPT ); Thu, 4 Nov 2021 05:36:48 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4HlJHk3Fhzzcb1M; Thu, 4 Nov 2021 17:29:22 +0800 (CST) Received: from kwepemm600005.china.huawei.com (7.193.23.191) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Thu, 4 Nov 2021 17:34:07 +0800 Received: from [10.67.102.118] (10.67.102.118) by kwepemm600005.china.huawei.com (7.193.23.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Thu, 4 Nov 2021 17:34:06 +0800 Subject: Re: [PATCH] crypto: hisilicon/hpre - use swap() to make code cleaner To: , CC: , , , , Yang Guang , Zeal Robot References: <20211104061910.1505738-1-yang.guang5@zte.com.cn> From: liulongfang Message-ID: <5913a9db-6cb7-6752-51ec-f6d09aa612ff@huawei.com> Date: Thu, 4 Nov 2021 17:34:06 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20211104061910.1505738-1-yang.guang5@zte.com.cn> Content-Type: text/plain; charset="gbk" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.102.118] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemm600005.china.huawei.com (7.193.23.191) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 2021/11/4 14:19, davidcomponentone@gmail.com wrote: > From: Yang Guang > > Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid > opencoding it. > > Reported-by: Zeal Robot > Signed-off-by: Yang Guang > --- > drivers/crypto/hisilicon/hpre/hpre_crypto.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/drivers/crypto/hisilicon/hpre/hpre_crypto.c b/drivers/crypto/hisilicon/hpre/hpre_crypto.c > index a032c192ef1d..0f1724d355b8 100644 > --- a/drivers/crypto/hisilicon/hpre/hpre_crypto.c > +++ b/drivers/crypto/hisilicon/hpre/hpre_crypto.c > @@ -1177,13 +1177,10 @@ static void hpre_rsa_exit_tfm(struct crypto_akcipher *tfm) > static void hpre_key_to_big_end(u8 *data, int len) > { > int i, j; > - u8 tmp; > > for (i = 0; i < len / 2; i++) { > j = len - i - 1; > - tmp = data[j]; > - data[j] = data[i]; > - data[i] = tmp; > + swap(data[j], data[i]); > } > } > > OK! Thanks. Longfang.