From patchwork Tue Jul 5 20:51:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 587578 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 9A8C2C433EF for ; Tue, 5 Jul 2022 20:52:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231624AbiGEUwP (ORCPT ); Tue, 5 Jul 2022 16:52:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231266AbiGEUwH (ORCPT ); Tue, 5 Jul 2022 16:52:07 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4B10C48 for ; Tue, 5 Jul 2022 13:52:06 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o8pWW-0000tV-F5; Tue, 05 Jul 2022 22:51:56 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1o8pWR-004dB6-KV; Tue, 05 Jul 2022 22:51:55 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1o8pWU-003Drt-DI; Tue, 05 Jul 2022 22:51:54 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea Cc: linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 3/7] crypto: atmel-tdes: Drop if with an always false condition Date: Tue, 5 Jul 2022 22:51:40 +0200 Message-Id: <20220705205144.131702-3-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220705205144.131702-1-u.kleine-koenig@pengutronix.de> References: <20220705205144.131702-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=906; h=from:subject; bh=hb+vAIzIxMcYrdRF7gpCmqvcWbWsIAkNG+jTD0UJXVs=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBixKRN5JJGdPjBP8TuRen+HhTmrn9xCuY1S8xLEObq HOLW8/SJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCYsSkTQAKCRDB/BR4rcrsCRBqB/ 9ncIDc0egXxTGDBZHtalYESqaEd4KhLB9dUOivnXe/jE8kEXgXFi5NCZUPYzZtwhb+ojJwltto5Jo0 C70G43+c/jBXo4UMnYIQs2XHFu/aaqsdDgkL+T/4j4qP5itPDd7VQP+EvJYGzQUrmmUQeNZSIdtB0y F1OwI3j1hxCtOO+4VycfLm1PtN7jc0XOWj6+o3wwWMLonOcBepD1wB29DhWZYYajJEKCATh7XUI8f6 C1DjwiG4ji1G7EPxm55+SFYxM3mmGAxFnc8muZhY45xWCPNYTrH85r7ubDziuyqEu1n5Hz3C89sEhY XDn11+bUFC/dRMK29+zWU8av9xkZpw X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The remove callback is only called after probe completed successfully. In this case platform_set_drvdata() was called with a non-NULL argument and so tdes_dd is never NULL. This is a preparation for making platform remove callbacks return void. Signed-off-by: Uwe Kleine-König --- drivers/crypto/atmel-tdes.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/crypto/atmel-tdes.c b/drivers/crypto/atmel-tdes.c index 9fd7b8e439d2..a5e78aa08bf0 100644 --- a/drivers/crypto/atmel-tdes.c +++ b/drivers/crypto/atmel-tdes.c @@ -1266,8 +1266,7 @@ static int atmel_tdes_remove(struct platform_device *pdev) struct atmel_tdes_dev *tdes_dd; tdes_dd = platform_get_drvdata(pdev); - if (!tdes_dd) - return -ENODEV; + spin_lock(&atmel_tdes.lock); list_del(&tdes_dd->list); spin_unlock(&atmel_tdes.lock); From patchwork Tue Jul 5 20:51:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 587580 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 31BF9CCA47B for ; Tue, 5 Jul 2022 20:52:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230053AbiGEUwF (ORCPT ); Tue, 5 Jul 2022 16:52:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231338AbiGEUwE (ORCPT ); Tue, 5 Jul 2022 16:52:04 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEA8FB92 for ; Tue, 5 Jul 2022 13:52:02 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o8pWW-0000tZ-LP; Tue, 05 Jul 2022 22:51:56 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1o8pWS-004dBK-Dy; Tue, 05 Jul 2022 22:51:55 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1o8pWU-003Drw-Jm; Tue, 05 Jul 2022 22:51:54 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 4/7] crypto: omap-aes: Drop if with an always false condition Date: Tue, 5 Jul 2022 22:51:41 +0200 Message-Id: <20220705205144.131702-4-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220705205144.131702-1-u.kleine-koenig@pengutronix.de> References: <20220705205144.131702-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1136; h=from:subject; bh=o2MYApuuvCDNzwceQmqrYdmJkw0O4+AiJdX63pchZAM=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBixKRRVLEduK3vzrAPIaOrN90LYNnohpN3u+rbGxoB 2SmrXSaJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCYsSkUQAKCRDB/BR4rcrsCQv0B/ 9lI4iJG5MxBuvDPlVC9c4c2R8Qpy3glF4OlhNdt1zUUAeJNO5a7W0388CvVUWLp5H3O6vg0BdD/NYy 47YCEQTzN+LRKjIhr4xfpFtfQR0h37VVCiuEEaLPGM6XPMaRlS0vZjNJ3WhEnaa8wLNXa3pf5n25Xu A0KkWufTJxUbAv5YoJ/P0IEfeaJZVX9Nb20n+diujUqlMdj9f4AF+FG8khBlbVOSZ2RMB71WzsAA5r FLRNvscxyjQA/XMCF3z8hIBJAvyt9y6WbqNEQjliNhV6Fr1FYEOOrVjrziKmtoKLRyprZnO06/uofL 7dWQps1LtZqF4ksUvkZR3WNuY/2eee X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The remove callback is only called after probe completed successfully. In this case platform_set_drvdata() was called with a non-NULL argument and so dd is never NULL. This is a preparation for making platform remove callbacks return void. While touching this driver remove a stray empty line. Signed-off-by: Uwe Kleine-König --- drivers/crypto/omap-aes.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c index 581211a92628..67a99c760bc4 100644 --- a/drivers/crypto/omap-aes.c +++ b/drivers/crypto/omap-aes.c @@ -1261,9 +1261,6 @@ static int omap_aes_remove(struct platform_device *pdev) struct aead_alg *aalg; int i, j; - if (!dd) - return -ENODEV; - spin_lock_bh(&list_lock); list_del(&dd->list); spin_unlock_bh(&list_lock); @@ -1279,7 +1276,6 @@ static int omap_aes_remove(struct platform_device *pdev) aalg = &dd->pdata->aead_algs_info->algs_list[i]; crypto_unregister_aead(aalg); dd->pdata->aead_algs_info->registered--; - } crypto_engine_exit(dd->engine); From patchwork Tue Jul 5 20:51:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 587579 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 B8CF2CCA47C for ; Tue, 5 Jul 2022 20:52:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231337AbiGEUwF (ORCPT ); Tue, 5 Jul 2022 16:52:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230053AbiGEUwD (ORCPT ); Tue, 5 Jul 2022 16:52:03 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A22438D for ; Tue, 5 Jul 2022 13:52:02 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o8pWX-0000tc-MM; Tue, 05 Jul 2022 22:51:57 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1o8pWS-004dBN-I2; Tue, 05 Jul 2022 22:51:56 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1o8pWV-003Ds7-9v; Tue, 05 Jul 2022 22:51:55 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Krzysztof Kozlowski , Vladimir Zapolskiy , Herbert Xu , "David S. Miller" Cc: linux-crypto@vger.kernel.org, linux-samsung-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 7/7] crypto: s5p-sss: Drop if with an always false condition Date: Tue, 5 Jul 2022 22:51:44 +0200 Message-Id: <20220705205144.131702-7-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220705205144.131702-1-u.kleine-koenig@pengutronix.de> References: <20220705205144.131702-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=853; h=from:subject; bh=bogHrLWOhtcmBuEz8mG/TmgQiUKVPwTBmiYKM67IJrE=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBixKRao/uc3yXouIxVSkn1OfxwsSKdJUfg3aNxeLh6 rrS1RlOJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCYsSkWgAKCRDB/BR4rcrsCRWhB/ 0W08RBg8aZIfa5KTf034XdzCyDxQb3pqB2m60hY9sY81yVZV7kmvz4+HSgkUwT+QShLOiyD2qXxrAO FTPY5m4pv5fsr/N45hUagVGz7NiwW9QXKKLUvOfJMrGLFK/BMsGkR5wCAl7pvW6L/5cSQ+5BIE16OG nytNang79k98Bu5Z/G9oRQeoGE+BFEQAfb3vxHY47IJWTGnbVbBszMqdga7+qa1Qvc/+BugEjiIIXF EEZMoIxOfO61SZgXLEDvk0REWxXBY/MW191m+32alh8pM2BlFSN/R5dKFzRnefUUPbe72FRYBC25Mv ClSiAqodJd/AXREJ5dhm6V2al6Qq9C X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The remove callback is only called after probe completed successfully. In this case platform_set_drvdata() was called with a non-NULL argument and so pdata is never NULL. This is a preparation for making platform remove callbacks return void. Signed-off-by: Uwe Kleine-König --- drivers/crypto/s5p-sss.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c index 7717e9e5977b..b79e49aa724f 100644 --- a/drivers/crypto/s5p-sss.c +++ b/drivers/crypto/s5p-sss.c @@ -2321,9 +2321,6 @@ static int s5p_aes_remove(struct platform_device *pdev) struct s5p_aes_dev *pdata = platform_get_drvdata(pdev); int i; - if (!pdata) - return -ENODEV; - for (i = 0; i < ARRAY_SIZE(algs); i++) crypto_unregister_skcipher(&algs[i]);