From patchwork Fri Dec 15 13:59:17 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: 179310 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9296413dys; Fri, 15 Dec 2023 06:03:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IF3ypngibjGeEq+0bJKLnbX5/cYfQs5u9dto7z4UchgYdGynsoh4dT1Js6E8kqget+Gp078 X-Received: by 2002:a17:902:ecc7:b0:1d3:6de6:751d with SMTP id a7-20020a170902ecc700b001d36de6751dmr2424105plh.101.1702649009605; Fri, 15 Dec 2023 06:03:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702649009; cv=none; d=google.com; s=arc-20160816; b=d/xZkzB0aTgTr1b/oqHZiPlVUyYnfIHHU5DvGnc9zjHHz8gFhNVHASsDtfDhKuxyrF BmkRaD/q6U8KuUS5c2xY2mlybi/clKm1uXRwc8n3LmJIOei9sJ0IVNQFU39x9nsIz6y2 1lewC2wxQ9+qQR4bH2WDEWps5Sy581L+BRUetOwXvAaE/WnhuOuoNWBUopYUIL2RuQ6h usUi/5B76eSJKx1Yi6d/a+QxT9wSS8de0nnQHWfEJqhM1PzNACiPtUhpuu9CwwnthsX+ my86Jf3zAeOb0suSDj5/Ug0qCakGrWPUh4tO80kMSo7d/BpjAr+Lc6CsnTEJIs05oK2Y vIFg== 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=wHV3ZMsGgESUAjy4YgYodGD9czoJoweuZkNCbHwCF8s=; fh=WBAvDUdZQ65Hx9170m7xg5JkwQLI0WSCirM0+e+PVtk=; b=ysZDapzCWDiozqNIX1TC7s3pRx3YxVhhjANANh33qX69L9uNl4ohclaJD2fwEAoBTb X32GpgbAiJjm6SdyUDsK9qxKT37NiUD+dm2IVxlzGMA8C+apTS8D5O9SH6jlxqV1CDm4 rA5JqHlhE27Gy+2R69y0awYPu0ckGkculbQUTgIT6rd8NYHcLVj0TU55UhWM6ZsrC6Sy 8e7GyjhNTN//bG+VaVNLfNSJCzdd2evCGF3PPYJvR0e3vE8JJjazkkLmbB8hzXhalXo+ JQ1K4JPafQcTPvx2MM2gAvwLXoKpmxiUlzRIbN7u89uyP7ueTxBo9aR5iubnY4ON8k+X XHJg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1062-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1062-ouuuleilei=gmail.com@vger.kernel.org" Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id u10-20020a170902e80a00b001d05814624esi13177269plg.385.2023.12.15.06.03.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 06:03:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1062-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1062-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1062-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 4C2DDB22EE0 for ; Fri, 15 Dec 2023 14:02:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 129D336AE7; Fri, 15 Dec 2023 13:59:42 +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 1E0FA31A6B for ; Fri, 15 Dec 2023 13:59:39 +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 1rE8iz-0002qw-Ub; Fri, 15 Dec 2023 14:59:33 +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 1rE8iz-00G2aI-Gx; Fri, 15 Dec 2023 14:59:33 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8iz-003cD9-6r; Fri, 15 Dec 2023 14:59:33 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Will Deacon , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 17/18] perf: thunderx2: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:17 +0100 Message-ID: <7be677dfa13d3a7eab6eef0d808ba8a9855d14ae.1702648125.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.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=1791; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=kNhz4owPoQxf/kqUCq0mPTfNfI890r9XsLm626uuoYo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFu4yiKFxvFEDp7JBUolIF9D0qBewRZ/dqBFl N4dGfN9J02JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbuAAKCRCPgPtYfRL+ TjaVB/wJVTyeqszuwR2rKLeyZ3db/apOK5yre94HQmLHVYCicO6VGSUcOl3xfZpe+DKWfaYvLCw 61Gc9lVkghr+qS2zMAqbfMp3vsZtTjIQcHVec7gfyFElV6Vtjwa37+KFimzRjZ7x3/OBzjFc9VH Jjv/kmaoskI+QTs+nOI8n2y9K4eA6buyPZtFlVprsNb5FtgZAjlM34qbZ8UuDBtuJhwQe9WQ1a3 Mbt6pPyJ3AC1zFWG4gzrCRAF0XsBSslW7lQXJR4guhyRPUYQFVQqYIlLx37pUu239v1MPzDB+xu hxYC8OSd3h603cGm3l2hnC+rjDDhJCXlXy4qP9Skhb6Vp7HM 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: 1785356887819219022 X-GMAIL-MSGID: 1785356887819219022 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/perf/thunderx2_pmu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/perf/thunderx2_pmu.c b/drivers/perf/thunderx2_pmu.c index 1edb9c03704f..e16d10c763de 100644 --- a/drivers/perf/thunderx2_pmu.c +++ b/drivers/perf/thunderx2_pmu.c @@ -993,7 +993,7 @@ static int tx2_uncore_probe(struct platform_device *pdev) return 0; } -static int tx2_uncore_remove(struct platform_device *pdev) +static void tx2_uncore_remove(struct platform_device *pdev) { struct tx2_uncore_pmu *tx2_pmu, *temp; struct device *dev = &pdev->dev; @@ -1009,7 +1009,6 @@ static int tx2_uncore_remove(struct platform_device *pdev) } } } - return 0; } static struct platform_driver tx2_uncore_driver = { @@ -1019,7 +1018,7 @@ static struct platform_driver tx2_uncore_driver = { .suppress_bind_attrs = true, }, .probe = tx2_uncore_probe, - .remove = tx2_uncore_remove, + .remove_new = tx2_uncore_remove, }; static int __init tx2_uncore_driver_init(void)