Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp2878261rwp; Fri, 14 Jul 2023 12:54:11 -0700 (PDT) X-Google-Smtp-Source: APBJJlEL09u33+IdZP4aqF3Sv/OL72PMmey3SiOU1HP/rLQbCiZUhQBh1W5kNBnSUExr2AH9jtrh X-Received: by 2002:a05:6a00:1951:b0:668:731b:517e with SMTP id s17-20020a056a00195100b00668731b517emr6531174pfk.24.1689364451120; Fri, 14 Jul 2023 12:54:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689364451; cv=none; d=google.com; s=arc-20160816; b=FO6Wd5fXk1fXd+2uz/wuBZXsY6F/Ukmj8+u2mj099XOdiTCxufkYXsbgixYwN8Dhbh V/Q+yuWrkkJ8RTAHyAWeoq0MO05Q+d9n2njbeyYCaMJAdAdy1Ga4gEaGATIB2NQvugYS Zfd0T0bi/w0VxN4QD1I2vULoPkjmbhkCRWIY05y2LgHv5EMc1+9DxKMIF0/2aiQTHR0a kV41GpU+sJwfB2+r6Iz8bNlq+aWdPApuEFV0GtMPOuS+pxkCagtseTMiYZV8jNE4ewaw f/vtE916FCjZmFqliuEVAErrixKP+v7spou1RJ8PiqipAMCdqv8A+2/EGJDC5aymOkMz ZJxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=dSnEv84P2dYFxZOUE1ed/sEY6qPha6SIYgth+yVO3DU=; fh=5y6SqRf21sR/Z/SR2LcYwXcQZ7yZ2un+2TErhO4bnnY=; b=jWSmItr9Uxpcp7wKv+ffqtgz30wr6QHrT9/Ozex+Msk3M0fAco/2guP5ItyZGDwUg6 ZEPVITQqySqXAe2QoWKHXClgzHB6euSQPgO4ZLCBLH0UA8cJ4FZqVJrHZ+flu8kWYm0Y j+SGrhrHpHAV5XLyUTBtvIAKRTjufV8XSz7+31OUuY4Z2KH6OnSU889ZW+LcLehXLBMf fXGO1fsZl0IJu+ez9qq2e37U4sdwhKRub5MxA6bEqzLGizotjhuz/hqLVdIZ8NrEwn/W LqBzt+XKoSpBKDW6BC2eweXGqplRRJVXFa6dXwEXN5FKxLgebxUWgbg1FVlQrFBwaFZJ cDlw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j187-20020a638bc4000000b0055c3e870ad5si1858254pge.269.2023.07.14.12.53.55; Fri, 14 Jul 2023 12:54:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236511AbjGNS5f convert rfc822-to-8bit (ORCPT + 99 others); Fri, 14 Jul 2023 14:57:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236441AbjGNS5e (ORCPT ); Fri, 14 Jul 2023 14:57:34 -0400 Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62C7135AB; Fri, 14 Jul 2023 11:57:28 -0700 (PDT) Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-98e2865e2f2so59477166b.0; Fri, 14 Jul 2023 11:57:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689361047; x=1689965847; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AWKbxFe0GUaCCcLpCxfwdswLDeX3/EHTR7UY3EDzKW8=; b=kv1X34RUWIgaHBaxgZjiEcT91r6GWrIL1wI1cuSsjDfmujWkCgCzXuu8FW0cig6/Dm KgE5b0q1uHTZizv/3g5QWjsSdZFjistmdYijM2g9G7Zt5WQ7MwI+CQfLA4u38Vm8R/g9 sopbz5zJPve7ZTY505eNUE16kuNbHz8qUuL63BAPIKovziko2Cgi+Eln+hyFmPPT+bq+ iRwsnfjEmG2sCtiiAYFJO0Fo7jOyAa6s9kH2QgVifp6lyu560K594PjqcrRkWB+WF1YM UxqH3G2xXF5Ws3KyzOdkZbyVPPhZIGzH1jrZXWYaxeIAbPmnso8jHK/uHFAkypJdZk2Q rYpQ== X-Gm-Message-State: ABy/qLbt1c96i1rOcPZDkoP/Jp578VlwnzJD8GkOREGxC1wrn1ZsGVJd z9WaVF1tMLA1Ywvpi10wJ6p5zQ13K7Xrvzogavs= X-Received: by 2002:a17:906:739c:b0:988:815c:ba09 with SMTP id f28-20020a170906739c00b00988815cba09mr30755ejl.4.1689361046779; Fri, 14 Jul 2023 11:57:26 -0700 (PDT) MIME-Version: 1.0 References: <20230712093322.37322-1-frank.li@vivo.com> <20230712093322.37322-17-frank.li@vivo.com> In-Reply-To: <20230712093322.37322-17-frank.li@vivo.com> From: "Rafael J. Wysocki" Date: Fri, 14 Jul 2023 20:57:15 +0200 Message-ID: Subject: Re: [PATCH 17/19] cpufreq: acpi: Convert to platform remove callback returning void To: Yangtao Li Cc: "Rafael J. Wysocki" , Viresh Kumar , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 12, 2023 at 11:34 AM Yangtao Li wrote: > > 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 (mostly) ignored > 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. > > Trivially convert this driver from always returning zero in the remove > callback to the void returning variant. > > Cc: Uwe Kleine-König > Signed-off-by: Yangtao Li Acked-by: Rafael J. Wysocki or please let me know if you want me to pick this up. Thanks! > --- > drivers/cpufreq/acpi-cpufreq.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c > index b2f05d27167e..37f1cdf46d29 100644 > --- a/drivers/cpufreq/acpi-cpufreq.c > +++ b/drivers/cpufreq/acpi-cpufreq.c > @@ -1011,22 +1011,20 @@ static int __init acpi_cpufreq_probe(struct platform_device *pdev) > return ret; > } > > -static int acpi_cpufreq_remove(struct platform_device *pdev) > +static void acpi_cpufreq_remove(struct platform_device *pdev) > { > pr_debug("%s\n", __func__); > > cpufreq_unregister_driver(&acpi_cpufreq_driver); > > free_acpi_perf_data(); > - > - return 0; > } > > static struct platform_driver acpi_cpufreq_platdrv = { > .driver = { > .name = "acpi-cpufreq", > }, > - .remove = acpi_cpufreq_remove, > + .remove_new = acpi_cpufreq_remove, > }; > > static int __init acpi_cpufreq_init(void) > -- > 2.39.0 >