From patchwork Tue Jan 2 18:21:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 184415 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp4610631dyb; Tue, 2 Jan 2024 10:22:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IGL/jUYCBN6D/O+i7d9174FPes3dQ2zEtZpkASaTaZh3C8yqbP9AYLYZlSewOagWkcCDXqv X-Received: by 2002:a05:6a20:9189:b0:197:49ff:55be with SMTP id v9-20020a056a20918900b0019749ff55bemr1219266pzd.58.1704219750998; Tue, 02 Jan 2024 10:22:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704219750; cv=none; d=google.com; s=arc-20160816; b=HiOLIe5ZmST7Z8u7OMXUb1mQmy+NQQQj32dAOWAnMGe1ZefRc+zUunzwm9k9rVDYbd 5FOBl72j44HUW0q3LRIVMP5QWYUaeRb5gGgeXErO5OfbFKu8g+aPKoNgLKGJR7UVmCjS cqkT9nu9cTRY3K8Sr29aJgV8KGnOhU1S4SlcP24pUhfTklorCGiDj8nttppF0hVQmryE bDa2hh+bVP40f8I2KvXEqi9qr937VsyRe0RBtCxlyONcd1E3OjT7aNu4+C0vJ+NjYWRr xQhZcPyS5ycVssvb2juqpeLc1ti3OnVpbh1IG2yvuwt1ROFpQdoHWgdAlX9z09Tio1hR bk6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=SK5ZmdPni3oiwsprKqAA8w0COgY7F015Nt8bwwcDuKI=; fh=x2SMb93bETOhj8dElVn+N1Zb3bEFXIJ6FGNhuWPsdyA=; b=VhPARCTaMPr5/9KhuqMxnUw2461lpowkXSzqskidHY51PrW0sNst8yb2+bjYMrzNMR foF8DLxT3i3N65T9FcKOvjdLs0qUmptGbuCeTeGxW5TdhA3377yFtMKd4xob4uVyPXBh EVzQtOjSuhEcWKLr86axMB9qoPMvlwD8GxQw1Wn9HZmkxEKL0VthmGeqWNCcJAR5Y6Qu 8vLJE0x8PaJwh/ZvKibbRoufuVC5N2uW3OUVNU7XI1j627ssTjLUv6jqllmlDJcVyKlJ 0pZG9QkeOseVrGItrUvKNPppRJu2pVGh09CBjNdZXiiT88xH9DclN7VaQo3+lPJIu6Ba I+YQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ZMtYEv1X; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=MxrJq0CO; spf=pass (google.com: domain of linux-kernel+bounces-14706-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14706-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id k206-20020a6284d7000000b006d9bf6f20efsi13651908pfd.170.2024.01.02.10.22.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 10:22:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-14706-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ZMtYEv1X; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=MxrJq0CO; spf=pass (google.com: domain of linux-kernel+bounces-14706-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14706-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id C258F283DDF for ; Tue, 2 Jan 2024 18:22:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7A2C715AE4; Tue, 2 Jan 2024 18:22:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ZMtYEv1X"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="MxrJq0CO" X-Original-To: linux-kernel@vger.kernel.org Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 F2FF115AD8; Tue, 2 Jan 2024 18:22:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Tue, 02 Jan 2024 18:21:52 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1704219713; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SK5ZmdPni3oiwsprKqAA8w0COgY7F015Nt8bwwcDuKI=; b=ZMtYEv1XmaV6l2LbJ88534WVYNKrmqnFdCAsHrHMHMHXh7oMLf1V2KQUX18+MaxlDt+NL7 I90yUfTKmuhl6BGIWMinTvscxBS1LSqkO3ulY8xQg0x6NfEwxg9ek5KXpFHcl9wkqvUGO7 0FTWrlUs3lknr9dOIMapcTH0VBkoNZXbnEM/jqL94uR5faqL4EsEj6RUrxRfaguxgl++vj zMVT2R75gW/tU2lQhnqm54ozYTX3A0dxFSDAhWTkzFvJVNzRbSqg4eLFEK+4hr6xdyjHPM DFXHCGCDqHkYhxfXiksjyxjTBzsEtEHgJsypLB2vYjmdno2vnOlD57+XKovSyA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1704219713; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SK5ZmdPni3oiwsprKqAA8w0COgY7F015Nt8bwwcDuKI=; b=MxrJq0CO375g2Mw6LOtD0lJMj6RnoTPBqKIz2IyOzkSd3DAo6I/08nakRbnGSTqKHwyoRE xeSshJg8Co+MABCg== From: tip-bot2 for Uwe =?utf-8?q?Kleine-K=C3=B6nig?= Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/sev] virt: sev-guest: Convert to platform remove callback returning void Cc: u.kleine-koenig@pengutronix.de, "Borislav Petkov (AMD)" , Tom Lendacky , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: =?utf-8?q?=3C52826a50250304ab0af14c594009f7b901c2cd31=2E1703596?= =?utf-8?q?577=2Egit=2Eu=2Ekleine-koenig=40pengutronix=2Ede=3E?= References: =?utf-8?q?=3C52826a50250304ab0af14c594009f7b901c2cd31=2E17035965?= =?utf-8?q?77=2Egit=2Eu=2Ekleine-koenig=40pengutronix=2Ede=3E?= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170421971260.398.3650838941459484381.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786351276277418216 X-GMAIL-MSGID: 1787003929555752776 The following commit has been merged into the x86/sev branch of tip: Commit-ID: d642ef7111014805f2e21e9cddb0c0a93ae1313d Gitweb: https://git.kernel.org/tip/d642ef7111014805f2e21e9cddb0c0a93ae1313d Author: Uwe Kleine-König AuthorDate: Tue, 26 Dec 2023 14:28:03 +01:00 Committer: Borislav Petkov (AMD) CommitterDate: Tue, 02 Jan 2024 19:07:18 +01:00 virt: sev-guest: Convert to platform remove callback returning void 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 Signed-off-by: Borislav Petkov (AMD) Acked-by: Tom Lendacky Link: https://lore.kernel.org/r/52826a50250304ab0af14c594009f7b901c2cd31.1703596577.git.u.kleine-koenig@pengutronix.de --- drivers/virt/coco/sev-guest/sev-guest.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/virt/coco/sev-guest/sev-guest.c b/drivers/virt/coco/sev-guest/sev-guest.c index bc564ad..87f2418 100644 --- a/drivers/virt/coco/sev-guest/sev-guest.c +++ b/drivers/virt/coco/sev-guest/sev-guest.c @@ -994,7 +994,7 @@ e_unmap: return ret; } -static int __exit sev_guest_remove(struct platform_device *pdev) +static void __exit sev_guest_remove(struct platform_device *pdev) { struct snp_guest_dev *snp_dev = platform_get_drvdata(pdev); @@ -1003,8 +1003,6 @@ static int __exit sev_guest_remove(struct platform_device *pdev) free_shared_pages(snp_dev->request, sizeof(struct snp_guest_msg)); deinit_crypto(snp_dev->crypto); misc_deregister(&snp_dev->misc); - - return 0; } /* @@ -1013,7 +1011,7 @@ static int __exit sev_guest_remove(struct platform_device *pdev) * with the SEV-SNP support, it is named "sev-guest". */ static struct platform_driver sev_guest_driver = { - .remove = __exit_p(sev_guest_remove), + .remove_new = __exit_p(sev_guest_remove), .driver = { .name = "sev-guest", },