From patchwork Tue Dec 27 23:03:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 37008 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1620600wrt; Tue, 27 Dec 2022 15:05:29 -0800 (PST) X-Google-Smtp-Source: AMrXdXsSve+C0Li572X2NASeL1Ipf8GSWDXFJt0YT4KOd3wKqvq1/Iny4vWuY6BLdAyzjD3BKI/x X-Received: by 2002:a17:907:d68e:b0:7c1:37:421c with SMTP id wf14-20020a170907d68e00b007c10037421cmr19381842ejc.32.1672182329013; Tue, 27 Dec 2022 15:05:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672182328; cv=none; d=google.com; s=arc-20160816; b=f6pp/b9ugdqi27gg5TlGv5UI+PPt2aRiCHSV9NGdifawaWtZlr0EwLpklszPjomkgq eR7zn2tFrpdelULzM168Acb7hcigwXBJAAGtaEhJ3Nbo42X+3fmHgotUhM2YsTdJMG4Q rLmbzZYNFUKvCuupQMjoY740V1GqTAxZaG2Qj+7o9rc+1DpW8d1Ti6iIY+LOYb28mUUL bKVwJ5NlUHyuSSdLlzwWMvURQ8W9Ai85iYXo4j5fWoH+48+Z5pFyC28JV9FZkS4kSogd D/QTNy6j4CzDsL6pzaCbClAauc+V+XXmkaamImglFnzprT4SL6+gsnDfvyAR0rGA5m81 tQIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=i2N7NNifAQ86WoZ7rTUxWJfmzgVYj68lx1CkkjLHfuc=; b=NopK7o1BB9mQIcEH2b0aOh+1pAKKVWpGdpTOBaeaVv0lHJUqNhxeHXR1jSXDCtGFYo 0mjMXxPqX3rnk/uFNwCFuVWQTSsJOs2Ifw+QspTrft0slJIMdIP4PRMeHv2WncvuU2MS wP4BcMz03jtzviFpi9TiraAx1qKitIo+eA2A3UlnYH64Axje8QIDxLjb7YJXORYVpPbO +KRkhWdAXF3OG7HEx+HwwMbAy8If0nml/FyL2cRjfDf9bl1KNxjyR+Ji7l85ND3pX1gF QZ19acu55JJXvcCdrsPjmeY6isDANuqbM3bl+reX8fmpSGai6rwvTk2FL+PwqXfUKCR8 LDiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oKTHfe5W; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xe11-20020a170907318b00b008164d650e3dsi11708073ejb.318.2022.12.27.15.05.04; Tue, 27 Dec 2022 15:05:28 -0800 (PST) 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; dkim=pass header.i=@linaro.org header.s=google header.b=oKTHfe5W; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229915AbiL0XEi (ORCPT + 99 others); Tue, 27 Dec 2022 18:04:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231382AbiL0XEC (ORCPT ); Tue, 27 Dec 2022 18:04:02 -0500 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E820DF95 for ; Tue, 27 Dec 2022 15:03:56 -0800 (PST) Received: by mail-lj1-x235.google.com with SMTP id e13so12488427ljn.0 for ; Tue, 27 Dec 2022 15:03:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=i2N7NNifAQ86WoZ7rTUxWJfmzgVYj68lx1CkkjLHfuc=; b=oKTHfe5WpDJ+0S0x9Q64mivXn6gj2tUZMKKd+8RnEujrrZl0qNLXkvCbulXJooqt04 EoqpfufbUrXy9fHKA/OlX/D7kQNF3+6GgR5OXGr5Gkp61L/j4g6Pb6bS64LBj7/OVVX0 42UnDcK2eAj9hkH+31lKbADQ5LIwKAK6CiSzZkIrvYw9oUvs5icpP537v50zIj435cCu B0TADlrv2/+zvFxwe8Y8/mmkevlhPAIZ0zCY+4W2dKqmmFRJD8SXZyQMXRUdrRXq2KZR nYV7FVyieFgWYBAHV4DIim/oxTMFmGRoFTXhYm2Aab//s3485UxwOZ0URpjJj6ppgvJu AkwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i2N7NNifAQ86WoZ7rTUxWJfmzgVYj68lx1CkkjLHfuc=; b=6NiyWxP3OlrFq2w+mFaJsAeJ8PAP9mUgb6pGUabv4JA4XUSLpqD1ZGTt+mirdytdrW D7HhatgRcBc9Zt5HuEx6BJUKpCmV4LIXgdOP6Ojg9vZYWCOh4rYZ/K6TjvIl9kqIY0Zn zl2hwO1qhnZ4Y1+EU1xRV7EayI3GMT0QPcwCJFXEjN8Yxc5pTQseQXlyfL0p9AdyQIjh DfkE2o265JP7LsOy9r47ScymiP+7/QOYcBLinPejaQwXlbCcZ4zKn8JAHIvIi5dtdkTz kmeaBwUL4qylnaeljaeLPxU73DM1/WdpE7bs8IUNbgqEAekeWXh8WD+Xj9XglRk/PRhd CkIg== X-Gm-Message-State: AFqh2kqlnpAHSZrcv9r8+R76Qtj+DxcAsWRI+FXT6Wz6JVg8k73ZbiZt lCvztFN7MCrgkGwg8xe71f22yw== X-Received: by 2002:a2e:954f:0:b0:27f:c258:b24a with SMTP id t15-20020a2e954f000000b0027fc258b24amr1866334ljh.11.1672182235821; Tue, 27 Dec 2022 15:03:55 -0800 (PST) Received: from Fecusia.local (c-05d8225c.014-348-6c756e10.bbcust.telenor.se. [92.34.216.5]) by smtp.gmail.com with ESMTPSA id bg25-20020a05651c0b9900b0027fbd4ee003sm876925ljb.124.2022.12.27.15.03.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Dec 2022 15:03:49 -0800 (PST) From: Linus Walleij Date: Wed, 28 Dec 2022 00:03:34 +0100 Subject: [PATCH 2/7] crypto: stm32/hash: Simplify code MIME-Version: 1.0 Message-Id: <20221227-ux500-stm32-hash-v1-2-b637ac4cda01@linaro.org> References: <20221227-ux500-stm32-hash-v1-0-b637ac4cda01@linaro.org> In-Reply-To: <20221227-ux500-stm32-hash-v1-0-b637ac4cda01@linaro.org> To: Herbert Xu , "David S. Miller" , Rob Herring , Krzysztof Kozlowski , Maxime Coquelin , Alexandre Torgue , Lionel Debieve Cc: linux-crypto@vger.kernel.org, devicetree@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Linus Walleij X-Mailer: b4 0.11.1 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1753410257868998497?= X-GMAIL-MSGID: =?utf-8?q?1753410257868998497?= We are passing (rctx->flags & HASH_FLAGS_FINUP) as indicator for the final request but we already know this to be true since we are in the (final) arm of an if-statement set from the same flag. Just open-code it as true. Signed-off-by: Linus Walleij Acked-by: Lionel Debieve Signed-off-by: Linus Walleij --- drivers/crypto/stm32/stm32-hash.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/crypto/stm32/stm32-hash.c b/drivers/crypto/stm32/stm32-hash.c index d33006d43f76..0473ced7b4ea 100644 --- a/drivers/crypto/stm32/stm32-hash.c +++ b/drivers/crypto/stm32/stm32-hash.c @@ -399,8 +399,7 @@ static int stm32_hash_update_cpu(struct stm32_hash_dev *hdev) if (final) { bufcnt = rctx->bufcnt; rctx->bufcnt = 0; - err = stm32_hash_xmit_cpu(hdev, rctx->buffer, bufcnt, - (rctx->flags & HASH_FLAGS_FINUP)); + err = stm32_hash_xmit_cpu(hdev, rctx->buffer, bufcnt, 1); } return err;