From patchwork Fri Apr 8 14:23:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yihao Han X-Patchwork-Id: 559522 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D49FC433F5 for ; Fri, 8 Apr 2022 14:24:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233083AbiDHO0L (ORCPT ); Fri, 8 Apr 2022 10:26:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235284AbiDHO0K (ORCPT ); Fri, 8 Apr 2022 10:26:10 -0400 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2090.outbound.protection.outlook.com [40.107.255.90]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60277352E6F; Fri, 8 Apr 2022 07:24:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZLck4YH2xMV47shKNvvmdfXdAthcq+WafwKhub0Sba50iGpch4B3q+nX+65cYoid98LyxOwtA/qqxpo954teBF3yx64W6bl79Shphat//U397m69ixn+o2PkhX7v/+1mQ18nxqCYbst4IYCgepRxdPepUUfgeGC7N+mFXGUhu+rZYN+bk2ITpZ3/dtP07vdSTHPcWN/sWkuvJS0McxHzWIhhAl4/tnkuf68ke3i2rMePpx8mZiAiNJzMt4GG/yRINMeVN4m8XrVo1wLENHrUJJVk+J3mfx+wB7VdDzQFzQ01IEY14YCRdUqjDyrk5loJt+HYY76JaLaa7WbRksbgIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=t85DBAf5+R4Dg3hVtqs1caraSI5aBhrK1sNq4lkll/g=; b=LPPa7KGCKPZEub4thsrqLwMG2xq65xGzeGT5eOQa36eTJOB2ouR2zbDO7pnu70vlqwCqGtZPSIJdLfhfMMuNs5DHPRBTQK8zXySpYJuZZr8nwDYj2E/jkNwKq8++sLUJvRCOdfIRU+vkRW4ZwLH2taaV+GOdc4ZKohnrsm0uRlo1NjR0zGAqMJX7AnqGYCoOuv+AGBNV/C8/7AGkIMMpWONEcriZDrjdVfktSA85jK2N1XioLxsycEMzB4S00ABZizX5Sns7Uk+DTfbjAuLDJm07rknWYbyBCR4wWLw7Sq4X2g6rXbXzDaNzThbKTJ9jxW8O6WN2bP6Sjl/tgHvrIg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo0.onmicrosoft.com; s=selector2-vivo0-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=t85DBAf5+R4Dg3hVtqs1caraSI5aBhrK1sNq4lkll/g=; b=lTpQEzimFV0H6dYR1AWB7hUbB75yq3g65f/jZ9H+uvsyY+0gxejoDh+1bI9KNgm349hX7fVreyC28pyM2wl1q/LstQ6H9hqwFqCQND1gjtxjwMaWcAefgW8tApI78cEnsXflwBBgklN8ozuU0lyZWKKv1kcHrTsu58Ke+vYCv/4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TYZPR06MB4173.apcprd06.prod.outlook.com (2603:1096:400:26::14) by SI2PR06MB4137.apcprd06.prod.outlook.com (2603:1096:4:f6::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.27; Fri, 8 Apr 2022 14:24:03 +0000 Received: from TYZPR06MB4173.apcprd06.prod.outlook.com ([fe80::2813:af2f:32d0:7be]) by TYZPR06MB4173.apcprd06.prod.outlook.com ([fe80::2813:af2f:32d0:7be%9]) with mapi id 15.20.5144.022; Fri, 8 Apr 2022 14:24:03 +0000 From: Yihao Han To: Herbert Xu , "David S. Miller" , Julia Lawall , Linus Walleij , Yihao Han , Zhen Lei , YueHaibing , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Cc: kernel@vivo.com Subject: [PATCH] crypto: ux500/hash - simplify if-if to if-else Date: Fri, 8 Apr 2022 07:23:49 -0700 Message-Id: <20220408142351.16961-1-hanyihao@vivo.com> X-Mailer: git-send-email 2.17.1 X-ClientProxiedBy: HK2PR02CA0221.apcprd02.prod.outlook.com (2603:1096:201:20::33) To TYZPR06MB4173.apcprd06.prod.outlook.com (2603:1096:400:26::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1176546f-b81f-4d74-fa7e-08da196b6ea0 X-MS-TrafficTypeDiagnostic: SI2PR06MB4137:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ldKxe8Qd0CrdR+lxxVEepCBg0uT+urKTftPZ7DAL+5bR5wJ9myuamCZ7HupkLjUdgp/b1Q3zTomQlAi3cLSfN/yRA/vLCheARWRZB7FyOXHzIvG4yEMtzUqNbj053rCNdCnLouGOS79Bmv6UAJpcHgPoUeLCpQz+39WJbTZrTzEAlA7AFEbnQiQAsB/skgSNYTdRUoYHFGH/pWpDf6Dza3hKmuk6ie1g2kNwDcYJnnyUQ1lGU3ncAMYtLIGzZJiGvnpxXvGT1Fx3y3dooLThl+c38BNk1o1a/TIrD6AsCRa7JBlwXLM34Mv+LWIysQwkzSu3kEuC1LpluYaezO67Lb5Hu0U1GU87I8OYheOqvJH26TXAXqZkB/NObcmuqI8jHGoI3JEvMt7g005GHeMFC7OOrfo6Qp5nVernz4ODwLMawIY2awPjP/eh2dRY9G6hDPX6v2GwER+c8pUzndmEdPbFs+JTSWmZ5xZYpw5QA3UupW7Wf4k0nUB9zmx+zhwt0a2wtMTxVnjtP4196Ey5dXmTrcjGg0j96/YFwlq9zQjbk7lEO1JcI8IFYTPHV/UuPUHW6bhpHKmWQa3nTdLKiPR9olmEs5L/fUWxefh7btEuVwF5BmcZ0UzdaejgsAqz1xc2He9pzs+dwwfOvvBc5NnMyXXjxQEZFYpFpFtoO1JbHlFttezrbGk9nTrkVbWCnkuP6L1EPcx1nLcr4V24Bxj4QdepR6Ybn4xhFJRjGl7hb5U7RzRr7DQsz6UOMDgrVNvqxxexxpEY8SQLL57MQ57aWscaWMGELqe+wATAz8o= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYZPR06MB4173.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(316002)(83380400001)(26005)(186003)(110136005)(2616005)(36756003)(1076003)(107886003)(86362001)(5660300002)(52116002)(8676002)(66946007)(66556008)(4326008)(66476007)(2906002)(6506007)(6512007)(6666004)(508600001)(6486002)(966005)(38350700002)(38100700002)(8936002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GaHIpYaFZg1yUQkmxM9crnAwWu7MEQZruEGX15LPiX0w+AJKoZfUM/Jk3C3XZiuEg9uqQHRntOT+yhNywkEClVa3GLA1OUyoa459DaGJ85UBUy12AFesqUT/ncjBGHmGHotfTrbkTG60kKCL8xaqY7RCf2z1SAO+AuQL06EGBoZ5F5dwpoKaGQb9T0gKAwcYctNDOq0jOVt09Nf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6W50MkWIK1YYt+swGQXp53EBnnCglYj9oWfAlMz6/omQQc8qkSrFOSH8DncCpZxvZ2MFl1xBPe49sR7A+X7+HTHyYyCFWX7Eq+GH27jJGnMZFNas00go2QZzfr/O+1DH/CCnMIaDOItlIVN1HrcRzYqqThit7dR9mYlVfLv/toYDF5Js7TyR0LAKMyG9orDxxNP5Iul24gYR4IWcR7zbNirqVy9VpbyWVMhKq1xa2T2AxmfvOb0aNXOOPavq7hBrmINaRMiPtn1JO2td+AGp601dvn7GTXTlGkXe4+iZ5z+QbmdDc7qWB5BbJoBiFAgnAKIqwaCaxkCkrsii3M+P7eqiDEEM1MnOmS9K96IImWjH4kLi48Zth2HiX/iO6aZD3sKhJLTPCth+J8YLTGBn/daAEKRBI8HapGD5oednEblLVmyY4CMgni87ZPHLF4XcQAkwiUfoyVpA== X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1176546f-b81f-4d74-fa7e-08da196b6ea0 X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB4173.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2022 14:24:03.5990 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Go7NoKkRIE+/zopqkuORF9VbCvebe1yrdTyuggSZIPSaovr0A7QHwgAr/JSrBRWSIPGHWN4nFxzOIt1R/7hB4A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB4137 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Replace `if (!req_ctx->updated)` with `else` for simplification and add curly brackets according to the kernel coding style: "Do not unnecessarily use braces where a single statement will do." ... "This does not apply if only one branch of a conditional statement is a single statement; in the latter case use braces in both branches" Please refer to: https://www.kernel.org/doc/html/v5.17-rc8/process/coding-style.html Signed-off-by: Yihao Han --- drivers/crypto/ux500/hash/hash_core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/crypto/ux500/hash/hash_core.c b/drivers/crypto/ux500/hash/hash_core.c index 5157c118d642..265ef3e96fdd 100644 --- a/drivers/crypto/ux500/hash/hash_core.c +++ b/drivers/crypto/ux500/hash/hash_core.c @@ -877,9 +877,7 @@ static int hash_dma_final(struct ahash_request *req) __func__); goto out; } - } - - if (!req_ctx->updated) { + } else { ret = hash_setconfiguration(device_data, &ctx->config); if (ret) { dev_err(device_data->dev,