From patchwork Tue Jul 5 20:51:38 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: 12907021 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 0A2BFC43334 for ; Tue, 5 Jul 2022 20:52:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231266AbiGEUwR (ORCPT ); Tue, 5 Jul 2022 16:52:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229939AbiGEUwP (ORCPT ); Tue, 5 Jul 2022 16:52:15 -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 8972C12AB7 for ; Tue, 5 Jul 2022 13:52:13 -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-0000tU-FA; 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-004dB1-7r; Tue, 05 Jul 2022 22:51:54 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1o8pWU-003Drn-0L; 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 1/7] crypto: atmel-aes: Drop if with an always false condition Date: Tue, 5 Jul 2022 22:51:38 +0200 Message-Id: <20220705205144.131702-1-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=949; h=from:subject; bh=bvVGcxJkIlGRVNmIhFGFH6gXMQJmfXDlOVZ0OZksjRM=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBixKRGUTOHzCJtEaCXv0bWPCdHhqgHNqvqFTB5/8OL mxgzy2WJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCYsSkRgAKCRDB/BR4rcrsCXdEB/ 46LKv+vBM92XIvMrZ6u7nsFkYjQuOXn1cMgd+NKXyV3JRf4k3gms1IEOSLDGucKKcq66W46CETUCa3 hZZefQszB4r4V+Ya5fPZEb3C4uenIt+qOsEngR38gA6ffF59FDm1p7VTqqOQJg4IuKFMNBzGVeqrR8 IHshp3++6QjUZ5upY8qHK1z29gZiqVhBtskjMWjPzWMS81z2XQDLgLsbBCGM+mEtrt4r2UoLlu4adq b4pGD28xOQpKzOheH6Ajx5haO53ZdrrqcD3IUarySCgECvkYHu/lNE62KWTcuObJBsZhnCHF1bnSSw j/RxK/c9BPN+uLmlRb9nXUg9iAV1xC 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 aes_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-aes.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) base-commit: f2906aa863381afb0015a9eb7fefad885d4e5a56 diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index f72c6b3e4ad8..886bf258544c 100644 --- a/drivers/crypto/atmel-aes.c +++ b/drivers/crypto/atmel-aes.c @@ -2669,8 +2669,7 @@ static int atmel_aes_remove(struct platform_device *pdev) struct atmel_aes_dev *aes_dd; aes_dd = platform_get_drvdata(pdev); - if (!aes_dd) - return -ENODEV; + spin_lock(&atmel_aes.lock); list_del(&aes_dd->list); spin_unlock(&atmel_aes.lock); From patchwork Tue Jul 5 20:51:39 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: 12907019 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 26146C433EF for ; Tue, 5 Jul 2022 20:52:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230110AbiGEUwH (ORCPT ); Tue, 5 Jul 2022 16:52:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229770AbiGEUwG (ORCPT ); Tue, 5 Jul 2022 16:52:06 -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 39C2DB71 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-0000tW-FB; 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-004dBA-UZ; 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-003Drq-62; 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 2/7] crypto: atmel-sha: Drop if with an always false condition Date: Tue, 5 Jul 2022 22:51:39 +0200 Message-Id: <20220705205144.131702-2-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=892; h=from:subject; bh=d7L4zvTQDHK/JlvhWg+4pn1/ATIKhpfrE0igWZ2Db5E=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBixKRKGs4L1hAyl3D7MbPH2xw18selDU4s5YpSqKO2 QgoIF+yJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCYsSkSgAKCRDB/BR4rcrsCeTaB/ 44S82O/5T9T+5ayajji8qYsbbaZ4CRgvFTaYzmQ/cD6NVfIOXr5Gii5UmZLSYsyjoPezpowZ0+Uodc F/JknWe3ejAFDVY7Gx/svTPltWctyk6xBrs5YdjQYReKtPtI0Dv/nBRpkl19q5frgHYjf9Po9cBZ8Z gxnlOnpKae0zV46MOjWpzVCQy721wrQf49jmCbgMPMYnfuXiLYomuT6N1J3ksQ+Da9g2IrdVfhB8/z pc/3WqhvI8ljK2MKFMcKnfjPt42o3NRcKv3rJCk31Wslw/x+e/0xl13cp30suP+vGh63HrPkl3X3zo U2hM3IeBmABYW4B3M8LtA3JzJ88KgZ 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 sha_dd is never NULL. This is a preparation for making platform remove callbacks return void. Signed-off-by: Uwe Kleine-König Reviewed-by: Claudiu Beznea --- drivers/crypto/atmel-sha.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c index d1628112dacc..e054e0ac6fc2 100644 --- a/drivers/crypto/atmel-sha.c +++ b/drivers/crypto/atmel-sha.c @@ -2669,8 +2669,7 @@ static int atmel_sha_remove(struct platform_device *pdev) struct atmel_sha_dev *sha_dd; sha_dd = platform_get_drvdata(pdev); - if (!sha_dd) - return -ENODEV; + spin_lock(&atmel_sha.lock); list_del(&sha_dd->list); spin_unlock(&atmel_sha.lock); 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: 12907020 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 Reviewed-by: Claudiu Beznea --- 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: 12907016 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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:42 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: 12907017 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 D55DECCA47F for ; Tue, 5 Jul 2022 20:52:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231338AbiGEUwF (ORCPT ); Tue, 5 Jul 2022 16:52:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231171AbiGEUwE (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 B8889B71 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-0000tX-9U; 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-004dBE-15; 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-003Ds0-Ry; 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 5/7] crypto: omap-des: Drop if with an always false condition Date: Tue, 5 Jul 2022 22:51:42 +0200 Message-Id: <20220705205144.131702-5-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=1127; h=from:subject; bh=u4aVGBYfGRP02GXoL8uFlMBsqwWxl0mJkK09zDiop6o=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBixKRUA+Z9AxVLYFqyww+ZcWVAwj7dPChq1tXd7XbE eT3dMTuJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCYsSkVAAKCRDB/BR4rcrsCeAaB/ 9qr1rtiSkqZpXiAiEWX/fop4bTX/+0iDjftq/014dma5I4rQbb2nnGUD59A1fLxXlv109WFZYQVa+2 Bo8JOoqOSOJ6lX8aOUH3og6KRWZggWJguTlwayF6IsUzlEhgX1VLyBt6nm8SytygMTmiyzaLHlgI96 upmirr7z2BNdvlrOfFwlD+L+aV8W1jsQNANG6TGw3zb+NuRVbVRdX9i0kajP19/ewlRAMJRSdPvmiS bbfHFJAPTJGDv04s5Q729qQxic12Z0LychQiz8Ru8i8gQrd6i8lPpDK/dSqUKOOH/jHUx+t9KL8mO8 HXWqo8E9WBPeb3acTKEASfmylmX3KP 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 an assignment without effect. Signed-off-by: Uwe Kleine-König --- drivers/crypto/omap-des.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/crypto/omap-des.c b/drivers/crypto/omap-des.c index 538aff80869f..f783769ea110 100644 --- a/drivers/crypto/omap-des.c +++ b/drivers/crypto/omap-des.c @@ -1091,9 +1091,6 @@ static int omap_des_remove(struct platform_device *pdev) struct omap_des_dev *dd = platform_get_drvdata(pdev); int i, j; - if (!dd) - return -ENODEV; - spin_lock_bh(&list_lock); list_del(&dd->list); spin_unlock_bh(&list_lock); @@ -1106,7 +1103,6 @@ static int omap_des_remove(struct platform_device *pdev) tasklet_kill(&dd->done_task); omap_des_dma_cleanup(dd); pm_runtime_disable(dd->dev); - dd = NULL; return 0; } From patchwork Tue Jul 5 20:51:43 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: 12907015 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 A2BB5C43334 for ; Tue, 5 Jul 2022 20:52:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231495AbiGEUwE (ORCPT ); Tue, 5 Jul 2022 16:52:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229941AbiGEUwD (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 5F4B6320 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-0000tY-HR; 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-004dBH-A7; 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 1o8pWV-003Ds3-3V; Tue, 05 Jul 2022 22:51:55 +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 6/7] crypto: omap-sham: Drop if with an always false condition Date: Tue, 5 Jul 2022 22:51:43 +0200 Message-Id: <20220705205144.131702-6-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=852; h=from:subject; bh=xqL6jh5OAMPzomOFtpqyo5nVq2HQ7FkPRSbtlRdZq5g=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBixKRX8hMfECGIeRcZ1s5PHDeA+gJFpyywkQp4HTWE VWvOrU2JATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCYsSkVwAKCRDB/BR4rcrsCUs/CA CZM0KNFhSXlLPrVt63vtn36E71ONTZbx+MfFZGQvAed01vPVOTEmKWmuDBYCnFQD7lGP4VQJvIl2aU cZvwyGP6ynHUFUzs3basbyViBRhfr8CTCpvsFHwA3M6dxSEFDQdxSMxny8/YqnDK57W0I8o7FJMEv3 j075xBHtFT21pFX0Rv3n0zQzaHEEwA/ZmM2gYcRApFdh/UiO3xp/1MFnKXa36Lq/kwhFo63OHui4Qj eRH7jY4wbRrMD3ZdmkdIOuuKCtkwYBX9Q6l0RG6O8mJ2tPatMityZ8Kqn2LMtxUP1/Duvzd+NEQE27 yvVufw/GdfBqOcKklLrYBw9v1tzvkE 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. Signed-off-by: Uwe Kleine-König --- drivers/crypto/omap-sham.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c index 4b37dc69a50c..655a7f5a406a 100644 --- a/drivers/crypto/omap-sham.c +++ b/drivers/crypto/omap-sham.c @@ -2197,8 +2197,7 @@ static int omap_sham_remove(struct platform_device *pdev) int i, j; dd = platform_get_drvdata(pdev); - if (!dd) - return -ENODEV; + spin_lock_bh(&sham.lock); list_del(&dd->list); spin_unlock_bh(&sham.lock); 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: 12907018 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 Acked-by: Vladimir Zapolskiy Reviewed-by: Krzysztof Kozlowski --- 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]);