From patchwork Fri Dec 15 13:59:01 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: 179306 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9294961dys; Fri, 15 Dec 2023 06:02:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IHJvg4RblerKfZgwNkSxB1sXWPL/0FWD3CsFInef4ztXOeL4lmV15IHpunYQSpg+xfeZVxh X-Received: by 2002:a05:6a21:3284:b0:18f:fe5a:8bb7 with SMTP id yt4-20020a056a21328400b0018ffe5a8bb7mr15008519pzb.24.1702648925207; Fri, 15 Dec 2023 06:02:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702648925; cv=none; d=google.com; s=arc-20160816; b=OwW+/eevjKXvjcvIuI0GV10CaCS2iv7CyjbPAb+t3UNwvEh/KhFspSUnq/v17lyqq0 jkkOsK3Kk78J/bZLKPJn1DAHhYFmvY1MR06x1vCOFyfD2E2V9Bu2Ca69oGUz1pCVsMp8 T7DHQIg3bcrrGuuQ/SHBcGDQoe1S9COUWoiTMXzmRt7rWOVTmChPBKeGHvi7eKvlSFCT qhGWgkNgRZ9RAyfzZWDcQPhCYkCAy2o3aW56JPMaYyLTiWAEOTBQgTqVcxbh5XEnUrGi 2Y9EYyQUecIf7scDZ0ip24dLggPrTazgA6sSFKtt4dgKTvmAArB3hycP037tRc8+wBYs okAQ== 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=TAZJc/+xwIskJrZvGHIDnJUjZag7wjuy3W0Mr7EqaEc=; fh=yY0p6r9TqiQ7YWvi8qfnuiO1YPt0Ex1ckNvhVavPlhU=; b=0nRdL+yBzE+JCUmUAqwqaIYt8OdScxSfPKDAA5cAFYohNkyTmmXx7bWj/uwrx8WTHq t3sgRIltCjRsx99utBaKrdicU2xZFCjR7YWpQo5W7YycAsc2MJ+IL4JUqYLlJ1d+BJ1V UkP0LghMSt9BR4IeUp6uw6DEuo2+FcWJWN+nkaCM6rVWC4tjAYcRkVyi/cN1WEj5O64p jQ2gkHoTDsJ/R4Nd69V9Q9boa6GRcOXKkub9M0ci9LVv94++p1n9HBHRu6dWqjD01rzi pD0ovghIzBLCYtStT2NxPxAQzu+mZ6eV7GXWUQabIEiECWbzjnxw9TvgTgd7+vhFGiqY y/ww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1059-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1059-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id h10-20020a63e14a000000b005c67bb15866si13222640pgk.52.2023.12.15.06.02.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 06:02:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1059-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; spf=pass (google.com: domain of linux-kernel+bounces-1059-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1059-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 7EFE7285A0B for ; Fri, 15 Dec 2023 14:01:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9DA2B34CD3; Fri, 15 Dec 2023 13:59:40 +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 A7B763066A for ; Fri, 15 Dec 2023 13:59:37 +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 1rE8iu-0002lL-Sz; Fri, 15 Dec 2023 14:59:28 +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 1rE8it-00G2ZG-QJ; Fri, 15 Dec 2023 14:59:27 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8it-003cC2-GP; Fri, 15 Dec 2023 14:59:27 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Will Deacon , Mark Rutland Cc: Shuai Xue , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/18] perf: alibaba_uncore_drw: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:01 +0100 Message-ID: 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=1930; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=9FC259Rv6/1RNxYI95FF5rVsM1/6UsMv70AkNQrVF1Y=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFulZf+lV8nfqy5ovLYczr2QJtaFXTDh+Ik2H irgtecLXjeJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbpQAKCRCPgPtYfRL+ TrhnCACSDh21/DkEFLG9vdQ8DL85RDI9U9NJtmDImJCs1mt5MmHxD7nUcmXvAVxOW7SkVdNhReG MScmbD3s1L3D/usi78y8fSzSfTv4jqbCYRQrcMPStisxaxQjSlq/OwsfE7GBURPUjjT2Z6sffjr eWr+Qy1P5EcqPhiaTqlejucbGrR0qOJhppx1mkE0RpCoa/l9DOzrOZ6qK0jZ37TzjEJJL3TMO4B bkVE35ZkgAYM3iL6ovK3PXvy7NFhp5aFzjDiO0AzgVj5aWiPT/DTjl8NGF4fo2AiOgeUuVud0HO ynbJpiHs8g8kvs17Bxg+eqZj/Lp51b0Fbcr+sBs4YlBfHz7M 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: 1785356799726905592 X-GMAIL-MSGID: 1785356799726905592 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/alibaba_uncore_drw_pmu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/perf/alibaba_uncore_drw_pmu.c b/drivers/perf/alibaba_uncore_drw_pmu.c index 19d459a36be5..a9277dcf90ce 100644 --- a/drivers/perf/alibaba_uncore_drw_pmu.c +++ b/drivers/perf/alibaba_uncore_drw_pmu.c @@ -729,7 +729,7 @@ static int ali_drw_pmu_probe(struct platform_device *pdev) return ret; } -static int ali_drw_pmu_remove(struct platform_device *pdev) +static void ali_drw_pmu_remove(struct platform_device *pdev) { struct ali_drw_pmu *drw_pmu = platform_get_drvdata(pdev); @@ -739,8 +739,6 @@ static int ali_drw_pmu_remove(struct platform_device *pdev) ali_drw_pmu_uninit_irq(drw_pmu); perf_pmu_unregister(&drw_pmu->pmu); - - return 0; } static int ali_drw_pmu_offline_cpu(unsigned int cpu, struct hlist_node *node) @@ -795,7 +793,7 @@ static struct platform_driver ali_drw_pmu_driver = { .acpi_match_table = ali_drw_acpi_match, }, .probe = ali_drw_pmu_probe, - .remove = ali_drw_pmu_remove, + .remove_new = ali_drw_pmu_remove, }; static int __init ali_drw_pmu_init(void) From patchwork Fri Dec 15 13:59: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: 179312 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9297005dys; Fri, 15 Dec 2023 06:04:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IHfNQUPL/xibB0Wq3hCHZBLYexoen7/acBfKRavUN/Xd3+JamuoY4dpI2dwVuu9lZM/4O0U X-Received: by 2002:a17:906:285:b0:a1f:9bb6:d97e with SMTP id 5-20020a170906028500b00a1f9bb6d97emr4300206ejf.152.1702649042187; Fri, 15 Dec 2023 06:04:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702649042; cv=none; d=google.com; s=arc-20160816; b=kiyf0CTrUw8k8Byb6MiTb3F06C2a8ninKLNYEjLQwrt9ofk5LUj4JsR0l+9kIaWf65 /Ngg42cGk8hCAxRriyhaWfFgfRC+MSiIbdj3kSbJJ/2wTKNI10IaJ+mZQEhZBe98ziKC XnKLpc962ADLqZFLJRWl0LBcUjUDHUCtc2ZJ4kyjavn3Z3mKdbXnaVYvxKpoNI913vd7 3aqKLxO7eWlZL8OkvdwCpWimSvbDZWno+QMI2fcxuhptRe7jhZZr4WJk0ZvtGEYtXnyR 42vJJxgIZK+dQsezC3s+qHpkoQMlpBpnjQNPV8Tmcv3YSWREH3fGUQIxLkucd/Dwx48X +a9g== 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=OQWHB0Sr2zKuyBVBCUap5u1Q+o/jgWrHL0dzr8jg+X4=; fh=3HyWXuOVyHwK26gGQeZ3KHU7oX5So+wCEHY23+iD+Bg=; b=iccgKQRERyWF7qzMwb7y7qp8z1h8vRdINSBKfmuVMyhPmsLRCKGxsn2PlrxlDYwOiq vwYb+U3OhrsXO4KCJj0okIKTIGkieRVcxf03MjLb4kyVjA9gj0JmQ9WudJ/QxhXxBFGG 2zaPsvxhbZUq1uBoPYeIhJYE8hibmUrFYrM9SJuH3OUNH3mokgOZicmCbzw+05aP4IJ9 a57UjyxHUSmOHLmz7Afs5/vy2wXhI6eUPRX0fv0kjwu9kATLaFRVpH63Be0667t6E0Ru 9wtW7OVpa+fPTG8UjZtrXQV69FlLbP7EGGMu0gw45v/FkwftNDiVFSg3LmIOB9kcOq+h t0ZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1068-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1068-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id g20-20020a170906349400b00a1f89b2786esi6135326ejb.635.2023.12.15.06.04.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 06:04:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1068-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1068-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1068-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 2A8DE1F24951 for ; Fri, 15 Dec 2023 14:03:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 031233BB3F; Fri, 15 Dec 2023 13:59:45 +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 1C6E036AEC for ; Fri, 15 Dec 2023 13:59:41 +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 1rE8iv-0002lM-3E; Fri, 15 Dec 2023 14:59:29 +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 1rE8iu-00G2ZJ-5O; Fri, 15 Dec 2023 14:59:28 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8it-003cC6-RU; Fri, 15 Dec 2023 14:59:27 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Will Deacon , Mark Rutland Cc: Jiucheng Xu , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 02/18] perf: amlogic: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:02 +0100 Message-ID: <33dbadf246eb323edd9e09ac744111216c167a55.1702648124.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=1758; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=JQzThqbYJP0QqESsItg7VkQxjf7NhjUZgsGroMmrOZc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFunAL8ycJpqtt6tJDjG+TMfdjLtm1rASeztS gl+kihZlRqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbpwAKCRCPgPtYfRL+ TohvCACm7G4Swx+T76FjE6UsHXXIG1J+cbT4v9Z3seGjq6SJJgxd/XZI+9sThyUM0hr75yQ+KpS jE0G6cKisaCLXR79HtR5VSEvyrG7PhR6WMmKdDI+pBmcfP5v3XQ69go7jN9lLOEt4oPYIU5iYbJ XunL0YeN0g0LeGgz9Gkk7FmM4LPwIyF+a2+3kHbrFww67ebezxwk5CWO6LQeMAc2NxnUJCLnW4z yZAIEt5KxjFywnR3E9IwFoq9d0jUKGig/POvSBV9AihktZICVmOoVYdMNZd0ET96RzGJUPBGs1x vrxU0Ykd14+Mfgv6oNbwZaIw96Aj6yDImRvhOCTpJyDXxOv8 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: 1785356922239968724 X-GMAIL-MSGID: 1785356922239968724 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/amlogic/meson_g12_ddr_pmu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/perf/amlogic/meson_g12_ddr_pmu.c b/drivers/perf/amlogic/meson_g12_ddr_pmu.c index 15d52ab3276a..99cc791892bc 100644 --- a/drivers/perf/amlogic/meson_g12_ddr_pmu.c +++ b/drivers/perf/amlogic/meson_g12_ddr_pmu.c @@ -355,11 +355,9 @@ static int g12_ddr_pmu_probe(struct platform_device *pdev) return meson_ddr_pmu_create(pdev); } -static int g12_ddr_pmu_remove(struct platform_device *pdev) +static void g12_ddr_pmu_remove(struct platform_device *pdev) { meson_ddr_pmu_remove(pdev); - - return 0; } static const struct of_device_id meson_ddr_pmu_dt_match[] = { @@ -381,7 +379,7 @@ MODULE_DEVICE_TABLE(of, meson_ddr_pmu_dt_match); static struct platform_driver g12_ddr_pmu_driver = { .probe = g12_ddr_pmu_probe, - .remove = g12_ddr_pmu_remove, + .remove_new = g12_ddr_pmu_remove, .driver = { .name = "meson-g12-ddr-pmu", From patchwork Fri Dec 15 13:59:03 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: 179298 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9292644dys; Fri, 15 Dec 2023 05:59:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IE1it1A9a3liDKrcKA6QOEc6+Lw8GWL4XUDyawdrwixIRHjvywyRGmdHw2HgdU28fcNsmGn X-Received: by 2002:a05:6871:a001:b0:1fb:75b:1323 with SMTP id vp1-20020a056871a00100b001fb075b1323mr13427081oab.117.1702648794576; Fri, 15 Dec 2023 05:59:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702648794; cv=none; d=google.com; s=arc-20160816; b=MoFK6GnGPpbtQQqRjU/96leqmF7wEKuFU+t7IQ8sVZRu6FJxtPNzNrYqqizImBAmeZ 7rYdMR5vHTVdiNd0mKwNwxiEgXxLY+yu/UELlK3Cm2d1qteav8d5qs7fGvhLUmWc+/iy DiN6tzIfHod/jlac2OQqcVFl0FhpCTbeTu9VfGnQWYE0an6G+cHuvfBoqLem36a1ezMq 09A34m786a6dZVYlyOfVM2zFefscSoI7q7HMOkDINNQSAJbBGieENWaXi64MJC7H+NbN hJS6HGtrL1d0sgXMwBbUfBcjREjibPR7j5sraDefb421zXSaptwDjwVnc94pACLFC9tG K4SQ== 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=HGZUf0WPN8f84E2zD9q2qVa+pw8W3oaaUOuP5ckpiVI=; fh=WBAvDUdZQ65Hx9170m7xg5JkwQLI0WSCirM0+e+PVtk=; b=lPzRp4Pz+/6U9qyhfTMDmd64rJuFn32X6fpkYp6AWNsTIdarktQHGgwBuyXZ68HqcQ rr5wvph0qL4Hsy6lUWKGBgJbwGbk078QIbfEdWc7B8dU1vebIgaRi9wHyFlzAZIR2GAK bu3pSjGUpwBReGlVj2s3UDQC2C7BSiDr+04Y6iiIw/ATEM0uom7VP6C6BAnpTmltN6Eh WwTGpghr7V18Dq8vRFY7ynCWPRbT1Z8JDZkBeXq46r14tjBi5Snah7ZxUOKYhoCnToo1 ozFRAVilqkDv9ufhiLoCse4j8dki708KfOHuymARfxWyAk1ayq6wYC89GtT7iVmEDFNJ vvFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1052-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1052-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id r4-20020a6560c4000000b005b90af1943asi12807558pgv.807.2023.12.15.05.59.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 05:59:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1052-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; spf=pass (google.com: domain of linux-kernel+bounces-1052-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1052-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 54F69284501 for ; Fri, 15 Dec 2023 13:59:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0618730336; Fri, 15 Dec 2023 13:59:37 +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 356C52EB0C for ; Fri, 15 Dec 2023 13:59:34 +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 1rE8iu-0002lN-T6; Fri, 15 Dec 2023 14:59:28 +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 1rE8iu-00G2ZM-Fs; Fri, 15 Dec 2023 14:59:28 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8iu-003cCA-6O; Fri, 15 Dec 2023 14:59:28 +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 03/18] perf: arm-cci: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:03 +0100 Message-ID: <70b581d58cfffdccb9fb3ed17bf3220c00f8033f.1702648124.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=1733; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=OV7M65VoRPeJ8qTDzcFPkay5azPTFOLc6r+glQI271o=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFuogdGltz/NA/M9cJo+jkIVbz1EYKIyaZhCh 4ZCdvCuODCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbqAAKCRCPgPtYfRL+ TkIPB/9K2n7gMNOMWl/EmTYhk5IAPdnBM9fF+pHuMPwmfcFW+Wson4Ic7Y2+x7Rm/Ca/gLzRboB wEjcoZpsPJXtKRihv0dBETuhO5mGrDv/GSIv4T2hPihADs+UyBRG/AT64Igh0NiXQaRuq3LRd3L wDC+Pyry+EZcPk1PcwIGhzcXtTuOriyvJs/xeI1Rj56DlCfdHnCwmlyh2Li7HLrF1CfHnzYPQsz 03aFqQpabdqBZFHMoadpgb0BySMFm6ScfKq5b6ZcQQU3pWm6kz5ouETWEu7UuPetw98bdkJ1e1Y H1BK6h6tIus1cC4lYHZw5geWq1nw0Of3UJC4Bg2uXeaQ0T7m 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: 1785356662237299359 X-GMAIL-MSGID: 1785356662237299359 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/arm-cci.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/perf/arm-cci.c b/drivers/perf/arm-cci.c index 61de861eaf91..6be03f81ae5d 100644 --- a/drivers/perf/arm-cci.c +++ b/drivers/perf/arm-cci.c @@ -1697,16 +1697,14 @@ static int cci_pmu_probe(struct platform_device *pdev) return ret; } -static int cci_pmu_remove(struct platform_device *pdev) +static void cci_pmu_remove(struct platform_device *pdev) { if (!g_cci_pmu) - return 0; + return; cpuhp_remove_state(CPUHP_AP_PERF_ARM_CCI_ONLINE); perf_pmu_unregister(&g_cci_pmu->pmu); g_cci_pmu = NULL; - - return 0; } static struct platform_driver cci_pmu_driver = { @@ -1716,7 +1714,7 @@ static struct platform_driver cci_pmu_driver = { .suppress_bind_attrs = true, }, .probe = cci_pmu_probe, - .remove = cci_pmu_remove, + .remove_new = cci_pmu_remove, }; module_platform_driver(cci_pmu_driver); From patchwork Fri Dec 15 13:59:04 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: 179300 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9293872dys; Fri, 15 Dec 2023 06:01:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IEJj+wsYxlqoooEWOfbCLkjqFbNzvcT9eFShywAY6ND3fw6olNBebpPxWmB9HwphxUGdTHl X-Received: by 2002:a92:ca0c:0:b0:35d:a6af:5fc7 with SMTP id j12-20020a92ca0c000000b0035da6af5fc7mr17094373ils.53.1702648867072; Fri, 15 Dec 2023 06:01:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702648867; cv=none; d=google.com; s=arc-20160816; b=XTk96IuELqnYxyvALNa1mvt/JSwSEQyvSEHK1HFmEOJuByGfmvP8Er7vF/NSIFGj9f xo9SpqUA4lsaBKu7EbdyRJiy911qc1PjWIQbULlt9rFiNKFlOiOKh6dB69ao5INUDRrf C5vCMOsL66Paug1GHwYCscjRXJNZuKceZ5H2GekzV1VTvB9TaPOzCO0CDaQQKCFsXCQf metVEouu4kstEw+dBA/sAFxB7krwrrMhEWeG1iHZWEyx853YXkiixDJaRVeysd+MuV7j 1XxwxnU13/peHrlR80uwvfoAQnrZ6FkiHwxWHCIF23Jq68JdTac5Xmif4dmzTJDZ5V/0 0jhw== 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=35UFbV62xXBt1N7YIrfCNVK4I0XHYAWnOJOAO555uME=; fh=WBAvDUdZQ65Hx9170m7xg5JkwQLI0WSCirM0+e+PVtk=; b=zyGHT1QJU68+XWPf84XYOFFFLuMwDgMNmQTnRPCjuir5w8A/0oka9xuDNtqBlczldX wkNdzN1yLoBheCJwVOB/JJ5gXMtp+Kmkmq5Z56ofkm5mXW60ttDSFIV5u9hLQY1sZruP o35QyusjdjEvX0RohrW7sZufmrgCa8HmhjB/A0BH9ZYQsQ4+OG0wZARJMLDC3NJjpXOo 08SlG1Xecqil/osc/jLXQfGbxWrHKeiWncuqfwwl4iykHpFb/ve9+xNwHBOkTB/rhYrR aa/Rxe0qVzVEc/EAxRbWSoko2S1SrMYzpMDsluGZTaHpuKSx4NJNDRM9VAWV6uUOCldh 3RIQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1053-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1053-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id r23-20020ab06617000000b007cb59c698cdsi1089993uam.31.2023.12.15.06.01.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 06:01:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1053-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1053-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1053-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 856011C239DD for ; Fri, 15 Dec 2023 14:00:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5BC7730FB9; Fri, 15 Dec 2023 13:59:38 +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 356842EAF9 for ; Fri, 15 Dec 2023 13:59:34 +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 1rE8iv-0002lY-9F; Fri, 15 Dec 2023 14:59:29 +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 1rE8iu-00G2ZP-Sd; Fri, 15 Dec 2023 14:59:28 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8iu-003cCE-IY; Fri, 15 Dec 2023 14:59:28 +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 04/18] perf: arm-ccn: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:04 +0100 Message-ID: <1cae5f0c4693333c91d28a09388bdb8bfcc25d0b.1702648124.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=1666; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=IwQvPM4pMNjqoaU/SqDrjyHMmEbaSTKuNL+vegcPc2I=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFupYABrQduygxr1ltHykST+B0mPQoklrnDBG bTOaFpan+WJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbqQAKCRCPgPtYfRL+ TuAUB/4/LXliwKSYyXg5BPZr0LBpWT4xzVXi+BVU4gpFMmKpRO1EoCFaXXUB2WJJRvgKrbSDZdF hdaS7h90V4etgGoogeb6a8dOsYtsc0oPGBgsZqyzSYNGvBFFtPcLHRyR9q4buCue+hpq0IqSWRy HTbzLk3XFFyW/EHNi1t6vg2MDqGADWSPePyAEQipWYEuf5gvg9LqYhaOLQssfBOwaEsCcRfhNKj fm2mjdnAeVefrZwEdFgRXok7PFXfVPSm9GXtp43qNpN+6D06GUfJswdfF6VZtt+jrfqL/P/BZ7t pWvs7o77DmyiXM7RgeZ22feiP48fJTidYe8IZC1xarRlole1 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: 1785356738213901372 X-GMAIL-MSGID: 1785356738213901372 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/arm-ccn.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/perf/arm-ccn.c b/drivers/perf/arm-ccn.c index 728d13d8e98a..641471bd5eff 100644 --- a/drivers/perf/arm-ccn.c +++ b/drivers/perf/arm-ccn.c @@ -1515,13 +1515,11 @@ static int arm_ccn_probe(struct platform_device *pdev) return arm_ccn_pmu_init(ccn); } -static int arm_ccn_remove(struct platform_device *pdev) +static void arm_ccn_remove(struct platform_device *pdev) { struct arm_ccn *ccn = platform_get_drvdata(pdev); arm_ccn_pmu_cleanup(ccn); - - return 0; } static const struct of_device_id arm_ccn_match[] = { @@ -1539,7 +1537,7 @@ static struct platform_driver arm_ccn_driver = { .suppress_bind_attrs = true, }, .probe = arm_ccn_probe, - .remove = arm_ccn_remove, + .remove_new = arm_ccn_remove, }; static int __init arm_ccn_init(void) From patchwork Fri Dec 15 13:59:05 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: 179299 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9293435dys; Fri, 15 Dec 2023 06:00:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IFwlu7skTBXGRyyx4goaKI6DyLe0pf+/dJnRgI1dyDhE2yMJP56OY6Pg0eQE2CADD3LBKzp X-Received: by 2002:a05:6358:5916:b0:170:cec9:33d8 with SMTP id g22-20020a056358591600b00170cec933d8mr10810973rwf.46.1702648844786; Fri, 15 Dec 2023 06:00:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702648844; cv=none; d=google.com; s=arc-20160816; b=zqjCWd4HikPZKm7t8pyhrrX6LaUHYX9+C/2IePLUAD0aY9lPJo1b0WChKxNuGmbuPg TLzlqQyccJvYRtHjXiLh2A6YrMNnB0BN1yptZhnmNho35lOp4NWD757ZtR8ImQymoXdY krgDyYhSiW/cGkw6wHKFmeHQvZdamuELYEAlSttVC7eHa70P26Dv9AZS8eOr8kKkldDZ LwvzE/7kSszB8gcvySrctz2Z6jrij92M6DQPRGO1rIeJlyYENnBDzxC6moEu1bLUx1Pu 5Lk9Rp7J1BjGQZhVO9Y81JJiIp5iIk2EsxCy7Ph5ZsYVjAQRGjUH2TrGS8pmiOTdPUtX d+oA== 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=n2E0AaeoKsb3Y3C7p9CXuSeEYtQYLK28JX+Zp4Ax5wc=; fh=WBAvDUdZQ65Hx9170m7xg5JkwQLI0WSCirM0+e+PVtk=; b=Wn0vzuGXXQpUyXTC09OH6OIeXBYrYM8CYNxi3rDF1A+UITAMTU4mo0QaqKXuNJ7vCQ R63MzbgGGDZ8Yb28pG1KBDvQtoZFRjbBCDT/JeeR//8xYEbOaKhSxSZ/8RUv3bLtX2v4 YimnmBTDwrf/aXF52NR5ShM8bi+DGPYuZs+BF/JbIxxkpUjQ/rbsicbMVqXk6cc+GuKs ZmclZbWBZSe/OucQI4xYwTy8qB/zHX+LxYQNDKfZFFj6PZEkgSeyuNT4VijKKFEnM9v7 vvOpc+tSAqw22i6iiQ0fvsWwy206cZNVLDjSIc6deDN79iBKm/PnY4nrTzlPJO6l8Eo2 RvrQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1054-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1054-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id h10-20020a63e14a000000b005c67bb15866si13222640pgk.52.2023.12.15.06.00.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 06:00:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1054-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; spf=pass (google.com: domain of linux-kernel+bounces-1054-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1054-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id B6B292845C4 for ; Fri, 15 Dec 2023 14:00:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6CF7030FBF; Fri, 15 Dec 2023 13:59:38 +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 7D1CD2D7AA for ; Fri, 15 Dec 2023 13:59:35 +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 1rE8iv-0002lj-IB; Fri, 15 Dec 2023 14:59:29 +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 1rE8iv-00G2ZU-5G; Fri, 15 Dec 2023 14:59:29 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8iu-003cCI-SF; Fri, 15 Dec 2023 14:59:28 +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 05/18] perf: arm-cmn: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:05 +0100 Message-ID: <8698ca612e17292f8a8bbb2d1c0f6be4b2053da7.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=1819; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=rdvhYagiU3f/ZvfHEseZfXcXHLBGbSqUlVpPbtXCZfM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFuqSs0T4Sqze1XzrLbcw0LPpYHBxuClmaojU 0kwcLgxM8KJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbqgAKCRCPgPtYfRL+ TmbECACHZbdkhVZnAkBCNBCLANRJrzUadl+dzu25xhZvyB9/uIWNlXBvRnMj5MQG6TjIjSfxmlJ NnqOOaQQjmkzP/LxNGZpA1EBnV5kXk1YowHg8Yp7Kc2D7IyLvIC1CFkGbevgAf/WDbGDh0i0Gg5 j1CIFSo18JIT4KPN11gtwdXaFGrCM9mEIfbqwpGjo3lehyBSooAgYY6xdBSg8JYn8Y5lCaENi/d Gqc90zCWQ6kPHCn0BXILApkXFRXxt+Hl07qJa2So8NP23XUPP0K5oSewtpSGZkwol+pA8CRScXl sKgo4wvu1y2zEKt+al71hbBzKAqMaMT4Sq3J4JqN+D8yNBLS 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: 1785356714755152518 X-GMAIL-MSGID: 1785356714755152518 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/arm-cmn.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c index c584165b13ba..ac7a953fe902 100644 --- a/drivers/perf/arm-cmn.c +++ b/drivers/perf/arm-cmn.c @@ -2504,7 +2504,7 @@ static int arm_cmn_probe(struct platform_device *pdev) return err; } -static int arm_cmn_remove(struct platform_device *pdev) +static void arm_cmn_remove(struct platform_device *pdev) { struct arm_cmn *cmn = platform_get_drvdata(pdev); @@ -2513,7 +2513,6 @@ static int arm_cmn_remove(struct platform_device *pdev) perf_pmu_unregister(&cmn->pmu); cpuhp_state_remove_instance_nocalls(arm_cmn_hp_state, &cmn->cpuhp_node); debugfs_remove(cmn->debug); - return 0; } #ifdef CONFIG_OF @@ -2544,7 +2543,7 @@ static struct platform_driver arm_cmn_driver = { .acpi_match_table = ACPI_PTR(arm_cmn_acpi_match), }, .probe = arm_cmn_probe, - .remove = arm_cmn_remove, + .remove_new = arm_cmn_remove, }; static int __init arm_cmn_init(void) From patchwork Fri Dec 15 13:59:06 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: 179313 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9297265dys; Fri, 15 Dec 2023 06:04:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IGzwQUSM0011Rt5nEiJISKiI3JetitnDipJcrUiTLH4ZrZUZPpVTu1ChtWYfuIhJFj37/Q5 X-Received: by 2002:a05:6a00:390c:b0:6d0:d864:e357 with SMTP id fh12-20020a056a00390c00b006d0d864e357mr2594755pfb.40.1702649055975; Fri, 15 Dec 2023 06:04:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702649055; cv=none; d=google.com; s=arc-20160816; b=DgxonF1VN+MyZ1IA1+GkumhePCEx5OdTjgaxPZiP2Zoml4LWaK9R3ulCnQlohKab7Z yFiGNZsIM+99DIuI3xt+bdGJ7b318ypEozzwOdBmYMK7gWkJng/FqtOicGLagJeXtgN7 9te/k7FlzbwFL1JfiseFolrFDAe5TjgmIE2nEemNk+sVEdeN0jt5KdjIxjyV6Wv4gfCH r//Gzk8LDw8wNc12Ozm6bE+5Uea0RFF631SlLf0fhkpDQOAynCGLwhcsx0SDLyJPJ1iN qQsdWVdL4pE4E+sPSyXdKWQW/4JT5wlj0kMUcJ3S2TK7PqvyA2875ENSYKIE/O0CB1hO Y+pw== 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=20Vi/XB4GFKjOYIMOxBOkOs+8kfHID7Uy/Q+K60MH9g=; fh=kV/WDZstGnpNGETldQN5Z0wXDX1YPMFGuFk2o6XhPiM=; b=g/vniK88luP3yiYKVfHj1ahjgnnuqflx8x1RrOVkCvPKFM09AGbOihU8vKGznDEKPi kY5W68eSIfWUCU2gxas96nRbIzt3UMOW8Bht+VaZWdHJaUVNXCn+RnDThCAZntRjWQ/4 +BJGt7RNTGv7IQAlh/FPzHtxEmbElHR4dLo0kzinYLSkmsSXPybIHWRT9+77cSIZtBQJ 4g1ggKPrGvW8vN1iYFLZrQeuVLDiEPjEDjbUShzVoy1G89/VJeooHgjC4GJDPUdeyPJK hXQZUkeLPXsjggop3QC6XchgfqGpnkzQizdQxXZgOdATP+Io7cF3xT9kau/P4QMn7sy1 PumA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1065-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1065-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 a15-20020a056a000c8f00b006cbd28f1f43si13479016pfv.47.2023.12.15.06.04.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 06:04:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1065-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-1065-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1065-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 CD52CB23685 for ; Fri, 15 Dec 2023 14:03:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 97E7239FD4; Fri, 15 Dec 2023 13:59:43 +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 B10BF34CEF for ; Fri, 15 Dec 2023 13:59:40 +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 1rE8iw-0002lt-07; Fri, 15 Dec 2023 14:59:30 +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 1rE8iv-00G2ZZ-GT; Fri, 15 Dec 2023 14:59:29 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8iv-003cCM-6y; Fri, 15 Dec 2023 14:59:29 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Will Deacon , Mark Rutland Cc: Ilkka Koskinen , Suzuki K Poulose , Besar Wicaksono , Robin Murphy , Raag Jadav , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 06/18] perf: arm_cspmu: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:06 +0100 Message-ID: <9ff5a467569dd51b2fc44e11594ad5db7ea15f57.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=1848; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=iD85+6TB8xZ09uwwdBXf03XK6NMXrN2+ozmtzMTXttY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFur3mWCsTZ86/mocSQ45ul+pTIzr/UQuUm4F y0mpEKykPeJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbqwAKCRCPgPtYfRL+ Tq6oCACP7hKGGnlzlmcvQgf4nkNUaeLKlAPgMCQdyZ0osuj2C2NgpL1+vFuAF49i+xnFDzSWHx5 cFIdv+uqL1DQYFS7IQtjXivdUirncexZl8ICb771sPGL04cEHuD64Wu9Rz+bvVMGvQubWywHjE7 C9OxuDIJTeRKBJAFuQU1tVOIZwGhkKqlsI8pDPaXkhuTxQ/I2l4hsYw0ylM4v2ZvSc+aKAxHocl aPeWW8BWq4toRCOGsN3lrJFEOKy4Li4C1BZIt/hqmjN/NPc3c3ldakJjkp908CbIiHeL4lBIHEF a0PIaknWlp/z9xDdH9nCXSHGXfh9Mlof++TiXd6u7WC28sR+ 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: 1785356936385517617 X-GMAIL-MSGID: 1785356936385517617 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/arm_cspmu/arm_cspmu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/perf/arm_cspmu/arm_cspmu.c b/drivers/perf/arm_cspmu/arm_cspmu.c index 50b89b989ce7..3513bf50fefa 100644 --- a/drivers/perf/arm_cspmu/arm_cspmu.c +++ b/drivers/perf/arm_cspmu/arm_cspmu.c @@ -1252,14 +1252,12 @@ static int arm_cspmu_device_probe(struct platform_device *pdev) return ret; } -static int arm_cspmu_device_remove(struct platform_device *pdev) +static void arm_cspmu_device_remove(struct platform_device *pdev) { struct arm_cspmu *cspmu = platform_get_drvdata(pdev); perf_pmu_unregister(&cspmu->pmu); cpuhp_state_remove_instance(arm_cspmu_cpuhp_state, &cspmu->cpuhp_node); - - return 0; } static const struct platform_device_id arm_cspmu_id[] = { @@ -1274,7 +1272,7 @@ static struct platform_driver arm_cspmu_driver = { .suppress_bind_attrs = true, }, .probe = arm_cspmu_device_probe, - .remove = arm_cspmu_device_remove, + .remove_new = arm_cspmu_device_remove, .id_table = arm_cspmu_id, }; From patchwork Fri Dec 15 13:59:07 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: 179301 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9294055dys; Fri, 15 Dec 2023 06:01:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IHaOMl+xEAauuY8k2eCvBJH7+HWVUQVa+OznBEDlcDoU+wJMbepV9BDqAU37wOMw1S0tSUE X-Received: by 2002:a05:6102:188c:b0:464:498f:3b6 with SMTP id ji12-20020a056102188c00b00464498f03b6mr7658845vsb.22.1702648876074; Fri, 15 Dec 2023 06:01:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702648876; cv=none; d=google.com; s=arc-20160816; b=qmeBK4UL467DcSLhpmw4j3k+A0fOndR6tHGiwrIrHl0eiRDpREAahzDQqjZW2RtyBz CjuRBg7z8U4p5Fv6augV3B/hdt8QUrSwgHcrhvYA1RutFARZIggEwwSnaMbrTZyuwkow SRiEjvFzLYjt1drhjWLryYxHtTu6clPmGi8H6CSU+akm6Sp7X9WGqDblFRHUvh0DvVNw 6/2Df9Fh7y74XtbuuvBzD+bux8/ysCpJAD5MRm73uf2HJJY9Ua0yUkGuzItVO8F9/F+2 McVEuTZvdueMR01CstTxnGRRUH4xylnX9hbWxc7c04OK4oaEeYG23yDU++uoZQ/nzN03 1q5w== 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=UtPcO4rB1d+EUK0fwQIVcaUFofnX4uYOTPDh/onOCwU=; fh=WBAvDUdZQ65Hx9170m7xg5JkwQLI0WSCirM0+e+PVtk=; b=hDNJ7Sj5KFP3cca/ZYzQpx5eRnczP2SOyoIzNlxd+KnaMJeL0g8EGuDP7KbwmRYmcJ XklCBtiyOuVt7smEH3RCNg4seN+uj7fWIJlyJan0e5fNjTw8AMkLxNTIEcUv+YZ/DzYC hLIgJwiI+rPWqYacf1NNX97rxwbgsu381DqRmi1dKr7eBcSGZc59Gl/FVLbs1qEiRCb2 x139vV+C++hgUn8ZL4v/VNc1Xn1WC1AcC9lEFfpR9eCxGoEfC19GuhwOD1UqXMJdhd4P zp3reKclTGaN4gV/tqdh7F3Kwvz/Wf8HpDMJTlZF1Dcco0GybSSWoS761BmntPU98Cvy 7ziw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1055-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1055-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id r4-20020a67ea44000000b004666a51c4basi461802vso.116.2023.12.15.06.01.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 06:01:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1055-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1055-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1055-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id E184A1C23D5E for ; Fri, 15 Dec 2023 14:00:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A6B37315BB; Fri, 15 Dec 2023 13:59:38 +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 AC4502EAE6 for ; Fri, 15 Dec 2023 13:59:35 +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 1rE8iw-0002lz-8X; Fri, 15 Dec 2023 14:59:30 +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 1rE8iv-00G2Zd-RV; Fri, 15 Dec 2023 14:59:29 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8iv-003cCQ-Hw; Fri, 15 Dec 2023 14:59:29 +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 07/18] perf: arm_dmc620: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:07 +0100 Message-ID: <20cc24ede88f5e000991dfe6f4cf1222b819e337.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=1931; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=lrV81L2OU/dvTSZ+m0J3yiXdNzi3SVAwtIWN5qo5KWw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFutwo9RDJJfKqAgN3OJB85XfTtj7FOxqzbbo dBmPHTBK9+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbrQAKCRCPgPtYfRL+ Tq9aB/98q4eICU9u2Q8WbuK24DRNwAR7/EYcGfG1LYDS2Wn1ZDjBkadAlR6sAmTwHAmBsbpEoWx ikFeZHGtwu8wy8va+x8OsWplfaYy87dON9XMRWhsTMswN3jbRRFmUwTuwkmnNn9s8PL8Be1t1gm 6YzUoYZpe3a4G3xPzqxJvFrUoSfYYTjoA1tsRR4rg0NOf8BrrJBHuPqCUtk/bqbHICiPYx6ZZQK GAoZ9sz+qxK25T+Jh5dDid9YjmJwCTPsMY9zP9skHdLaW2vo/uDCBKfpNLOmisknHzw24/DjZe2 VOqpLt1C8WXi53xpHtr7UDEH8dvUZk+J88g+f+lCVxNbJ2eA 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: 1785356747868124832 X-GMAIL-MSGID: 1785356747868124832 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/arm_dmc620_pmu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/perf/arm_dmc620_pmu.c b/drivers/perf/arm_dmc620_pmu.c index 30cea6859574..8a81be2dd5ec 100644 --- a/drivers/perf/arm_dmc620_pmu.c +++ b/drivers/perf/arm_dmc620_pmu.c @@ -724,7 +724,7 @@ static int dmc620_pmu_device_probe(struct platform_device *pdev) return ret; } -static int dmc620_pmu_device_remove(struct platform_device *pdev) +static void dmc620_pmu_device_remove(struct platform_device *pdev) { struct dmc620_pmu *dmc620_pmu = platform_get_drvdata(pdev); @@ -732,8 +732,6 @@ static int dmc620_pmu_device_remove(struct platform_device *pdev) /* perf will synchronise RCU before devres can free dmc620_pmu */ perf_pmu_unregister(&dmc620_pmu->pmu); - - return 0; } static const struct acpi_device_id dmc620_acpi_match[] = { @@ -748,7 +746,7 @@ static struct platform_driver dmc620_pmu_driver = { .suppress_bind_attrs = true, }, .probe = dmc620_pmu_device_probe, - .remove = dmc620_pmu_device_remove, + .remove_new = dmc620_pmu_device_remove, }; static int __init dmc620_pmu_init(void) From patchwork Fri Dec 15 13:59:08 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: 179304 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9294726dys; Fri, 15 Dec 2023 06:01:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IG1lWRbDDrFq+pr5lUg9f69oIKZ2xRBtqLiA2i4t+maCrquMFDgBvp2OOczCA+lk+l1KtLf X-Received: by 2002:a17:906:4581:b0:a1f:74e7:8bdd with SMTP id qs1-20020a170906458100b00a1f74e78bddmr11505847ejc.25.1702648911899; Fri, 15 Dec 2023 06:01:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702648911; cv=none; d=google.com; s=arc-20160816; b=K8AxhVOGL8TW9+Sfm9Cy5+D3MnQl5y4wamwA3j3qYJopv8uySHlerYlyHHqHUX/nWb kvyOLffwfmp8hUsyo6GgwEkdw2KFi3a5fAqGYhxW9bKJ6RUvOaoVwkvTOoMtJrVTjsl7 osxsCclnW2Af1l4MozX/HSQzFSu/G/WQbHcAKba51aGpY9bsRJqfSzENhMloIAXi4thv RozyHRQ14oRcaCGoeZHD7J4DtvJ/hXH1p0VKIq1Ui9+7FP8hyGn3QPR9wCcvADnnHdNx EyMjZnb6XCdLPmQsLkTCecsyQlNDzxCaxmOPuPdp47m5QEe+HEsGJl7efIoJWN8qBALi XC+Q== 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=PsvZg5o0D2a87Q8yNS5GB2KoTU+wkGkqUTyDkF5u9FM=; fh=WBAvDUdZQ65Hx9170m7xg5JkwQLI0WSCirM0+e+PVtk=; b=gebuzxn38teQXRFKPTmdw31268mvRgkhII9pQ/f9ZUEiAw4643XgZuixhR9biJtdTU 4rMhI2lt8Dq7q34gpWa8cKDL6FXppgGp6L3z/ZN6s0mNnDmusABNUbYmEGap9PO5Cg5E RLbpI4shf+1h0s8YejomuP8BoN5am2659+gkdFegY6E4TM1B/2TBFOgt+sFApJFr7ALy Ej8hlM73AqQivQjj6aGStYmUbHKD0tQY1KMC6lnKafOLenfjXk33dl+5LG9DWbDytopF WLtcc80i3PFefdooBOncXxrMSNkrGR8fkFKDUpvtgymYFwChMHHZoA/uidxBNztSJF6y jivQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1056-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1056-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id y9-20020a50e609000000b0054c72455321si7610449edm.648.2023.12.15.06.01.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 06:01:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1056-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1056-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1056-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 3767B1F2336D for ; Fri, 15 Dec 2023 14:01:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E9B0131755; Fri, 15 Dec 2023 13:59:38 +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 DA9F32EB13 for ; Fri, 15 Dec 2023 13:59:35 +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 1rE8iw-0002m9-KH; Fri, 15 Dec 2023 14:59:30 +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 1rE8iw-00G2Zh-6a; Fri, 15 Dec 2023 14:59:30 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8iv-003cCU-T8; Fri, 15 Dec 2023 14:59:29 +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 08/18] perf: arm_dsu: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:08 +0100 Message-ID: <1eda5e216afcb0e26a50e9be112d4514ffd0844a.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=1833; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=gKSz5agc738Ao0P2osYXM1UoZoFjy/rLUQ5L4iZFmyI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFuu4w/8xSjfL5Jy4Q+gBWkJl5quzF8u2c9EF ZSuJkFazxuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbrgAKCRCPgPtYfRL+ TnOwCACE2E0Wcd9duOUJS8zMVcNOKoztafxCDtZwFHXmU9Uad7QEAI0yl4pvEb5PKqJKWNqFfRO B3u9lOiEFQy6jStJIZMkq0RR5R0h4wwib+AX5JzwbARfq8QHxivZkuE8A/kcq5YaXJ50hkCSejm LWFWQEEFRBvD6lF52g6PwP7sEp9r5tBXGuNVh8tyzHqpUavxP9H1OesP84ffBqqhT++Y7VGllmu 5q19d8J7n3Zj1WZuDQWpwBP2m0dL7lc0c7eBSQY+1JX56nCLCCdUF+KwT+OidYq50NOcykRSCRR BlAt53FRc+G0RUFizKpv0L30X/+WSHiL0tpEFmZNWJSs0Q0v 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: 1785356785491917833 X-GMAIL-MSGID: 1785356785491917833 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/arm_dsu_pmu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/perf/arm_dsu_pmu.c b/drivers/perf/arm_dsu_pmu.c index 7ec4498e312f..bae3ca37f846 100644 --- a/drivers/perf/arm_dsu_pmu.c +++ b/drivers/perf/arm_dsu_pmu.c @@ -774,14 +774,12 @@ static int dsu_pmu_device_probe(struct platform_device *pdev) return rc; } -static int dsu_pmu_device_remove(struct platform_device *pdev) +static void dsu_pmu_device_remove(struct platform_device *pdev) { struct dsu_pmu *dsu_pmu = platform_get_drvdata(pdev); perf_pmu_unregister(&dsu_pmu->pmu); cpuhp_state_remove_instance(dsu_pmu_cpuhp_state, &dsu_pmu->cpuhp_node); - - return 0; } static const struct of_device_id dsu_pmu_of_match[] = { @@ -806,7 +804,7 @@ static struct platform_driver dsu_pmu_driver = { .suppress_bind_attrs = true, }, .probe = dsu_pmu_device_probe, - .remove = dsu_pmu_device_remove, + .remove_new = dsu_pmu_device_remove, }; static int dsu_pmu_cpu_online(unsigned int cpu, struct hlist_node *node) From patchwork Fri Dec 15 13:59:09 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: 179302 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9294223dys; Fri, 15 Dec 2023 06:01:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IGVSGDYxRSb9DDObTfukPivy2OKxe3BhPJPlg+UCrfiQ/rWHSuu9D/uDVpS3zIrcM5REc8N X-Received: by 2002:ac5:c818:0:b0:4b2:83ab:7ebd with SMTP id y24-20020ac5c818000000b004b283ab7ebdmr3927901vkl.11.1702648885180; Fri, 15 Dec 2023 06:01:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702648885; cv=none; d=google.com; s=arc-20160816; b=r0QeyanBXzcVdjHAtagffvGZIX8kg0j+FkIOwgnMUSy7m2DtNrk5bFhhHtYmrfhGC/ ezCrIXr0CFs4fZ6HUPj6A0ZBY4FUzQE5c81VWkJDRLHtc6KlHEu8+TG+hBCmGiJvghN9 TpIEbBxIV0/fb9X5iNdQorhD19wZZfdnZ7jgjn8/U7wLMCOR3qt0o0Ged2nzmBX6M/Q4 lTxtAdeuIiVNjYTcE4XdFSu/NB/2IkOXANoUIjMbh8XJFb2tMKqt53ta+be7inna8tqz XT49GPzIFupF7Ed+Hvtux96xJ5jyFKKnRHbX1SVyjujBY/n9qMLXftyBaFwS4gEG7/L8 0T5A== 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=LO8tfA83ro7aJasBu/eZ4vCmAKZzSkqkt3/2PWnzAPg=; fh=WBAvDUdZQ65Hx9170m7xg5JkwQLI0WSCirM0+e+PVtk=; b=hyYrG0Vc6dN4XjUImbNx1u71SjIF/FmdaRXbuE5AjIhzjstOI9OYmWRdErtEvYdrtX MqCGzrcPtFmGTmqPcwj8DxdDy3Hz9KLk2fm+9zKhVXzDEa4fsFi+rM24RBGQzxsO8oqN dbjiB8dthb0/2uWhQyfhBw7CximLm/6TOK6BOCzuCUrKxJN1EZDQLa0oGjC4/oCjyNza YGWXGwzlSpfe2Z7wdJYGA0LNwZQy3auupuFerNrEPWCHhHZfV97vLO/ueJxZ+CrztcHh yqlG2kTBqLKmhdBjWmuRygpscOu8Ghc4Dgg5/x7CXOdgc+CiBFeYBApyIg4e3Xnmxe+v AP6w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1057-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1057-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id y124-20020a1f4b82000000b004b2d92f7eabsi3439143vka.264.2023.12.15.06.01.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 06:01:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1057-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1057-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1057-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id F2E441C22C0E for ; Fri, 15 Dec 2023 14:01:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0D24331A63; Fri, 15 Dec 2023 13:59:39 +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 F156C2EB1A for ; Fri, 15 Dec 2023 13:59:35 +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 1rE8iw-0002mJ-Tn; Fri, 15 Dec 2023 14:59:30 +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 1rE8iw-00G2Zl-Gk; Fri, 15 Dec 2023 14:59:30 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8iw-003cCY-7L; Fri, 15 Dec 2023 14:59:30 +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 09/18] perf: arm_smmuv3: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:09 +0100 Message-ID: <23bfd1a73ce819ffce6137c237608684a3cdfda6.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=1779; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=WoUmgvDx6FwJTMCVD5BbKw0j9xOmLxz1U/nwD6WKOcw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFuvsCq62C9qwNvQCGzRX11jvZolyVoVwJoOU 2Pmd6ixFyyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbrwAKCRCPgPtYfRL+ Tko8B/4gczEX6cq/EpSayum0gjAC6YWceqcQyx+h3VFIm0jNwy1lr8d0iDJMRDqEeDZN0MEuCCh a+KRJiDm1t4J7zO8axMAreV6sCCMdL9vi8wLNJhphHuxDUaSu2CCmcKqkU7u/R4vXYf7D0qTAIM JhblkMgyhjTfzeqLNET/vGatSow+qjW5KWUVlH4cBNTVUWjk4t8nuxg5++dtTrUGnof6bo0Ivcn BPfniPiTdoBEE23U6vHSnp55tep/W0h9rqokLUZdRBE3F4r99Dvp8DqAKS5kQIuK+2E4dTadnFt Iv57KcGOAQZschzGKhWvvkv9JJigxUJemXGDPKAvp9NttgOz 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: 1785356757342700920 X-GMAIL-MSGID: 1785356757342700920 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/arm_smmuv3_pmu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/perf/arm_smmuv3_pmu.c b/drivers/perf/arm_smmuv3_pmu.c index 6303b82566f9..af3ab3eb944e 100644 --- a/drivers/perf/arm_smmuv3_pmu.c +++ b/drivers/perf/arm_smmuv3_pmu.c @@ -965,14 +965,12 @@ static int smmu_pmu_probe(struct platform_device *pdev) return err; } -static int smmu_pmu_remove(struct platform_device *pdev) +static void smmu_pmu_remove(struct platform_device *pdev) { struct smmu_pmu *smmu_pmu = platform_get_drvdata(pdev); perf_pmu_unregister(&smmu_pmu->pmu); cpuhp_state_remove_instance_nocalls(cpuhp_state_num, &smmu_pmu->node); - - return 0; } static void smmu_pmu_shutdown(struct platform_device *pdev) @@ -997,7 +995,7 @@ static struct platform_driver smmu_pmu_driver = { .suppress_bind_attrs = true, }, .probe = smmu_pmu_probe, - .remove = smmu_pmu_remove, + .remove_new = smmu_pmu_remove, .shutdown = smmu_pmu_shutdown, }; From patchwork Fri Dec 15 13:59:10 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: 179303 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9294483dys; Fri, 15 Dec 2023 06:01:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IFfcualQOl6GjzjXVWzsmDGoJTYjNIM4slBssbMRHdWzTalvIfUugtlCGvF2GLRu3DtHdyK X-Received: by 2002:a17:903:244e:b0:1d0:cd48:e05c with SMTP id l14-20020a170903244e00b001d0cd48e05cmr14670101pls.75.1702648898011; Fri, 15 Dec 2023 06:01:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702648897; cv=none; d=google.com; s=arc-20160816; b=aqSXWoCG4PerU07WDm2o9Bp/jtC5mzjcdbUkTtvp9ANOle+WdETc4+ldvQ//OePa/o HVu1SgD3HnIDL5qfDL5rdV52ORGYlgDYcreMZiJlKZbYeIuflAFNv/NVezqGTDAe06q8 s+Hr6u60mZ/xXUEi6UI7lehFAMkVlX/yaPii72vNUCT9EmUvgSwS3ZhA6CAwAy07cGFg 4Hn71xNtETKxIkY//BBPTU8nel+TM36ZL/m/YOCl8YKs7qgli1grvQx1dk2gkf2U4VdI cTpmi+zaFXHjyyi+h0jhQaWh4nhFxboKg+G+10aZVip27xh8EjtaOgBQfd+oMEIi1NcV abPQ== 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=MVBDtjO/1yh/QfvH4HCcHohKsrgcSMPtmPNH4KgaQZo=; fh=WBAvDUdZQ65Hx9170m7xg5JkwQLI0WSCirM0+e+PVtk=; b=YjvnulI35+IO08yr0dH8N9zGIxpErf0rxES7gLceHIkaM5G3zSWidIRr9qhBky+U49 /uxryZ0Dzo4y9WtR/ImNumAclk9L+SejiDSKXEKwidDVOXAEFotpxqjWQ9r6G0XQUa0T GlF7jjD2WFls9onlWE53O14V/ZnlZJme9yA2tm9dflh02sUabG+15CwjpRvOdllRWl0A SZa6ZrVQGikjnKIWWBIMMePV+kBDA75lDwPz7N7CPzuT0kCQPUTGhC86uIteHjkTEf2o 4uP2XAth6Y8WxE4hEEicSdLz3LH/sHiCEVnqbGiikYnRCiE+mlEmWFUtP9liK6jQXAGd NSxw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1058-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1058-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id s11-20020a170902ea0b00b001ce5ba27888si13411014plg.211.2023.12.15.06.01.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 06:01:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1058-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; spf=pass (google.com: domain of linux-kernel+bounces-1058-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1058-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id AA782285EBC for ; Fri, 15 Dec 2023 14:01:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C9F2D3454F; Fri, 15 Dec 2023 13:59:39 +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 C65462FE3F for ; Fri, 15 Dec 2023 13:59:36 +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 1rE8ix-0002mR-BL; Fri, 15 Dec 2023 14:59:31 +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 1rE8iw-00G2Zp-UK; Fri, 15 Dec 2023 14:59:30 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8iw-003cCc-Kk; Fri, 15 Dec 2023 14:59:30 +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 10/18] perf: arm_spe: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:10 +0100 Message-ID: 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=1826; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=ebvrrVyODNmxG3JvaFcjW9M/wrd0jxp2bmDDzLkJNiU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFuwX1T9I98FsOZp/j5NoPrWESK2E3mBg3LWt VCaiOeyYiqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbsAAKCRCPgPtYfRL+ TgtzCACm2pQyhNJ/AJgC3ETsfXRz6oWzGYTxy2234b+nUURm2k4Z5MDNXqpcVrKfleWHD6qZnOP lQLYvUeaUjudGxEGvwadRqepqSeaV54gsAtNQhtSobFMoeJ4pXVxaDuB0N1krBYmqz87ykPvhxg NVqhwz+ZHZJTAmINKAd5gDhNRqratyN9uTiOTDF/dXuD304nabaTRih3ZSycOPQH8oT6eVkq7DQ XocFHOJ7jvs3CK0yv9kp3hQDqezmVM9YpymgUM4OLmi1WFxkVHEAELS8JsKIZQcWRuW8e65zfp/ DgW8qqlGV1xUqK5F6VpYEhF5nGCCmwNl6lwcGA6uO5FNQUwd 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: 1785356770430746456 X-GMAIL-MSGID: 1785356770430746456 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/arm_spe_pmu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/perf/arm_spe_pmu.c b/drivers/perf/arm_spe_pmu.c index b622d75d8c9e..35f0de03416f 100644 --- a/drivers/perf/arm_spe_pmu.c +++ b/drivers/perf/arm_spe_pmu.c @@ -1263,14 +1263,13 @@ static int arm_spe_pmu_device_probe(struct platform_device *pdev) return ret; } -static int arm_spe_pmu_device_remove(struct platform_device *pdev) +static void arm_spe_pmu_device_remove(struct platform_device *pdev) { struct arm_spe_pmu *spe_pmu = platform_get_drvdata(pdev); arm_spe_pmu_perf_destroy(spe_pmu); arm_spe_pmu_dev_teardown(spe_pmu); free_percpu(spe_pmu->handle); - return 0; } static struct platform_driver arm_spe_pmu_driver = { @@ -1281,7 +1280,7 @@ static struct platform_driver arm_spe_pmu_driver = { .suppress_bind_attrs = true, }, .probe = arm_spe_pmu_device_probe, - .remove = arm_spe_pmu_device_remove, + .remove_new = arm_spe_pmu_device_remove, }; static int __init arm_spe_pmu_init(void) From patchwork Fri Dec 15 13:59:11 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: 179309 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9296065dys; Fri, 15 Dec 2023 06:03:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IHY97K5ntpZcvnl1wQVF6WX7QLHYBxohw5CnXa0A2u3EYZ7gbHPHc9+q2QTXGYBQoBFyK8d X-Received: by 2002:a17:906:1cc2:b0:a1f:69b1:a493 with SMTP id i2-20020a1709061cc200b00a1f69b1a493mr3927720ejh.187.1702648987206; Fri, 15 Dec 2023 06:03:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702648987; cv=none; d=google.com; s=arc-20160816; b=pCwkIxKBLghxeJezlGsPaiE//Erx1tBfG5Uq6XgJqeMZGenL/0vFJfXOMHsQ8hI276 nk6eFwUUQGxw5afTuospL6ZUzBgZI4U0tJvR1hPMGdNNJNXs/YO19uUC9Df7b6S4Z6Ao u/NpPB+3RvhTT6vf4bUYmancya8j0/6N32zx1bk4Z63Wqq1xl8mExSs1MG5tCaki8fEu BJ9jl6eH7GnfSCHvk/BxDSR01JN6Ie15O7y7SlnG2hLetjfDuRx/AO9H3mMuKpPjuG5a VMbhSBWyV8y4HSR8Jii86XqBMeoHeC23LLCFvAffQn0T1osCLzMhJpNqNJNkSFMzvzTE qIzA== 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=SUNKKr6dYHtEu5fOvj7kPx70fx8URsyfh1UDB9nm884=; fh=VnqN9gvG7f7PFjybLJK5tohSJBOOYXZP9MP5VkWGa00=; b=KP20gPlRFLzvPXh30bWHJbc+KPfVNgxHvqWB2dKGT/zbgxcRnD8TRS7IzHhCkXQ5d5 T/PYIgaXAchid11qvNUmHRWI/ZnuF0hOdN/xmaRlgEDHSU8tBjHdzco0dPQsstZ/Bbmo Zq2HaPtn9EkKt5NstEc+wNPKIUoc4GxeYaLu8JMtOu44HAEqsblGv7PqeNnG+3aKI/QC YJkWVVcNqm6GTdi4peAuGwtyD6v5j3YsWMeJhwRKHneJbhFuNNFTQpk3ZXodiZzsog6h 5+pOctMqjR/Gk76oF9NO2LYtqlYxdteG/UfFGxCNmMaUyxX5BvbVPMaujfeZqa76kIsQ aV3A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1063-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1063-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id u10-20020a1709060b0a00b00a2320450925si57769ejg.336.2023.12.15.06.03.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 06:03:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1063-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1063-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1063-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 65D4C1F24672 for ; Fri, 15 Dec 2023 14:02:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 255B936AF3; 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 2EC4C31A73 for ; Fri, 15 Dec 2023 13:59:38 +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 1rE8ix-0002mX-Ni; Fri, 15 Dec 2023 14:59:31 +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 1rE8ix-00G2Zt-9c; Fri, 15 Dec 2023 14:59:31 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8iw-003cCg-Vu; Fri, 15 Dec 2023 14:59:31 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Will Deacon , Mark Rutland Cc: Frank Li , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 11/18] perf: fsl_imx8_ddr: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:11 +0100 Message-ID: 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=1845; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=T+20pqO282TURQ3KdX9THzy7jvQJXD3iKvoD14JC1QE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFuxbrW2Q2PBwqQM4KAykWSBx75C886HAfiiG N9zzX46qnyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbsQAKCRCPgPtYfRL+ TqngCACUznhYhR8/BzUWG4hp303BWa3SfxSmsN5tbFkOpRb0acP7jKPKS4I7sOqxOeGneQWBCRy 5ZzIULjqO0zTyhnEn9S84dJL619cRTzQGlhi8D0nR33rRCL77eHWD7VIAgwubHYwpVpPX7lXOMS yAwjU2ryhwe7oezSSMrwBK1gv7W/2/wP6UlECKixF4SGK8Nl5xQlEYstnUkbV1pWQt7nit0bsGx dUBQJPvnCQIzi+U2WD5o1vix9RJSi8JTRUMZweWk9h5cMqdkla+cdKjN1rTw12munZhHlOZHVqb eZbhrpDVcuiFaV3nn2FLb6y/8q9hNNfQloQaA7pNifjITj90 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: 1785356864730597823 X-GMAIL-MSGID: 1785356864730597823 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/fsl_imx8_ddr_perf.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/perf/fsl_imx8_ddr_perf.c b/drivers/perf/fsl_imx8_ddr_perf.c index 7dbfaee372c7..4e8fa5a48fcf 100644 --- a/drivers/perf/fsl_imx8_ddr_perf.c +++ b/drivers/perf/fsl_imx8_ddr_perf.c @@ -826,7 +826,7 @@ static int ddr_perf_probe(struct platform_device *pdev) return ret; } -static int ddr_perf_remove(struct platform_device *pdev) +static void ddr_perf_remove(struct platform_device *pdev) { struct ddr_pmu *pmu = platform_get_drvdata(pdev); @@ -836,7 +836,6 @@ static int ddr_perf_remove(struct platform_device *pdev) perf_pmu_unregister(&pmu->pmu); ida_free(&ddr_ida, pmu->id); - return 0; } static struct platform_driver imx_ddr_pmu_driver = { @@ -846,7 +845,7 @@ static struct platform_driver imx_ddr_pmu_driver = { .suppress_bind_attrs = true, }, .probe = ddr_perf_probe, - .remove = ddr_perf_remove, + .remove_new = ddr_perf_remove, }; module_platform_driver(imx_ddr_pmu_driver); From patchwork Fri Dec 15 13:59:12 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: 179308 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9295812dys; Fri, 15 Dec 2023 06:02:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IFoOKKg9bBwO5MTzMhkewQe2K6PvGvuz7mwEH31bfR9Ae6vyS48WrEh/fn0keRn3Wmer9Ij X-Received: by 2002:a9d:6b90:0:b0:6d9:de3c:e6b2 with SMTP id b16-20020a9d6b90000000b006d9de3ce6b2mr6508976otq.39.1702648973144; Fri, 15 Dec 2023 06:02:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702648973; cv=none; d=google.com; s=arc-20160816; b=Z+3rl+qEb653PVhzdb8Av9f5f67gtz+zzOOXQQilHh1Hx8gCdV5dAkl8r2pD5aJEYP Ucfo+H9ZE8HhffimcUVr6QIgxOYl9rmWHDgOTIzbydV5czXwN9lrF1XeU4Z0LweTfrmu pxRAU3Dll64aehOHis2UiXBHp3cfoIbMSk+nCAR21oLjIx0B3Fo81XPo761DituylYG9 awXlzhoH0KahmXtYrPfgw/Zf30bFFAg3PxFRpnfopgUw64Z8PelV3ShJ4+5Q2i83meNa wLaECGsPMDiB0/dZpUiDKeP+uyylqhBsRotgKhY339F4hvjMEBHy9xKTgT6AO0xfGkMI 8lTw== 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=EV4Wa+Opb0Bk9Gc4Ep+A/7NaUe2smM4BVPVAKr6Ziac=; fh=IzJ+G4eNjitPFqUi14ivUwieOMsSQ7Fus+T/b8/hbjg=; b=BxDAUx6BWzY5sHUrkp+CFFfrpWixS3lgAqPkAf9dBrvwYgEzUrTU3wwyBnHvNyDLg/ aNoRiCfC4hq3JjNp9D8gvOBfErw0p59PlkMXREjmAMAEeyS7nlnXv6qer0xaAnTpbZUZ 6YaCVHgGrW8C+2jrW6c25NDn+HnBrQebBVtnEMwwBBYSaEUyOPWieQG0eqIgpMJMFYIy TERdIgdlTB2eViWwKEBofKRZCEBLFS4saIKaJygkLWoSJfw/IkhS6F49c68+aRUtyYAX od7HU6weZYGgKfFvmI/MJPecnQDLGsoE/XbTGHbc0ajVkj7NAh2jtDRGQmr9SvmXHE/8 h9pA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1064-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1064-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id g24-20020a056830161800b006d8000014a1si5166887otr.331.2023.12.15.06.02.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 06:02:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1064-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; spf=pass (google.com: domain of linux-kernel+bounces-1064-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1064-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 4ECF7284378 for ; Fri, 15 Dec 2023 14:02:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 85D1B37140; 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 8A41F321B2 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 1rE8iy-0002mw-7C; Fri, 15 Dec 2023 14:59:32 +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 1rE8ix-00G2Zx-Oe; Fri, 15 Dec 2023 14:59:31 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8ix-003cCp-F9; Fri, 15 Dec 2023 14:59:31 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Will Deacon , Mark Rutland Cc: Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 12/18] perf: fsl_imx9_ddr: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:12 +0100 Message-ID: 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=1849; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=NXdhdQQKZ6b1dcEG52uoPa64FeprMMqzZeyISKSgu6o=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFuzTqXZWOR+jvLxMzxn/N3EohQwIej9USNDY 81tT77OLbSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbswAKCRCPgPtYfRL+ TsMDCACbYsOrWMQZTfj5ByGoS2/B+xJSE88BfpXrdNEUrS5LY2vhmwYMlX1NbyFGP0DpYKUDqZC c7LDp1ZSXl2iLIjp9Thh3zsRes5DIjXq/tqCUwMIMyyh7JkHwZg5xcbjcsKrWiU/huql2AaryPH l51ZpPkIW6xq31eVovns+UQGQFnHKo1BTlZ8r7aGkuYjIn9J33uu1eTvqM1/e1mx1fxvHH5US6e sBKjLsP0K/dYgyOfYCQ5Jq2wb9e1yiLR9olQpEqjd6aAbHw1tCKWJcL+ZXWONA3ryjMdANvZdYk omhE20yAo7ThOBtHe0scaUjv2wgRUeQfMZMFK+c53Wyo0DDi 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: 1785356849826471768 X-GMAIL-MSGID: 1785356849826471768 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/fsl_imx9_ddr_perf.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/perf/fsl_imx9_ddr_perf.c b/drivers/perf/fsl_imx9_ddr_perf.c index 9685645bfe04..72c2d3074cde 100644 --- a/drivers/perf/fsl_imx9_ddr_perf.c +++ b/drivers/perf/fsl_imx9_ddr_perf.c @@ -679,7 +679,7 @@ static int ddr_perf_probe(struct platform_device *pdev) return ret; } -static int ddr_perf_remove(struct platform_device *pdev) +static void ddr_perf_remove(struct platform_device *pdev) { struct ddr_pmu *pmu = platform_get_drvdata(pdev); @@ -689,8 +689,6 @@ static int ddr_perf_remove(struct platform_device *pdev) perf_pmu_unregister(&pmu->pmu); ida_free(&ddr_ida, pmu->id); - - return 0; } static struct platform_driver imx_ddr_pmu_driver = { @@ -700,7 +698,7 @@ static struct platform_driver imx_ddr_pmu_driver = { .suppress_bind_attrs = true, }, .probe = ddr_perf_probe, - .remove = ddr_perf_remove, + .remove_new = ddr_perf_remove, }; module_platform_driver(imx_ddr_pmu_driver); From patchwork Fri Dec 15 13:59:13 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: 179314 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9297390dys; Fri, 15 Dec 2023 06:04:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IHSku5CFcbyZunqi5IGJNDU9KDwxQEnleB5KafKM45Cbqu1bV6Ejr0k7Ia5JphFh69oDmGi X-Received: by 2002:a17:906:ae89:b0:a1c:5b15:2463 with SMTP id md9-20020a170906ae8900b00a1c5b152463mr4416469ejb.140.1702649064136; Fri, 15 Dec 2023 06:04:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702649064; cv=none; d=google.com; s=arc-20160816; b=sxnqfAa/y8uC/L+L3LBNN6YdU11BiKvoAq38/+7trDaOS00BhjQtf3AVuD67NVqUqH Lw7tvx1VScA95DMzS7+qh1ITD+/mkidmzGrezFElcTCvsU/xaiuC4OGEe8eUf9gGE4Co jmqMbiRJ9KsWC7MJx1yGzcxVPNLtQcKnQwNOue11IA7pU7A7cpMfPnlppAXgLJMZnsR5 8ionIfILRo4uARs3ZE/D5DoQqQx/4ZxsA4I7Lhv4MN0O5345xrolJ1ZYFd+Axcol3VfH IWVR1ItPCRIfW/IuFIQa38Km53PGlydiIL9ncfENH/r0j/+GePJuQp6bdmppVBjDXRDh GiSQ== 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=xwj3j/bfFKt2KMEKF+nwf4Ux8ZSroErPrcqWaZ2VbTU=; fh=tNB2jf9nC6zD0EkHfH23P3iUAU/Ilbl8j8PboOhke1U=; b=Jxt6OJesJxUwedvmhPbxR30RlasxjGMYJoKRfNwPhyPDWub6pokx0U4fSAiKFjDH/P KzJlU91Yyni7pxb7AZzwfkXVyg3KdFaOBQu0Tgz+udd1Xd0v7OMlf7Kk6NEPax93YaEh 1xjEanwctZjS/oZjlQpcgisipR4IL3zhA0XSIfFISOZkn8PyP2QoZBhKCe0INwzro/pX Jad4ZLC/yMiHS7jxDSELI7gOX5HtvNVTjPZ/s8pEyotoFPeO9eANJoZ0N9ry2uH8Qs4D uk66BRmNsLOA9Q8spwpm9EGyhY98/IOh16V/nFW916DZ97ULxjLIHcZiwz1LKYVSCCxJ 9Qbw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1070-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1070-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id jt17-20020a170906dfd100b00a231ba29c6csi415824ejc.268.2023.12.15.06.04.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 06:04:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1070-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1070-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1070-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 91C181F22A3F for ; Fri, 15 Dec 2023 14:04:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C78B93DB9A; Fri, 15 Dec 2023 13:59:48 +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 CD7F93C46A for ; Fri, 15 Dec 2023 13:59:45 +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 1rE8iy-0002nD-JB; Fri, 15 Dec 2023 14:59:32 +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 1rE8iy-00G2a1-4C; Fri, 15 Dec 2023 14:59:32 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8ix-003cCt-RA; Fri, 15 Dec 2023 14:59:31 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Will Deacon , Mark Rutland Cc: Yicong Yang , Jonathan Cameron , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 13/18] perf: hisilicon: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:13 +0100 Message-ID: <33a8be0641b9447469fb7f6af0a10fb65efa97a3.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=7525; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=dBrvfcbHwf9YFBIy44YHlg/Q1c5X8IaEDYgph7Wakac=; b=owGbwMvMwMXY3/A7olbonx/jabUkhtSa6C1fM6zVmn2PH2BmNO2Yyslosue3hvrUOZau1157d nzJyDzayWjMwsDIxSArpshi37gm06pKLrJz7b/LMINYmUCmMHBxCsBExC6x/1Ot6H8lPtlz4sYQ x0kF0uVPH34W3yM+R4OD48jU96XCd2S5GXdEli5YqqRbfsTsaOmjFlWVwpRfX5T25a17cD3G0UT DcvqU8+ye7w9teR60ptJYcMPUJNv+D18F5rW81ps3+2Ls5r7j62c2dMeJ2LIveHKVaV/2q6b9rQ d6Em15xVMDfTeKTA7mePG4wT/B9MAflycF3YtfCX713PTm3S6/rOifTMcOMR421jqa8J9TWfGwJ Hufr/2thFPv2O6Ernhev/hGZFaljRNTHsuVVZO6n8eK1N5WUVfx6pBtv250Q2RPznmmqBf3dDhm RwS68d9z0N5eNveQaaFxNR83V2qanchy6zqZ9pIqDZ2/AA== 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: 1785356945243480996 X-GMAIL-MSGID: 1785356945243480996 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 these drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/perf/hisilicon/hisi_uncore_cpa_pmu.c | 5 ++--- drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c | 5 ++--- drivers/perf/hisilicon/hisi_uncore_hha_pmu.c | 5 ++--- drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c | 5 ++--- drivers/perf/hisilicon/hisi_uncore_pa_pmu.c | 5 ++--- drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c | 5 ++--- 6 files changed, 12 insertions(+), 18 deletions(-) diff --git a/drivers/perf/hisilicon/hisi_uncore_cpa_pmu.c b/drivers/perf/hisilicon/hisi_uncore_cpa_pmu.c index 40f1bc9f9b91..0e923f94fa5b 100644 --- a/drivers/perf/hisilicon/hisi_uncore_cpa_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_cpa_pmu.c @@ -341,7 +341,7 @@ static int hisi_cpa_pmu_probe(struct platform_device *pdev) return ret; } -static int hisi_cpa_pmu_remove(struct platform_device *pdev) +static void hisi_cpa_pmu_remove(struct platform_device *pdev) { struct hisi_pmu *cpa_pmu = platform_get_drvdata(pdev); @@ -349,7 +349,6 @@ static int hisi_cpa_pmu_remove(struct platform_device *pdev) cpuhp_state_remove_instance_nocalls(CPUHP_AP_PERF_ARM_HISI_CPA_ONLINE, &cpa_pmu->node); hisi_cpa_pmu_enable_pm(cpa_pmu); - return 0; } static struct platform_driver hisi_cpa_pmu_driver = { @@ -359,7 +358,7 @@ static struct platform_driver hisi_cpa_pmu_driver = { .suppress_bind_attrs = true, }, .probe = hisi_cpa_pmu_probe, - .remove = hisi_cpa_pmu_remove, + .remove_new = hisi_cpa_pmu_remove, }; static int __init hisi_cpa_pmu_module_init(void) diff --git a/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c b/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c index ffb039d05d07..b804e3738113 100644 --- a/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c @@ -531,14 +531,13 @@ static int hisi_ddrc_pmu_probe(struct platform_device *pdev) return ret; } -static int hisi_ddrc_pmu_remove(struct platform_device *pdev) +static void hisi_ddrc_pmu_remove(struct platform_device *pdev) { struct hisi_pmu *ddrc_pmu = platform_get_drvdata(pdev); perf_pmu_unregister(&ddrc_pmu->pmu); cpuhp_state_remove_instance_nocalls(CPUHP_AP_PERF_ARM_HISI_DDRC_ONLINE, &ddrc_pmu->node); - return 0; } static struct platform_driver hisi_ddrc_pmu_driver = { @@ -548,7 +547,7 @@ static struct platform_driver hisi_ddrc_pmu_driver = { .suppress_bind_attrs = true, }, .probe = hisi_ddrc_pmu_probe, - .remove = hisi_ddrc_pmu_remove, + .remove_new = hisi_ddrc_pmu_remove, }; static int __init hisi_ddrc_pmu_module_init(void) diff --git a/drivers/perf/hisilicon/hisi_uncore_hha_pmu.c b/drivers/perf/hisilicon/hisi_uncore_hha_pmu.c index 15caf99e1eef..21e69b1cdd4d 100644 --- a/drivers/perf/hisilicon/hisi_uncore_hha_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_hha_pmu.c @@ -534,14 +534,13 @@ static int hisi_hha_pmu_probe(struct platform_device *pdev) return ret; } -static int hisi_hha_pmu_remove(struct platform_device *pdev) +static void hisi_hha_pmu_remove(struct platform_device *pdev) { struct hisi_pmu *hha_pmu = platform_get_drvdata(pdev); perf_pmu_unregister(&hha_pmu->pmu); cpuhp_state_remove_instance_nocalls(CPUHP_AP_PERF_ARM_HISI_HHA_ONLINE, &hha_pmu->node); - return 0; } static struct platform_driver hisi_hha_pmu_driver = { @@ -551,7 +550,7 @@ static struct platform_driver hisi_hha_pmu_driver = { .suppress_bind_attrs = true, }, .probe = hisi_hha_pmu_probe, - .remove = hisi_hha_pmu_remove, + .remove_new = hisi_hha_pmu_remove, }; static int __init hisi_hha_pmu_module_init(void) diff --git a/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c b/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c index 794dbcd19b7a..51ba76871097 100644 --- a/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c @@ -568,14 +568,13 @@ static int hisi_l3c_pmu_probe(struct platform_device *pdev) return ret; } -static int hisi_l3c_pmu_remove(struct platform_device *pdev) +static void hisi_l3c_pmu_remove(struct platform_device *pdev) { struct hisi_pmu *l3c_pmu = platform_get_drvdata(pdev); perf_pmu_unregister(&l3c_pmu->pmu); cpuhp_state_remove_instance_nocalls(CPUHP_AP_PERF_ARM_HISI_L3_ONLINE, &l3c_pmu->node); - return 0; } static struct platform_driver hisi_l3c_pmu_driver = { @@ -585,7 +584,7 @@ static struct platform_driver hisi_l3c_pmu_driver = { .suppress_bind_attrs = true, }, .probe = hisi_l3c_pmu_probe, - .remove = hisi_l3c_pmu_remove, + .remove_new = hisi_l3c_pmu_remove, }; static int __init hisi_l3c_pmu_module_init(void) diff --git a/drivers/perf/hisilicon/hisi_uncore_pa_pmu.c b/drivers/perf/hisilicon/hisi_uncore_pa_pmu.c index 797cf201996a..3cdb35c741f9 100644 --- a/drivers/perf/hisilicon/hisi_uncore_pa_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_pa_pmu.c @@ -514,14 +514,13 @@ static int hisi_pa_pmu_probe(struct platform_device *pdev) return ret; } -static int hisi_pa_pmu_remove(struct platform_device *pdev) +static void hisi_pa_pmu_remove(struct platform_device *pdev) { struct hisi_pmu *pa_pmu = platform_get_drvdata(pdev); perf_pmu_unregister(&pa_pmu->pmu); cpuhp_state_remove_instance_nocalls(CPUHP_AP_PERF_ARM_HISI_PA_ONLINE, &pa_pmu->node); - return 0; } static const struct acpi_device_id hisi_pa_pmu_acpi_match[] = { @@ -539,7 +538,7 @@ static struct platform_driver hisi_pa_pmu_driver = { .suppress_bind_attrs = true, }, .probe = hisi_pa_pmu_probe, - .remove = hisi_pa_pmu_remove, + .remove_new = hisi_pa_pmu_remove, }; static int __init hisi_pa_pmu_module_init(void) diff --git a/drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c b/drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c index e706ca567676..765bbd61db26 100644 --- a/drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c @@ -460,14 +460,13 @@ static int hisi_sllc_pmu_probe(struct platform_device *pdev) return ret; } -static int hisi_sllc_pmu_remove(struct platform_device *pdev) +static void hisi_sllc_pmu_remove(struct platform_device *pdev) { struct hisi_pmu *sllc_pmu = platform_get_drvdata(pdev); perf_pmu_unregister(&sllc_pmu->pmu); cpuhp_state_remove_instance_nocalls(CPUHP_AP_PERF_ARM_HISI_SLLC_ONLINE, &sllc_pmu->node); - return 0; } static struct platform_driver hisi_sllc_pmu_driver = { @@ -477,7 +476,7 @@ static struct platform_driver hisi_sllc_pmu_driver = { .suppress_bind_attrs = true, }, .probe = hisi_sllc_pmu_probe, - .remove = hisi_sllc_pmu_remove, + .remove_new = hisi_sllc_pmu_remove, }; static int __init hisi_sllc_pmu_module_init(void) From patchwork Fri Dec 15 13:59:14 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: 179305 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9294908dys; Fri, 15 Dec 2023 06:02:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IFk+y+eYMA4iLzdyaCNON5EzeX+KSFANKXTmztpHKaZRBaE1GAuHFIY+NrpSU1BAEU+gK2t X-Received: by 2002:a05:6122:16a9:b0:49d:20fb:c899 with SMTP id 41-20020a05612216a900b0049d20fbc899mr11739419vkl.4.1702648921916; Fri, 15 Dec 2023 06:02:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702648921; cv=none; d=google.com; s=arc-20160816; b=HabGpVxXFe4spZgPEMtJiCK0rQcSdOovs2t+A5w06VEUfyt96+P3yPxN6luZ9Ktu2y 0j4GrsGl3JL7oL19FsNrIK/xUb0AAr2FHYbYma2gWx/de0tQRATvWYBpm3F9yscZH8rZ nAXeI4BTEQDCxfTrMIH9Q1XKF/7LBiLYFzos9vD6h3ejWnBwMxHujNq+u7TQuv1hMyC+ TnCKojoKWRNfXi+Pk2hA+ZAf8AbfjJ1gZ9bCYayu4wRpfyNmkW+qPhG+rknr+aRIKzfh 9cvfR1rloVeaIKIaBhvMPCdpEd7KUcjWhxi+aWn9wJ9Y3JIxIXpux6qd0GkC5fXz8LFo DWZg== 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=0WKEf3/qC1oCdXGGLGTrvlNmf9j0cF+tShdUKl+OtEY=; fh=WBAvDUdZQ65Hx9170m7xg5JkwQLI0WSCirM0+e+PVtk=; b=Yr+w3q9mAhOTURw+3tL9AK2fwzltWCb2j7Du4xlaz2Uc7+xDDJtQJ43bezJCSP0y/t vZyvC0yaPjAIEpjnfaCclof4h/AELmCESiEGVBgW1Vpm96IBrAwwLiuaOjoebLy04Ftm knearSHNzDbSnih1zTjoBXxJlcEx+OjywhdNoV77xqxC9jyFcdxthtZFxLNmt/e+QjhZ x5WwkHiIzZOrXsd8Y0C2oJzf3b6g+F3eHeni948EK6hvhL0NWGE+p4+Ly17zJ2NHPB5N fMJpfEubGZOhQH6iaXExRKFY0IDhBeI5A3iK1l9U54E6MGioi8RO935g9o3n4n+FIO+L 38PQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1060-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1060-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id w25-20020ab07299000000b007c58feac4f6si1650080uao.120.2023.12.15.06.02.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 06:02:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1060-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1060-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1060-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 61D521C20A42 for ; Fri, 15 Dec 2023 14:01:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BF70A34CF8; Fri, 15 Dec 2023 13:59:40 +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 C046530CE1 for ; Fri, 15 Dec 2023 13:59:37 +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 1rE8iy-0002oE-Ra; Fri, 15 Dec 2023 14:59:32 +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 1rE8iy-00G2a5-Ek; Fri, 15 Dec 2023 14:59:32 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8iy-003cCx-5M; Fri, 15 Dec 2023 14:59:32 +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 14/18] perf: marvell_cn10k_ddr: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:14 +0100 Message-ID: <79f48409f663f0184f03d34c6a86359ea3aa1291.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=1858; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=AaJsT1X2pzgRo5v0ti8PFad+Bo0hVSMW+Zt7jtXU/Pk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFu1xixSuGrOf/p7nomBMD+boDsgfkZhsVcIJ jL3+jPNtqCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbtQAKCRCPgPtYfRL+ Tiz6CACiS8xI0T+UYaD8IbsJWOu3Q5lL06rvqmuD1aiANRTc47wrYBNjHzsDwxz+vHj1i+MMOEW 9ESDSKrfsHg0U1507xoqY78JQV5B1qqgi9fN5GakPQx0XEjGhp/gwAXVDhAqcgsolhYY/LDq9IH jnk2bo35mJIH8passLkJkwKfrTyoOmpHWXVSvjgbl9r7DPfXfecidXcuDa6eUqiqe/yod94NmXZ +01OKeN6aoH0bTx14tOxYYr9rSYqd91XFO90LbvrppP/ZD6Qni7boOJZknVUpisulpSUufGxcRI cF7WmDCUCTzG8WzsG6a66pdtWVWV+J80XZAl/v9EedzAr14n 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: 1785356795715323473 X-GMAIL-MSGID: 1785356795715323473 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/marvell_cn10k_ddr_pmu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/perf/marvell_cn10k_ddr_pmu.c b/drivers/perf/marvell_cn10k_ddr_pmu.c index 524ba82bfce2..e2abca188dbe 100644 --- a/drivers/perf/marvell_cn10k_ddr_pmu.c +++ b/drivers/perf/marvell_cn10k_ddr_pmu.c @@ -697,7 +697,7 @@ static int cn10k_ddr_perf_probe(struct platform_device *pdev) return ret; } -static int cn10k_ddr_perf_remove(struct platform_device *pdev) +static void cn10k_ddr_perf_remove(struct platform_device *pdev) { struct cn10k_ddr_pmu *ddr_pmu = platform_get_drvdata(pdev); @@ -706,7 +706,6 @@ static int cn10k_ddr_perf_remove(struct platform_device *pdev) &ddr_pmu->node); perf_pmu_unregister(&ddr_pmu->pmu); - return 0; } #ifdef CONFIG_OF @@ -733,7 +732,7 @@ static struct platform_driver cn10k_ddr_pmu_driver = { .suppress_bind_attrs = true, }, .probe = cn10k_ddr_perf_probe, - .remove = cn10k_ddr_perf_remove, + .remove_new = cn10k_ddr_perf_remove, }; static int __init cn10k_ddr_pmu_init(void) From patchwork Fri Dec 15 13:59:15 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: 179307 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9295060dys; Fri, 15 Dec 2023 06:02:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IEzVI/wn6H4MyPMxsufvFSd29WHcNEBNYxNiUodkgXZ3YtJcxknVzIPUes56xn/en4i9j1v X-Received: by 2002:a17:902:ee95:b0:1d3:41b6:6d80 with SMTP id a21-20020a170902ee9500b001d341b66d80mr3539516pld.9.1702648930476; Fri, 15 Dec 2023 06:02:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702648930; cv=none; d=google.com; s=arc-20160816; b=IacErqmIPj2UrG7oYX6ITdOCIiZzzqb7OhJTcfmjq4kDXbfKY8VY0FGFflP6bvWjzw ekD7ogIr5cCWEwqA1i4UBc358+foo/oNuNVs3ZVjBDQmL2h5FJ25M+UkqaMA/x36fqds NTsFIiuSZRQtH6UnVZvnN/fCMDeYXsz/NxAxiR7rk+32y/xijLmSn/5/wLWYqPGUU4T3 0UtedQi5M4ApWgv9VhXSYvX5KCzs9m0GV313aL2BmDZaX2znRM7Jw9Ey7H9QPgqtEL2M v9WNMuql6tLeNLngaJibguLFL7bsIldyMbkOx+64Fvx1TU5WJosW16e50Hx0yF4bldiY L6jA== 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=jfE2SIIk/5VkQxdwey4BhLBSLAJabxdxt8eL5h+vqJE=; fh=WBAvDUdZQ65Hx9170m7xg5JkwQLI0WSCirM0+e+PVtk=; b=KLx9NyrQ8HloMjiM5737Dooy/DqlqzAlnwX5ogan3C4VTpzxfmRdxaw0BdbS0PCfNv Db+u0IjugIh5A2Y683fsLmnzAW8tLMkcBb0wivZDSzjDM9nglSPNwlsBYLfF8TYLOn9c OZbbdd/x+5axa7gPW3QSMfTJGoMS0NFobKUZWJeN+5wcGlsz+eU0730s1uKD9a2LfXdy MAL13nJCr+S8ifvuLIlo2qym42LtbdR/GT0ThTOuj0j3riWqU61QdAJG7n2D+Rsm7dc2 FN8vwCaGAkH8hq37Tx49Iw+1VDUC3P/+hPD5WR2KyJb7e1/1ZZWcVezvuy1CdFn8UsMl bG6g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1061-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1061-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id k9-20020a170902c40900b001d0bcb62f98si13749690plk.368.2023.12.15.06.02.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 06:02:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1061-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; spf=pass (google.com: domain of linux-kernel+bounces-1061-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1061-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 9DF5C285FEB for ; Fri, 15 Dec 2023 14:01:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C33DB34CFA; Fri, 15 Dec 2023 13:59:40 +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 DC32130CFA for ; Fri, 15 Dec 2023 13:59:37 +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-0002pb-9k; 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 1rE8iy-00G2aA-R8; Fri, 15 Dec 2023 14:59:32 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8iy-003cD1-Hr; Fri, 15 Dec 2023 14:59:32 +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 15/18] perf: marvell_cn10k_tad: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:15 +0100 Message-ID: <055656e474208b0fb583e249530fa211fa3be57c.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=1823; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=I1t5aJb11RWvKIbnkVtIejhEjKmdBG1m6FZj4F8ZzMY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFu2lEYp/dB1CWftEjB+6ZuPTaGjyNucTK5gu xt4aJPN/KOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbtgAKCRCPgPtYfRL+ TuDdB/kBymw7MNfXHM14jMTwT9lo4YG/rKEingqeCW6Fo0lo6/bvV3CO0nPSK2ER6RKINJQ1Br/ Fqk/85IWBL/L+MJNehclZ9NelvYivNs03ii3VXli7l/4gGJC9De3FGL6hOyAAEl9VGDJg38l9U8 LUEL0JuVui6u5eYK96P+kSHlr6N9jaajO1A4A3TEM2RwkFbyouqCMCMGxOs+UmD8o1gR8GxpBaE XKeeICZ0eW3hqicJKgJSTULFpSPR4xal0MI/wX6VwCcrtXtqL9nLWyGNlM9kKHV9FMgIqMkXA2N eSh5kMww8MrmaEbCsE8bouGhT7atXwxJAJtUPBjYlqN7n8vR 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: 1785356804829498696 X-GMAIL-MSGID: 1785356804829498696 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/marvell_cn10k_tad_pmu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/perf/marvell_cn10k_tad_pmu.c b/drivers/perf/marvell_cn10k_tad_pmu.c index fec8e82edb95..9e635f355470 100644 --- a/drivers/perf/marvell_cn10k_tad_pmu.c +++ b/drivers/perf/marvell_cn10k_tad_pmu.c @@ -351,15 +351,13 @@ static int tad_pmu_probe(struct platform_device *pdev) return ret; } -static int tad_pmu_remove(struct platform_device *pdev) +static void tad_pmu_remove(struct platform_device *pdev) { struct tad_pmu *pmu = platform_get_drvdata(pdev); cpuhp_state_remove_instance_nocalls(tad_pmu_cpuhp_state, &pmu->node); perf_pmu_unregister(&pmu->pmu); - - return 0; } #ifdef CONFIG_OF @@ -385,7 +383,7 @@ static struct platform_driver tad_pmu_driver = { .suppress_bind_attrs = true, }, .probe = tad_pmu_probe, - .remove = tad_pmu_remove, + .remove_new = tad_pmu_remove, }; static int tad_pmu_offline_cpu(unsigned int cpu, struct hlist_node *node) From patchwork Fri Dec 15 13:59:16 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: 179315 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9297925dys; Fri, 15 Dec 2023 06:04:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IHsifuV0YHdYaafaZ+vQjI7ROIj4gQzbxSvUsg5+rbXmYAYJEQIwmytK3Ka84wwtvciHAB0 X-Received: by 2002:a05:6a00:b87:b0:6ce:2731:d5b6 with SMTP id g7-20020a056a000b8700b006ce2731d5b6mr7358686pfj.39.1702649096179; Fri, 15 Dec 2023 06:04:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702649096; cv=none; d=google.com; s=arc-20160816; b=EuTo1d5t98mS0fje7VwhgnzqAbVIEzsOAXpYhMBeo/jtjw4W4Dax+tb/CPPYxYq4v5 F5q42w6H/ItMn/PrEnIlOO3RngnZmbtus3LZ7sd4AE88UUDXCKyCQS9Doq/eLfgtadDZ +gqYY4lEzro0Yo0hRhtefcBDhysh3wV5Sf0UWpxz+hy56OZxRv2sSoBdz2JlgJuqFSdw MQQjHtvVH2MoLWc0xPTjtBlKD7iPYARmtYKlP+CXvqKHk8Li933ar5vShVWHBPXZ1nab NYVcmDqykOuHvfklxUEpDzS54vWlk11T88F76yAkUGgr8dpAuBXPZTDWA9BXXZem9cZt oXwg== 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=D4CmieZu5bomJxBNGoFZ9uCDhBMRv7UBuSjdGsatLpQ=; fh=17mI11gd0OcJlQLec2mxFZ/J3s0EsMv9XAyKHfZQb/Q=; b=G2rqmiqgffb4gnHvOzTZljRc5ju+ZaWrCysCg+Rg1CRcxWbzoRXdD2dm3AmujjqBgx jkBtLtaSE1pTcisvDUMRnZWbyubJvW6fO0ynCtnu1vc/DxRAGqrVTCv8HkWvQpD9d4yy /eGHL/DHNI4Pm6a27mMdP04RvYuQop/1XWj1uHFsGHkToB2DP1lfWg6iMJS0Haj+7GwL qQfE5v8JdRri898cXtKS8Su8T/Hja38fAMrSAwx8dvC0vjak/tetlksE8OrWeXj3ru+T RZOl6VGMf6HzwawTE1n4jH7uGfgFOFy/rbzKArWjaUoFVz5PtQJ8jubCS2FQ2pCyHb8I 89cg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1069-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1069-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 fn10-20020a056a002fca00b006d265be18a7si2600836pfb.56.2023.12.15.06.04.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 06:04:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1069-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-1069-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1069-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 0F139B22473 for ; Fri, 15 Dec 2023 14:04:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 88B303C49C; Fri, 15 Dec 2023 13:59:46 +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 C285039FF1 for ; Fri, 15 Dec 2023 13:59:43 +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-0002qG-KU; 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-00G2aE-5u; 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 1rE8iy-003cD5-SO; Fri, 15 Dec 2023 14:59:32 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Will Deacon , Mark Rutland Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 16/18] perf: qcom_l2: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:16 +0100 Message-ID: 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=1931; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=VICxICa9rzVcpxd4YQzS3q7MnqlVMsOIGitfxpEhihs=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFu3p7ogtYGPBuZCsFnYFvOZg9wLXH6J7bohW JxjI9JrbLSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbtwAKCRCPgPtYfRL+ ThOdB/4mmPoWmDYG5uyMcSwzK1WP92WjeDvUiQQBHkp31CnYoCZDmYf3AJ1RZgzA71ftT89NP2i J+cLLxvsIKrjQ3U3i0G19YYMR1Tglb6sueG4oEkAqW70R7o6o2/itPnTZ9Q2R+Wq8Q7ekDdxYxq BlW1X0FE2Izyor49KMINVvrLnQCBfeKqsVBvnYBuOjX2muGy9hthfxsi0aSuNDLaXcGFwf20U8i OKcHR08eDXQNS1ZDJIe9ol6PJaN9B5cQIq+nwg8Ao6rAHqjRzJjvUVKUZs8U652FRvkQUIs1vy+ I9Z5fboAp0nA9MFJcfavCbIjfX49SP1CiF6xwTbJN6LALack 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: 1785356978510383301 X-GMAIL-MSGID: 1785356978510383301 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 Reviewed-by: Konrad Dybcio --- drivers/perf/qcom_l2_pmu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/perf/qcom_l2_pmu.c b/drivers/perf/qcom_l2_pmu.c index 3f9a98c17a89..148df5ae8ef8 100644 --- a/drivers/perf/qcom_l2_pmu.c +++ b/drivers/perf/qcom_l2_pmu.c @@ -965,7 +965,7 @@ static int l2_cache_pmu_probe(struct platform_device *pdev) return err; } -static int l2_cache_pmu_remove(struct platform_device *pdev) +static void l2_cache_pmu_remove(struct platform_device *pdev) { struct l2cache_pmu *l2cache_pmu = to_l2cache_pmu(platform_get_drvdata(pdev)); @@ -973,7 +973,6 @@ static int l2_cache_pmu_remove(struct platform_device *pdev) perf_pmu_unregister(&l2cache_pmu->pmu); cpuhp_state_remove_instance(CPUHP_AP_PERF_ARM_QCOM_L2_ONLINE, &l2cache_pmu->node); - return 0; } static struct platform_driver l2_cache_pmu_driver = { @@ -983,7 +982,7 @@ static struct platform_driver l2_cache_pmu_driver = { .suppress_bind_attrs = true, }, .probe = l2_cache_pmu_probe, - .remove = l2_cache_pmu_remove, + .remove_new = l2_cache_pmu_remove, }; static int __init register_l2_cache_pmu_driver(void) 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) From patchwork Fri Dec 15 13:59:18 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: 179311 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9296719dys; Fri, 15 Dec 2023 06:03:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IE0YfWsaIA5AzsY4jahN4mirEnvC1YmQEZonPCwegVkXvBzJn+7VWeAgqUWuygT5YYC2cMW X-Received: by 2002:a05:6102:4188:b0:464:5eac:c249 with SMTP id cd8-20020a056102418800b004645eacc249mr10617443vsb.0.1702649026561; Fri, 15 Dec 2023 06:03:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702649026; cv=none; d=google.com; s=arc-20160816; b=TtlguFND9jb+ILS7sjoctFy0PM4VVMwiHHCXW8499GJYcob771A53TGg3vPZNYB5bV m/yB7SNpYSAFtQIjm7CplU+b9rQkmghLFDJqBgPeXjHhcMT00qHJrlum/zLZhM9iJMju ckg90Lqbd/NCTmtmn2k8u+N2KJXfXwbDKSNB9cBZRjK+b/BC6boWAjelYW8FWiimIeaW X+ZPYrDctr4UyvjthDrKRtCuOSibvgdSVNVt0u0McawoA/ML7nahXzGMq9TqIHPbv0VW r/5g91MIEo22/6AH9UVQXFnFXbkkQjKDazeNwkbyScW5UiLI0GGmIoU2Halm5PsW1XLr OG0w== 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=Qn8DYMCXSYitDd5usJa79EOeAJLoxZ1yO79t5yfrlwg=; fh=DcNjyPhulAZQZ5ccHdmXoPHXQdKvB4fSOMNK6hkjNx8=; b=naeGX1mIzq863JixjVN29c+ItFYbhDo0DLge4b8isXnpvciSLIAHl8tvRlk1+Hjoel tQiy7nORJaKsndcfS6hjlDxKkQdx2zcq7te8soUkpe4FF9I1A2faeB9bVZPYlZcWCFpM N0gm6r+0XqMm0aknjZT/Jy6+W6XZjFGHiQB1X67LsZBpsZzTyW1b2s1YQkcvgqQWGzsx o+n5Pb3vYRCyzzzD3Sz/AI0gL2D9BbhQ0xplsWTXpXxq8oipE+GQ0DFxZ4kSZjup8AHb Xs/Dnd+0IMYJEyYIfx+FRD6le/eiyb0KcklRCq3f3+B1nREAjWnAskH8HOOAFjYAYHBt 6lqg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1067-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1067-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id x13-20020a0561020c0d00b0046625e5093dsi2523571vss.678.2023.12.15.06.03.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 06:03:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1067-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1067-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1067-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 57AC31C23293 for ; Fri, 15 Dec 2023 14:03:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8944B3BB2C; Fri, 15 Dec 2023 13:59:44 +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 874C8347CB for ; Fri, 15 Dec 2023 13:59:40 +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 1rE8j0-0002rC-Ed; Fri, 15 Dec 2023 14:59:34 +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 1rE8j0-00G2aM-0W; Fri, 15 Dec 2023 14:59:34 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8iz-003cDE-Md; Fri, 15 Dec 2023 14:59:33 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Will Deacon , Mark Rutland Cc: Khuong Dinh , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 18/18] perf: xgene: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:18 +0100 Message-ID: <75dda01b2ad6e17f726830094bd38cb8faab5cbe.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=1815; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=1D3m60kbnUksK/WuWQHSRAl7TZysqOiH8RstEIIaHz8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFu6lmqjVGVsA8r8JJiVanp1hayMpcamEY8We UV3o/A1jOSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbugAKCRCPgPtYfRL+ ToLzB/9+s5OjzXe6GfBT4NB0Anrnt5XQvyWxHodZTkqso/txn8S20jxyKZBgbZEm40n6bByfE9Z Y5jY7X9eMilOhnD61sfIzpIOBqWx6Z/SLI1WMWtd511mmdFDYmIBfDfIaApfpdfHmnZo+rQG6mt UX9FuzjlqJzZzX0MXek0fZNGli/bUd9tryph6bZXAfcH823yujJWnWMTdYsBVOleq76Le5kEMFx 0mhhu7w2A+Hb4nKFzzdjyJEm3zhVdqhXpvu9f2Za2x4j9Ux4pNnzcC9QKwUrc7tlX77YTu4akFy CViUrNEh4DxQWjE4KTbRzMb+iGxv5nVA7/nsi4N1BMPw4JIF 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: 1785356905625448400 X-GMAIL-MSGID: 1785356905625448400 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/xgene_pmu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/perf/xgene_pmu.c b/drivers/perf/xgene_pmu.c index 7ce344248dda..0d49343d704b 100644 --- a/drivers/perf/xgene_pmu.c +++ b/drivers/perf/xgene_pmu.c @@ -1937,7 +1937,7 @@ xgene_pmu_dev_cleanup(struct xgene_pmu *xgene_pmu, struct list_head *pmus) } } -static int xgene_pmu_remove(struct platform_device *pdev) +static void xgene_pmu_remove(struct platform_device *pdev) { struct xgene_pmu *xgene_pmu = dev_get_drvdata(&pdev->dev); @@ -1947,13 +1947,11 @@ static int xgene_pmu_remove(struct platform_device *pdev) xgene_pmu_dev_cleanup(xgene_pmu, &xgene_pmu->mcpmus); cpuhp_state_remove_instance(CPUHP_AP_PERF_ARM_APM_XGENE_ONLINE, &xgene_pmu->node); - - return 0; } static struct platform_driver xgene_pmu_driver = { .probe = xgene_pmu_probe, - .remove = xgene_pmu_remove, + .remove_new = xgene_pmu_remove, .driver = { .name = "xgene-pmu", .of_match_table = xgene_pmu_of_match,