Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1311741pxb; Wed, 3 Nov 2021 23:20:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwf19/vmeAj+T8xauMgNpXpymxZ7Hyc8/AjFPBWD3hrMMUq3CBsChitUuWwK+CDyotg7S5O X-Received: by 2002:a17:907:3f19:: with SMTP id hq25mr26453134ejc.225.1636006806362; Wed, 03 Nov 2021 23:20:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636006806; cv=none; d=google.com; s=arc-20160816; b=KbEWJSZUhSRXIyJ9rWmpTtL462xZIp8v/mq/x/M+cAKX+jSIheDLjEvT4abpjH7ndg 9wTl7/9JMjyWcdHe3FF8GXGjuKHHyPlwJHXRDNiccQK0GeSwyorvntNeL2SJ6BjYQXHJ kLIPEO3UNZB6h/dbkKa2yZhU6g8k3QLdZRd543gIkgGE1NQHx8OLeNbFVx8bpfyEMRAO 2weTwKj/58QV1uQK+/OjEYpiZ6tMk57h35pTwJFIkShCFFOr2WhzwICjpKS67/DJ8GhM r+qdXbxhsbFmMRobxEjg3diFoVyWehzflmKrAi582FC02b7czkn85Qk/Ndj6VR2tJ0RO pTlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=x/7yWa9TJnaSeRyI/HPqifrDsWRJ3du7nMikT4cHRgc=; b=01KDtGkzBGGBqB3xBm9QiDuqHrMMgXjTJoDNuFVFGF74z9JCRybX43uY6V1ul3Mve7 wR15AicQolcyyawQHkKelF2pVjswFIVcnPVBOhKuQAz5NNZy6Ga0UQKyZwlTw2KuG7PY IoTdZCeViqMBvAwhpqYp+WyXN8CctsCdfzx6M+2JG7XgcwRzx03V9LNWuRvVb1n9tLFx kKDArUZH/tweBm+tvQu8hfLKZMRtv1bxTfVeq5siFe1aIEtMlbNw9xLk6RKkzbnDGPNu kusfddLUJVZLNqqK0rgh7paGCgXRhtEUnNnjCaRQcBna+KJFrqy4BdoBakIgFfRBY9RU 0mdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=i0bqzK23; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m5si6643470edb.488.2021.11.03.23.19.24; Wed, 03 Nov 2021 23:20:06 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=i0bqzK23; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230119AbhKDGWA (ORCPT + 99 others); Thu, 4 Nov 2021 02:22:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229994AbhKDGV7 (ORCPT ); Thu, 4 Nov 2021 02:21:59 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50E24C061714; Wed, 3 Nov 2021 23:19:22 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id p18so5505313plf.13; Wed, 03 Nov 2021 23:19:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=x/7yWa9TJnaSeRyI/HPqifrDsWRJ3du7nMikT4cHRgc=; b=i0bqzK23wAuVTAvxivcIjUs5QJ5W51FYUAqolWFzGQHXH7f7jvcJJxGFjSZHo08JBE EQXvBCNVi9Ui8o2zEWtgSIpgSmCGjPtVD2KELXP7JMH08TOshe6pjRAERpKavq1U+DTR kmJE98pQiVrDwglZj5KflNamJIvnI8WtPnx5bF1wZDbXrJmjPT5n1utYnqarZYHOPSXc yPsBpIwKF76MIR1Phw0WX2k7tjIuloKGbqlm96FnB4DQNrMoKR1+c1JslUgti3MtcwBZ u2xRRRYMRd1iqP/pyWLev/MfozauLev/Bk+8xuF/a4JZdmjb5P7J0LtaRV1pf2zJumGm neIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=x/7yWa9TJnaSeRyI/HPqifrDsWRJ3du7nMikT4cHRgc=; b=jn3m1W0MWb2oVEQNyfhms1kNCFIfyzI7qlQboOpFMITOQvBjKAqK1np577gcyBOxTX 95NEw19U5/gdhA7Sez7G0xIkqIq/wJVKk5ryKvJFd4pxO/tWA4Y6IT99rqyHwpgFniVO lZ7VIYWIAp2sfBQKOzYcT317d2jehGLzZNc7lOei5huMg/7y8V2aqppgzKeh8WVS0P+o YbP5Sa0GWc4j+MLRM0f9yWKhSJPns+gQaz+XnKUZhsDmrj1gfd6hfrHV3el3mhkkeYWO VWBUtZeggpfR/fuWtw1sBvJlQ0vjDYTFsifvlo59jBpsmOr+xrFbhfOs6nTi41s3WUks skmA== X-Gm-Message-State: AOAM531/DpJVfDeMZJtCbtbCnMDj2hnBlYrAuSBbEr219OddS5cjti4Q P97/urg/44WDD5JlpbEPkLA= X-Received: by 2002:a17:902:900c:b0:13f:974c:19b0 with SMTP id a12-20020a170902900c00b0013f974c19b0mr42386170plp.12.1636006761921; Wed, 03 Nov 2021 23:19:21 -0700 (PDT) Received: from debian11-dev-61.localdomain (192.243.120.180.16clouds.com. [192.243.120.180]) by smtp.gmail.com with ESMTPSA id n14sm3212646pgd.68.2021.11.03.23.19.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Nov 2021 23:19:21 -0700 (PDT) From: davidcomponentone@gmail.com X-Google-Original-From: yang.guang5@zte.com.cn To: xuzaibo@huawei.com Cc: davidcomponentone@gmail.com, herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Yang Guang , Zeal Robot Subject: [PATCH] crypto: hisilicon/hpre - use swap() to make code cleaner Date: Thu, 4 Nov 2021 14:19:10 +0800 Message-Id: <20211104061910.1505738-1-yang.guang5@zte.com.cn> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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]); } } -- 2.30.2