From mboxrd@z Thu Jan 1 00:00:00 1970 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 62CFCC0032E for ; Wed, 25 Oct 2023 13:14:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234959AbjJYNOj (ORCPT ); Wed, 25 Oct 2023 09:14:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232789AbjJYNOi (ORCPT ); Wed, 25 Oct 2023 09:14:38 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0F62111 for ; Wed, 25 Oct 2023 06:14:36 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-40842752c6eso44551405e9.1 for ; Wed, 25 Oct 2023 06:14:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698239675; x=1698844475; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=dkwfkDFcx7Qd4lPxQDGJFr4+GYrnmCr3zCpgntOLtp4=; b=dehMfyUVMS0+7cqReY3U0Pr7zW3z1It6TkveSw6DHYhth8ND88nJZQo6la63UuZT5H uPsRWUf50Y3sr5jMbpL0TFw++yfRHfakmRExB1JtXWIfTk/ve3c7luyX1z7a94XwiF18 s8VCTwVpy1MqC468uxeje5cBpybj9jDzvaD61H6vNdy6OP+eTZFuH74/nD9zAKGT1rHz kURAit3K22rtkaoFpeP1Qvlezg1F2pAJ5YOiqC9QOROLvq8Ml8FQEVktH2IaOu7YghcH f10ZxZW5X4gzXrq89MdTedr2No2zfdb9q6K3IUxGfvPPyqx4nv8mTXeguKb8m7y6UF7u +aYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698239675; x=1698844475; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dkwfkDFcx7Qd4lPxQDGJFr4+GYrnmCr3zCpgntOLtp4=; b=sOgiAH3brYY0zBKwNA2n+OCjeu8DIo36bQIxs0IYN540QJzwl/UX5BTNPf6CrPd2YN PredXiL2UM1/B8NaXVl1+E8BdEHLwYl9qJDGQInm3SMCTz/vayOhntTNnZ3/NQPCw/KB 3o1qDrok0zD1YFEBF/dzXH7gt2Lhjqx+oWafvzv4svBpB1JHOsT1WV0sdxbLOJJriZn7 Cn7pxrw1bawqZ3b251xDPcRBUH5eyStvR96AisQ30lrEi868B0NMCYjfXKuuZ/4DV5lw DAIWZV3aPkhn61z0nolQGKAlRHdptOc4nQLGDUdWJkf4wyVji2CB/TgNMSLWxULIe8Vr 3cWw== X-Gm-Message-State: AOJu0YzAcx6v2HIESY1reMEvkNRctEMf2/7VM2fPOQDxXI9ZR1IvW1bp BncCLmrILoe2Bn4Raq0EacjsAYokb/E= X-Google-Smtp-Source: AGHT+IFIiz0Gaa/L3N3mVvS6AZLsa1VCn8csfWCEXKdQ05Lj7wJli+7bRyrc7CgPva0DpaJiaRG8Mw== X-Received: by 2002:a05:600c:4747:b0:405:359a:c950 with SMTP id w7-20020a05600c474700b00405359ac950mr11938669wmo.19.1698239674751; Wed, 25 Oct 2023 06:14:34 -0700 (PDT) Received: from Red ([2a01:cb1d:3d5:a100:4a02:2aff:fe07:1efc]) by smtp.googlemail.com with ESMTPSA id x22-20020a05600c189600b004083a105f27sm19036428wmp.26.2023.10.25.06.14.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 06:14:34 -0700 (PDT) Date: Wed, 25 Oct 2023 15:14:33 +0200 From: Corentin Labbe To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Cc: Herbert Xu , "David S. Miller" , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Rob Herring , Jonathan Corbet , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@pengutronix.de Subject: Re: [PATCH 02/42] crypto: sun8i-ce - Convert to platform remove callback returning void Message-ID: References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> <20231020075521.2121571-46-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231020075521.2121571-46-u.kleine-koenig@pengutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Le Fri, Oct 20, 2023 at 09:55:24AM +0200, Uwe Kleine-König a écrit : > The .remove() callback for a platform driver returns an int which makes > many driver authors wrongly assume it's possible to do error handling by > returning an error code. However the value returned is ignored (apart > from emitting a warning) and this typically results in resource leaks. > > To improve here there is a quest to make the remove callback return > void. In the first step of this quest all drivers are converted to > .remove_new(), which already returns void. Eventually after all drivers > are converted, .remove_new() will be renamed to .remove(). > > Trivially convert this driver from always returning zero in the remove > callback to the void returning variant. > > Signed-off-by: Uwe Kleine-König > --- > drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c > index d4ccd5254280..1741758e03eb 100644 > --- a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c > +++ b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c > @@ -1071,7 +1071,7 @@ static int sun8i_ce_probe(struct platform_device *pdev) > return err; > } > > -static int sun8i_ce_remove(struct platform_device *pdev) > +static void sun8i_ce_remove(struct platform_device *pdev) > { > struct sun8i_ce_dev *ce = platform_get_drvdata(pdev); > > @@ -1088,7 +1088,6 @@ static int sun8i_ce_remove(struct platform_device *pdev) > sun8i_ce_free_chanlist(ce, MAXFLOW - 1); > > sun8i_ce_pm_exit(ce); > - return 0; > } > > static const struct of_device_id sun8i_ce_crypto_of_match_table[] = { > @@ -1110,7 +1109,7 @@ MODULE_DEVICE_TABLE(of, sun8i_ce_crypto_of_match_table); > > static struct platform_driver sun8i_ce_driver = { > .probe = sun8i_ce_probe, > - .remove = sun8i_ce_remove, > + .remove_new = sun8i_ce_remove, > .driver = { > .name = "sun8i-ce", > .pm = &sun8i_ce_pm_ops, > -- > 2.42.0 > Acked-by: Corentin Labbe Thanks From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4A03AC0032E for ; Wed, 25 Oct 2023 13:15:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TZ6CWaebob64SlBKImBf7dVisSV2H7sNODzHAN9GPS4=; b=JivkJRx6ynedCL Fie6uTuMQEdZXTV42sUnlGpWQs4QXSf6cy2S0SmwDT8uEi9KtHLRn2gOBJTgZN/PNkeFbsCv2ZFYH ZK2wcUtYL0zBHoqs6O2q6ynu9HxZlj3I8p2JLYNM8r2DJNCg7+CK4Wim4i/EhaLtZdvgKp3X4axO8 pb9HyJ59XzKsumdZObQF5KMNuY6s9JPqFv9wj/2LotJDUg2/4ROxYihB5sYDCRgucQLJxsvVvfPXd S/bG6LnDxLWoPpfbR5EnvyopzEgayNx9yIfIH9dmO5NnZvhErEtCVXCIT1j9oMq2nQGenvcrhwzFg qjBBsPCrM6GNq5wm/Lgw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qvdic-00CNtE-2D; Wed, 25 Oct 2023 13:14:42 +0000 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qvdib-00CNs2-01 for linux-arm-kernel@lists.infradead.org; Wed, 25 Oct 2023 13:14:42 +0000 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4083cd3917eso44454125e9.3 for ; Wed, 25 Oct 2023 06:14:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698239675; x=1698844475; darn=lists.infradead.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=dkwfkDFcx7Qd4lPxQDGJFr4+GYrnmCr3zCpgntOLtp4=; b=FdUvBAU7sGw+DWPyf10MFkv8FgvkqpV8FSgs79cfSgTyZFRpG3cOx7Pjh0dy7ETMUr ql4ELvdMngDZgn5cLCAgdlnBEhe5G4akNQkeRzPexivwhlhWu0kBsxnPG8hkg9OtDBOV AxsFvkvkvI1C79/IOSwZSBkRcwhjL9Spfgg7S652mGO0QzNJZPkL9eIlhdBLCYqYoflK LRMYv/PXK59gZyyOi8K64vp0Uvt9S9tAw7zzmJuLDZaCasbYcUrObMmjfK8yjIZleS/Z V0M4CkdtLJZk9oNV1W8wwHMf4xew+HlKE8nXLfzZsPLpZPn0rK/TGkNMlEQ0Pk5AcRKL HNOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698239675; x=1698844475; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dkwfkDFcx7Qd4lPxQDGJFr4+GYrnmCr3zCpgntOLtp4=; b=FGwC6++W96g+5gzSAxvAdXuaYhs3CZbZN0Ao3v8lIV0Vz7Y6VkZ//3H3vnB4zMbw/n el6uk8gWlCTsEaOuGG4ek3sOQiT/VVtOGYcqpm4/ucmdeeWeHQg8WnlzbWhujK/4Dl1J LvXsSlU8aVW6RYyb3ajhiiABhszkTZmpBFdRg/LWnbn1Rq0LnJfg90QjJcBBltYcN1Z5 iWhZTuDan+Dqhw2TQCYWdARJB0/RQAkk2v6npq56Tjvb+UOQ7UC7JmpBLXBB/AKVrqKB ehPImzDOrTlkpQGc2/KISj8K6rz4T+wPnyTLBigyknwYQr4o5zanrzeUR0Seg7DaBm3/ FkSQ== X-Gm-Message-State: AOJu0YxcWs5jDofFust/3oyvaYYnrTX3H4WfR/HJeexrIJ8pDKfuruaK lGHwpqB0KXm+tbe85ecO+WA= X-Google-Smtp-Source: AGHT+IFIiz0Gaa/L3N3mVvS6AZLsa1VCn8csfWCEXKdQ05Lj7wJli+7bRyrc7CgPva0DpaJiaRG8Mw== X-Received: by 2002:a05:600c:4747:b0:405:359a:c950 with SMTP id w7-20020a05600c474700b00405359ac950mr11938669wmo.19.1698239674751; Wed, 25 Oct 2023 06:14:34 -0700 (PDT) Received: from Red ([2a01:cb1d:3d5:a100:4a02:2aff:fe07:1efc]) by smtp.googlemail.com with ESMTPSA id x22-20020a05600c189600b004083a105f27sm19036428wmp.26.2023.10.25.06.14.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 06:14:34 -0700 (PDT) Date: Wed, 25 Oct 2023 15:14:33 +0200 From: Corentin Labbe To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Cc: Herbert Xu , "David S. Miller" , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Rob Herring , Jonathan Corbet , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@pengutronix.de Subject: Re: [PATCH 02/42] crypto: sun8i-ce - Convert to platform remove callback returning void Message-ID: References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> <20231020075521.2121571-46-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231020075521.2121571-46-u.kleine-koenig@pengutronix.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231025_061441_043396_07DB162E X-CRM114-Status: GOOD ( 26.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Le Fri, Oct 20, 2023 at 09:55:24AM +0200, Uwe Kleine-K=F6nig a =E9crit : > The .remove() callback for a platform driver returns an int which makes > many driver authors wrongly assume it's possible to do error handling by > returning an error code. However the value returned is ignored (apart > from emitting a warning) and this typically results in resource leaks. > = > To improve here there is a quest to make the remove callback return > void. In the first step of this quest all drivers are converted to > .remove_new(), which already returns void. Eventually after all drivers > are converted, .remove_new() will be renamed to .remove(). > = > Trivially convert this driver from always returning zero in the remove > callback to the void returning variant. > = > Signed-off-by: Uwe Kleine-K=F6nig > --- > drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > = > diff --git a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c b/drivers/= crypto/allwinner/sun8i-ce/sun8i-ce-core.c > index d4ccd5254280..1741758e03eb 100644 > --- a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c > +++ b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c > @@ -1071,7 +1071,7 @@ static int sun8i_ce_probe(struct platform_device *p= dev) > return err; > } > = > -static int sun8i_ce_remove(struct platform_device *pdev) > +static void sun8i_ce_remove(struct platform_device *pdev) > { > struct sun8i_ce_dev *ce =3D platform_get_drvdata(pdev); > = > @@ -1088,7 +1088,6 @@ static int sun8i_ce_remove(struct platform_device *= pdev) > sun8i_ce_free_chanlist(ce, MAXFLOW - 1); > = > sun8i_ce_pm_exit(ce); > - return 0; > } > = > static const struct of_device_id sun8i_ce_crypto_of_match_table[] =3D { > @@ -1110,7 +1109,7 @@ MODULE_DEVICE_TABLE(of, sun8i_ce_crypto_of_match_ta= ble); > = > static struct platform_driver sun8i_ce_driver =3D { > .probe =3D sun8i_ce_probe, > - .remove =3D sun8i_ce_remove, > + .remove_new =3D sun8i_ce_remove, > .driver =3D { > .name =3D "sun8i-ce", > .pm =3D &sun8i_ce_pm_ops, > -- = > 2.42.0 > = Acked-by: Corentin Labbe Thanks _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel