Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp4586781pxb; Sun, 27 Mar 2022 22:44:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9ozOB5XmD5pKQlPishfwF5RhAIGyNb6GvuJbNGx3Dh3xWKL9e3m7XSKqWgvJzVCpl3Oz+ X-Received: by 2002:aa7:cdc4:0:b0:419:d0d:fa07 with SMTP id h4-20020aa7cdc4000000b004190d0dfa07mr13953772edw.208.1648446254907; Sun, 27 Mar 2022 22:44:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648446254; cv=none; d=google.com; s=arc-20160816; b=mLgn0Dqx3X9QP6Tb2GDY3kLDuDC+3GaLfjqqwWe6+qvPj0k0+aF5/HIYV6sCHBgJBQ 7T6F4nL3VKGkO5giuk8GrF6Lv0vkQQK2WyZ0l1Pvd6Aaxb5ykhLSQe6tEQaKecHyn/ZW zffBpVYiJzd+YEjskuSATbLQxPuTjeE3uMmYbje2TlylgKuQerqN0WARPgmuJ21DpW1T jwaaI6p7rfWrlJ4aZTrMAfPpoNksdvUpUJDvJtBxYCgu1WRInTQYIG5V2iI+aEXg05MZ FrTiQ+qOlUuc+nLQWbxQ07UBFcGgmDSdEetGt9C8jE0Y1gRIF3RC9UB/cjt+Po3r9FcU 4FRg== 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; bh=0sr1GJaN7orvZXQm+DkjNB4xOfgLl97kBLL54KUQd7U=; b=tdZTT7WwCO2BWN14sl+N2WfNyD1r33nsE9TgQpFNYN0gHyAsCuD9HMdRw6yF7wUF3K 2BNrTZ6aPO90sn11LKd4eShewT2w7YTHHQnD69YSpdgByzHum9x9S0VJG+fGN+YcDvIL jW+Q8kUAfRs3GxPFaOfiq611nKV4HXsOsR7pKdV0/Gl+dUup7SzV04Ehf5tjw6Z3qLpV sZW5XTDozCQ5fqhTrY/VdEq6LwhHhSbmvDxlnvZLXoqluzW6tFgvbEN7xR0NXKvOt8zD gZpQybIHh1q/KRi6vzUL18rgpjuPMEZpFNHU+07Ew5a1frZjwH1aIMyiCDSXdTQBsE14 TXqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e9-20020a170906504900b006df76385d3dsi12683318ejk.477.2022.03.27.22.43.17; Sun, 27 Mar 2022 22:44:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234018AbiCZRta (ORCPT + 99 others); Sat, 26 Mar 2022 13:49:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232395AbiCZRt3 (ORCPT ); Sat, 26 Mar 2022 13:49:29 -0400 X-Greylist: delayed 1200 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sat, 26 Mar 2022 10:47:51 PDT Received: from mail.thepaulodoom.com (www.thepaulodoom.com [45.77.108.202]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4296C36B56; Sat, 26 Mar 2022 10:47:51 -0700 (PDT) Received: from localhost (h252.183.30.69.ip.windstream.net [69.30.183.252]) by vultr.guest (OpenSMTPD) with ESMTPSA id 915f4e9a (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Sat, 26 Mar 2022 17:21:10 +0000 (UTC) From: Paul Lemmermann To: davem@davemloft.net Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Lemmermann Subject: [PATCH] crypto: aes_generic: fixed styling warnings Date: Sat, 26 Mar 2022 12:20:51 -0500 Message-Id: <20220326172051.14722-1-thepaulodoom@thepaulodoom.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fixed all styling warnings from the checkpatch.pl script. Signed-off-by: Paul Lemmermann --- crypto/aes_generic.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/crypto/aes_generic.c b/crypto/aes_generic.c index 27ab27931..322e345ac 100644 --- a/crypto/aes_generic.c +++ b/crypto/aes_generic.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Cryptographic API. * @@ -56,7 +57,7 @@ #include #include -static inline u8 byte(const u32 x, const unsigned n) +static inline u8 byte(const u32 x, const unsigned int n) { return x >> (n << 3); } @@ -325,6 +326,7 @@ __visible const u32 crypto_ft_tab[4][256] ____cacheline_aligned = { 0x7bcbb0b0, 0xa8fc5454, 0x6dd6bbbb, 0x2c3a1616, } }; +EXPORT_SYMBOL_GPL(crypto_ft_tab); static const u32 crypto_fl_tab[4][256] ____cacheline_aligned = { { @@ -853,6 +855,7 @@ __visible const u32 crypto_it_tab[4][256] ____cacheline_aligned = { 0x7b6184cb, 0xd570b632, 0x48745c6c, 0xd04257b8, } }; +EXPORT_SYMBOL_GPL(crypto_it_tab); static const u32 crypto_il_tab[4][256] ____cacheline_aligned = { { @@ -1118,8 +1121,6 @@ static const u32 crypto_il_tab[4][256] ____cacheline_aligned = { } }; -EXPORT_SYMBOL_GPL(crypto_ft_tab); -EXPORT_SYMBOL_GPL(crypto_it_tab); /** * crypto_aes_set_key - Set the AES key. @@ -1144,34 +1145,34 @@ EXPORT_SYMBOL_GPL(crypto_aes_set_key); /* encrypt a block of text */ -#define f_rn(bo, bi, n, k) do { \ +#define f_rn(bo, bi, n, k) while (0) { \ bo[n] = crypto_ft_tab[0][byte(bi[n], 0)] ^ \ crypto_ft_tab[1][byte(bi[(n + 1) & 3], 1)] ^ \ crypto_ft_tab[2][byte(bi[(n + 2) & 3], 2)] ^ \ crypto_ft_tab[3][byte(bi[(n + 3) & 3], 3)] ^ *(k + n); \ -} while (0) +} -#define f_nround(bo, bi, k) do {\ +#define f_nround(bo, bi, k) while (0) {\ f_rn(bo, bi, 0, k); \ f_rn(bo, bi, 1, k); \ f_rn(bo, bi, 2, k); \ f_rn(bo, bi, 3, k); \ k += 4; \ -} while (0) +} -#define f_rl(bo, bi, n, k) do { \ +#define f_rl(bo, bi, n, k) while (0) { \ bo[n] = crypto_fl_tab[0][byte(bi[n], 0)] ^ \ crypto_fl_tab[1][byte(bi[(n + 1) & 3], 1)] ^ \ crypto_fl_tab[2][byte(bi[(n + 2) & 3], 2)] ^ \ crypto_fl_tab[3][byte(bi[(n + 3) & 3], 3)] ^ *(k + n); \ -} while (0) +} -#define f_lround(bo, bi, k) do {\ +#define f_lround(bo, bi, k) while (0) {\ f_rl(bo, bi, 0, k); \ f_rl(bo, bi, 1, k); \ f_rl(bo, bi, 2, k); \ f_rl(bo, bi, 3, k); \ -} while (0) +} static void crypto_aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) { @@ -1214,12 +1215,12 @@ static void crypto_aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) /* decrypt a block of text */ -#define i_rn(bo, bi, n, k) do { \ +#define i_rn(bo, bi, n, k) while (0) { \ bo[n] = crypto_it_tab[0][byte(bi[n], 0)] ^ \ crypto_it_tab[1][byte(bi[(n + 3) & 3], 1)] ^ \ crypto_it_tab[2][byte(bi[(n + 2) & 3], 2)] ^ \ crypto_it_tab[3][byte(bi[(n + 1) & 3], 3)] ^ *(k + n); \ -} while (0) +} #define i_nround(bo, bi, k) do {\ i_rn(bo, bi, 0, k); \ @@ -1229,19 +1230,19 @@ static void crypto_aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) k += 4; \ } while (0) -#define i_rl(bo, bi, n, k) do { \ +#define i_rl(bo, bi, n, k) while (0) { \ bo[n] = crypto_il_tab[0][byte(bi[n], 0)] ^ \ crypto_il_tab[1][byte(bi[(n + 3) & 3], 1)] ^ \ crypto_il_tab[2][byte(bi[(n + 2) & 3], 2)] ^ \ crypto_il_tab[3][byte(bi[(n + 1) & 3], 3)] ^ *(k + n); \ -} while (0) +} -#define i_lround(bo, bi, k) do {\ +#define i_lround(bo, bi, k) while (0) {\ i_rl(bo, bi, 0, k); \ i_rl(bo, bi, 1, k); \ i_rl(bo, bi, 2, k); \ i_rl(bo, bi, 3, k); \ -} while (0) +} static void crypto_aes_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) { -- 2.35.1