From patchwork Tue Dec 26 13:28:02 2023 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: 183315 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp862697dyb; Tue, 26 Dec 2023 05:28:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IHkKOFST4hkKgEt5kQEgjnYcYDG1b5v+I7NgQpmVGck1tDl17M5xoEbOhHcBhkt9B8kZ6rU X-Received: by 2002:a17:903:26c3:b0:1d3:efda:2671 with SMTP id jg3-20020a17090326c300b001d3efda2671mr7686764plb.19.1703597329303; Tue, 26 Dec 2023 05:28:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703597329; cv=none; d=google.com; s=arc-20160816; b=JQ04aEsO/lz7P9BmT8ocYe1XFlCo7G0KMQknYcXwlvHVu4iNBhLzbaocg7P6OsTNLy nsYu7xEeCXgNufEUqGl5pe0R42ICTIU6BoQUiWLcLbGUa5BulsdFl+oYDwDEUICmCWot gFtOdj0bmMmtoO1YHXXuFLEn8YIh+TGD157zz4nCl3xvj1jgCYWfyAdjPzTuePUIi8rE P+NStk0RSwIkJc1SdrcGoKEou/XDGhyg9q148+gqxqQi8rbwWI0lUMQAU6G5JL5oicgP LGojqjF2dh8rbQXOkvEz9aOR6RcuODe0zk+a9DrF2GJlgPmWiage0J9BrCukj5o7UIkQ H7Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=5LKUghNjSLJ2aoOVo5dxNSkHXTNp2mWbZkp52MM6q9Q=; fh=XaTqR/2qXzY/zSYNV/jctYbDgh++p8ja6kzJiUxOQys=; b=LONLF73KhwRLxVnOwlccOcuBhedvyARbz7cZyR/gE+ySKViwOLyDAPFHJqBRQ8PDt4 sYJ5QSWaf8R2Quo5Mm0dAO9Gdz7UzzXV2p6ygto90RNmoeJna2KWSzNlsiPih3GNOtoE GGf3fl4lIZrdREOYOnn+TKB4nL19MHFTekbpWCV+f0hlb8CRbWFJcIPOxtSipLPINWni Zz00W77lBMMuKtjt1sbfxVWBsVLYy6VU/j0TjVFocdIxjqeACFO0IgeNFljHwYt4O8wa aEGLWPuVZWKxsC4Fwo/T5X1nYTWVvQ3qmOhvjyElB+k2sLDwaCOjN2R8ZFqg5KyzvdTu yj3g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-11519-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11519-ouuuleilei=gmail.com@vger.kernel.org" Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id bc7-20020a170902930700b001d09c54485esi9257786plb.568.2023.12.26.05.28.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 05:28:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-11519-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-11519-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11519-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 7B884B21917 for ; Tue, 26 Dec 2023 13:28:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 87C254F1F2; Tue, 26 Dec 2023 13:28:26 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C1C644EB25 for ; Tue, 26 Dec 2023 13:28:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rI7Td-0006yB-Ok; Tue, 26 Dec 2023 14:28:09 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rI7Tb-001ePq-CM; Tue, 26 Dec 2023 14:28:08 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rI7Tc-001FXA-1G; Tue, 26 Dec 2023 14:28:08 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dov Murik , Ard Biesheuvel , Dan Williams Cc: kernel@pengutronix.de, Gerd Hoffmann , linux-kernel@vger.kernel.org Subject: [PATCH 1/2] virt: efi_secret: Convert to platform remove callback returning void Date: Tue, 26 Dec 2023 14:28:02 +0100 Message-ID: <4a97c8e6996c9c95244715310b57ce5af6ccb1ad.1703596577.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1623; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=HZawbBGN4ZeoKoNwMa9p/anf72qdPDLDyflq3XBOU2g=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlitTiF7Q6LPTBILQzLPFujFV4KCr1bTgHzw6NW OwjGqfEtpaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZYrU4gAKCRCPgPtYfRL+ TkBkCACeaJNlG6+8zgivZjAdP0unbo7IwQwQBaiq7ypeRCwzJCDAqGQwyMju5tlx3ArltRsdnqH ZRU1TbnKe14zmg09+lFYV3ix30OhcDomGQvKoVwstNquuHPOkiRZA+8rtGXQzMxtWz8Fz706qqm 8utEqC6IgubmAlTwkETt9DpBgVc+a7dUD1YkS4s8fl04qIJICkNACClyT58nsruiNOdfvQxEpyt 1ANnl1yiWrSVeLMgAcfxISqwosqYib2fhYqG/poy6UmM928lcu5cup2b/rS959RvgmLdMeecgJH S8IJ70jrNPuEXdncItYBFgvHKb+33dZ8/Sgp0t//wPAfZQQm 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786351273029869236 X-GMAIL-MSGID: 1786351273029869236 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 Acked-by: Ard Biesheuvel --- drivers/virt/coco/efi_secret/efi_secret.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/virt/coco/efi_secret/efi_secret.c b/drivers/virt/coco/efi_secret/efi_secret.c index e700a5ef7043..cd29e66b1543 100644 --- a/drivers/virt/coco/efi_secret/efi_secret.c +++ b/drivers/virt/coco/efi_secret/efi_secret.c @@ -326,16 +326,15 @@ static int efi_secret_probe(struct platform_device *dev) return ret; } -static int efi_secret_remove(struct platform_device *dev) +static void efi_secret_remove(struct platform_device *dev) { efi_secret_securityfs_teardown(dev); efi_secret_unmap_area(); - return 0; } static struct platform_driver efi_secret_driver = { .probe = efi_secret_probe, - .remove = efi_secret_remove, + .remove_new = efi_secret_remove, .driver = { .name = "efi_secret", },