Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp705231pxv; Thu, 22 Jul 2021 10:09:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJziFhunIZ3fF8zGUM0SN9ngYosN2WtC3Ft2VkSfZKcBFhNmcGV1LklSN7p1gb38Xy77hUTv X-Received: by 2002:a92:cd4d:: with SMTP id v13mr543770ilq.107.1626973755771; Thu, 22 Jul 2021 10:09:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626973755; cv=none; d=google.com; s=arc-20160816; b=VA5/7+qXBy2xkC4IOmx+DlOfd7GpwZ355K5w3zFaINbfymaBHhpNyra03UHJ9w/Iu/ yFyi2Zj7KYn8RVIlqvzyVXZlfRU9Hcxn49TFPpPINmtLp5qk8Z1koecBw9Zc/c+Ei50X YShkunN7/iRlku88MLI0/5jLVXRTVCouxzicuTwuZiADiU0N44+AErw9FuCnBu8sign1 2+TUeg8sd4MYw43iWqzwGWAKo96LcWYPASgTTVj+F8UBWnEBZDz60Sg3DIl92jeYcgvL s+PiTr1aSxDPEYvi9k2ViGCAyXVmRGWcq8fki6D4aQnRI2RfSUTXSRsE/Xpl0q35JFcw xG0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=BM24k6H9LcY/dUUeA4LE+RhfS6GQmXK+4XERxfAvlv0=; b=hF4Qh/FFdGhpSMHh3+yHP2GX4KIGoK+2ITNrmrF+ivFOjPESYULNSk5OCAA/mgcSgc lwJv+v99D+TztB8ogkepPGF9uW5tFc4sEtVhaYL40zVzFEi/fGccgxgEGD1Moy3P4cSe lNRJHyQXKTMysoULcGdDMgFet0tA3FpZ55Xc0DYVFfDSo79ZZaK13A1JlB9rJIpIxF6W XpUvFRdVHYElKZ8oPxoZs7UiacZim/4MdqtdBYUUkzKO3yq8I5wP9y9Cd47gFLCbCl6f puj8LC/uX0Cz0dOrDSV6UBaOHSu7cb5Ny6dauOqMDGsBMc2usY20A2ZHqRsSAcykVIzX XUmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="EGJzKVW/"; 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 h2si31459158ils.86.2021.07.22.10.08.38; Thu, 22 Jul 2021 10:09:15 -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=20161025 header.b="EGJzKVW/"; 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 S233090AbhGVQ16 (ORCPT + 99 others); Thu, 22 Jul 2021 12:27:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233071AbhGVQ15 (ORCPT ); Thu, 22 Jul 2021 12:27:57 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4E48C061575; Thu, 22 Jul 2021 10:08:31 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id h24-20020a1ccc180000b029022e0571d1a0so16539wmb.5; Thu, 22 Jul 2021 10:08:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=BM24k6H9LcY/dUUeA4LE+RhfS6GQmXK+4XERxfAvlv0=; b=EGJzKVW/kRPjNGPb3PpWvJp0lL9sDmOkyFaIWjQOFlnDL3jl44Mx6wQfAyNRu1guxz wV1u73JJHMVl7EYbQOUcVLRVUPztU9PnIN3GXofRe7W6hfiBQMxPlW6d16YH80OBJ3rg pmmt5MsFbbbujjtLZPN6UDNOfOnWbg8+gttPgueZw7XILapxG4uCF/EV71qBnLXvQZBO Yqd1XHBsi1IjWqQbrGSDFuWtunt6ZUfRafXcAd55XGVZZcxId9f/bSjwwBd54cTec8rf cj0wCX2BjGPE6t26cKZmHhsg/ZQhY1CAEgd2h7J+/p2NTOO+YBzt9Ng68SwsfrwaqvcT gN2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=BM24k6H9LcY/dUUeA4LE+RhfS6GQmXK+4XERxfAvlv0=; b=Fg48gkxz5vCxM8XuBmeeDdaAiZ/zV5o/jEJzegrYbFGtTog5YV+FYtpvRQOG82Yz3v t8tSup4hwrkDbJFWHTvAyZZegc3oJ6rKKlHiXCCgbxyBhTopNyj8G96/0PMGap7DpQ6n 9oAaGD4/tc/paYFQkXUj6bGt+mhQkGZPCfbnSLezHLQR/fZ3+lrokxRW0Ig1Ddmjb29u cC8Tr86rQPzfy6dyqQZqFySBFqBlujZZ0kS5KmcdFL5FxMh4k45Tui7D6I+vr9LDBbLP CdIzv+VCSUzGvGmUdowmqCoDv95i0RZCeFHivY/ab813xBj3E9fji9LibK7zuq7fW3YE qmjA== X-Gm-Message-State: AOAM530+a7W7NiPiqOLJ1G6kdRzuPtVeL0bnHADshu+99ji83kFYSgeq hahyk7EtoOX5vZ/NlKIpCUw= X-Received: by 2002:a7b:cd15:: with SMTP id f21mr601085wmj.148.1626973710339; Thu, 22 Jul 2021 10:08:30 -0700 (PDT) Received: from pc ([196.235.233.206]) by smtp.gmail.com with ESMTPSA id w18sm8513884wrs.44.2021.07.22.10.08.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jul 2021 10:08:29 -0700 (PDT) Date: Thu, 22 Jul 2021 18:08:27 +0100 From: Salah Triki To: Herbert Xu , "David S. Miller" , Nicolas Ferre , Alexandre Belloni , Ludovic Desroches , gregkh@linuxfoundation.org Cc: linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [RESEND] crypto: atmel-aes: use swap() Message-ID: <20210722170827.GA4362@pc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Use swap() instead of implementing it in order to make code more clean. Signed-off-by: Salah Triki --- drivers/crypto/atmel-aes.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index b1d286004295..60041022c4f5 100644 --- a/drivers/crypto/atmel-aes.c +++ b/drivers/crypto/atmel-aes.c @@ -1819,12 +1819,8 @@ static int atmel_aes_xts_process_data(struct atmel_aes_dev *dd) * the order of the ciphered tweak bytes need to be reversed before * writing them into the ODATARx registers. */ - for (i = 0; i < AES_BLOCK_SIZE/2; ++i) { - u8 tmp = tweak_bytes[AES_BLOCK_SIZE - 1 - i]; - - tweak_bytes[AES_BLOCK_SIZE - 1 - i] = tweak_bytes[i]; - tweak_bytes[i] = tmp; - } + for (i = 0; i < AES_BLOCK_SIZE/2; ++i) + swap(tweak_bytes[i], tweak_bytes[AES_BLOCK_SIZE - 1 - i]); /* Process the data. */ atmel_aes_write_ctrl(dd, use_dma, NULL); -- 2.25.1