Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp2076255lqe; Tue, 9 Apr 2024 08:55:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV26pDvQg3yWMImBkHTNWF6cX0GZOqY/V2aNP8Zi+3k2y23PoP41AsncEa9batkACldbhxDRgXNO1Wq1GrZNleXrSFKT5fKI49amakVRw== X-Google-Smtp-Source: AGHT+IHpYzvyYGMzcLeUgJVu3mfQECoCtHdJYvv2MQmsrT+e7w/ehCeVav8rHqn3PcFxUtksvA5s X-Received: by 2002:a17:902:ecd0:b0:1de:f29a:36ac with SMTP id a16-20020a170902ecd000b001def29a36acmr118695plh.68.1712678110935; Tue, 09 Apr 2024 08:55:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712678110; cv=pass; d=google.com; s=arc-20160816; b=pujTY8EVC/it4IyzKqrXhIid76zSWcE8G3VoZ5RBarP8DlTfi5o0wGHNTzEXP/iey0 v2I8ZVjvGmKr4GMlJAwNwSy/mB2VRzn04hLYWFSTPybgUgWBDHqKjsT7ywzGssbDjIxC hM7JeUlSia54r9Fvl//8qtKnwZVYP19AsJc6r5i5711Ll/AS8NXvMysVKOf+RE5TsmV+ 5ccYRzCTeU7HkdD3Qp3rdc9+LFb5XSB+aVyKR0ZrbL4cCMREyUfC3CY/sSmrX0D05cX6 4ZS81kNLlO7N1gLiWTp4gNZ8LPvC4MTfozGRPj2ykoDkHEGV87RBZ4mEqKi+3V8UKq8c /lCQ== ARC-Message-Signature: i=2; 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:message-id:date:subject:cc:to :from:dkim-signature; bh=KMeVx9urEbgIiWLKZLj3qrvOfX+TjMtH4pk5sw16JKM=; fh=sa0FFfLxOH89MPsUBOejZo1FONCLFfBgkzb+87szNcA=; b=NWQxBsWc8ArBfNsMhxmc2GHA9ZAkanFvZCgXtIC7aGUQ5D8voHXYYzFHRGh6DpG0CL mHjp6cqnkGE46Dv05vvIdN/HGJV+gqossqAtxTeBMH8pwxCnC637nb+tlsVm4pi21hnJ jekxwEJZMudNSeK8qIyrpVVpO8ObiO7/5yulGRT6xdSjw/gNO7cvgHXp2SfkzIGGSi1w RIMtLRVxF4qsUjQTZ2P2Bnd3PlmICr9NU5yllbF1CzEyZsCG7CpKBpIT4QhAAmKwT9Lj 9YdMWeHeHyZ+AjB6o/w7UeTqp6i40MK6rWT2VRoKk4SeUsoSzX0QnV152PX2jDPMdgAP UqTA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=cZ48z1uN; arc=pass (i=1 spf=pass spfdomain=163.com dkim=pass dkdomain=163.com dmarc=pass fromdomain=163.com); spf=pass (google.com: domain of linux-kernel+bounces-137233-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137233-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id q6-20020a170902eb8600b001e24253c115si8936425plg.335.2024.04.09.08.55.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 08:55:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-137233-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=cZ48z1uN; arc=pass (i=1 spf=pass spfdomain=163.com dkim=pass dkdomain=163.com dmarc=pass fromdomain=163.com); spf=pass (google.com: domain of linux-kernel+bounces-137233-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137233-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com 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 3F80428F736 for ; Tue, 9 Apr 2024 15:35:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6E83E13D608; Tue, 9 Apr 2024 15:30:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="cZ48z1uN" Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.5]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1FADA1350EA; Tue, 9 Apr 2024 15:30:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.5 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712676634; cv=none; b=H7EHo2lCKV4W7XPhJ0cA9Kykj8MRFckyNIVEXwRRBNzyY17VWGoSV0kMlzDm5OG9F/MNjkLmd1LRY2NfgWZysTpL5wWffbEfuZH9I3tlAt1K9puWpDhP6/4l72QInLYK5CTCm/n3Invyii19BQKA7hnFETuAiuj56eu1D02hYZQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712676634; c=relaxed/simple; bh=bO8+JxJJ+jOpvLRPOxTz7o4jgTkbhw8KAAg+RhqSWHY=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=TEMAYdu7kUJ+GB/OI/QxfaWeZ0ozVieVj/zNZaHPVBahwuFh3HwZiXZHYVDjV+EAPkNRtZaYh6FzVyoBsHLkm4nq17kE/yAbkmjlpw2V0Q/MVDcZ8RsbACXkQ1SuAuvyhRKOkXJYL6p9zCHBsqz1qXbPDgLU8doihSrkX3IIV38= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=cZ48z1uN; arc=none smtp.client-ip=117.135.210.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=KMeVx 9urEbgIiWLKZLj3qrvOfX+TjMtH4pk5sw16JKM=; b=cZ48z1uNDiCg9DxPE3kL4 nAJoCXYuZAea0++lEQ2WbjIYPNFFzZ+zvCYOah/F9/OWfuexyInpBoKzYilKwxWE t9eje8qx/snD8MAVlkl+YAUL0ukfCb5LfYWnz/gh+BaVbdpcDqYtcV+UBVAU2sIR pFbV3Gv5VRq8K0OjX5LcKI= Received: from localhost.localdomain (unknown [101.86.11.106]) by gzga-smtp-mta-g1-4 (Coremail) with SMTP id _____wD3vzSsXhVmuJxkAg--.27367S4; Tue, 09 Apr 2024 23:29:11 +0800 (CST) From: Lizhe To: rafael@kernel.org, viresh.kumar@linaro.org, marcan@marcan.st, sven@svenpeter.dev, alyssa@rosenzweig.io, mmayer@broadcom.com, bcm-kernel-feedback-list@broadcom.com Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Lizhe Subject: [PATCH] cpufreq: Convert to exit callback returning void Date: Tue, 9 Apr 2024 08:28:37 -0700 Message-Id: <20240409152837.5792-1-sensor1010@163.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:_____wD3vzSsXhVmuJxkAg--.27367S4 X-Coremail-Antispam: 1Uf129KBjvJXoW3JF4UXFy3Xw4fZFyDXrW7XFb_yoWxJw43pF W5urWjyr48JFWDt3srCw4Du3Wak3Z2y3yUG345GasYvw17JF1Yg3WDGryUCFZ5urWkGF4a yrn5Xay7GF48JrUanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pimhF7UUUUU= X-CM-SenderInfo: 5vhq20jurqiii6rwjhhfrp/1tbiKAq7q2XAk0Zm+QAAsd For the exit() callback function returning an int type value, this leads many driver authors mistakenly believing that error handling can be performed by returning an error code. However, the returned value is ignored, and to improve this situation. it is proposed to modify the return type of the exit() callback function to void. Signed-off-by: Lizhe --- drivers/cpufreq/acpi-cpufreq.c | 4 +--- drivers/cpufreq/apple-soc-cpufreq.c | 4 +--- drivers/cpufreq/bmips-cpufreq.c | 4 +--- drivers/cpufreq/cppc_cpufreq.c | 3 +-- drivers/cpufreq/cpufreq-dt.c | 3 +-- drivers/cpufreq/cpufreq-nforce2.c | 6 ------ drivers/cpufreq/e_powersaver.c | 3 +-- include/linux/cpufreq.h | 2 +- 8 files changed, 7 insertions(+), 22 deletions(-) diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c index 37f1cdf46d29..33f18140e9a4 100644 --- a/drivers/cpufreq/acpi-cpufreq.c +++ b/drivers/cpufreq/acpi-cpufreq.c @@ -906,7 +906,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) return result; } -static int acpi_cpufreq_cpu_exit(struct cpufreq_policy *policy) +static void acpi_cpufreq_cpu_exit(struct cpufreq_policy *policy) { struct acpi_cpufreq_data *data = policy->driver_data; @@ -919,8 +919,6 @@ static int acpi_cpufreq_cpu_exit(struct cpufreq_policy *policy) free_cpumask_var(data->freqdomain_cpus); kfree(policy->freq_table); kfree(data); - - return 0; } static int acpi_cpufreq_resume(struct cpufreq_policy *policy) diff --git a/drivers/cpufreq/apple-soc-cpufreq.c b/drivers/cpufreq/apple-soc-cpufreq.c index 021f423705e1..af34c22fa273 100644 --- a/drivers/cpufreq/apple-soc-cpufreq.c +++ b/drivers/cpufreq/apple-soc-cpufreq.c @@ -305,7 +305,7 @@ static int apple_soc_cpufreq_init(struct cpufreq_policy *policy) return ret; } -static int apple_soc_cpufreq_exit(struct cpufreq_policy *policy) +static void apple_soc_cpufreq_exit(struct cpufreq_policy *policy) { struct apple_cpu_priv *priv = policy->driver_data; @@ -313,8 +313,6 @@ static int apple_soc_cpufreq_exit(struct cpufreq_policy *policy) dev_pm_opp_remove_all_dynamic(priv->cpu_dev); iounmap(priv->reg_base); kfree(priv); - - return 0; } static struct cpufreq_driver apple_soc_cpufreq_driver = { diff --git a/drivers/cpufreq/bmips-cpufreq.c b/drivers/cpufreq/bmips-cpufreq.c index 39221a9a187a..17a4c174553d 100644 --- a/drivers/cpufreq/bmips-cpufreq.c +++ b/drivers/cpufreq/bmips-cpufreq.c @@ -121,11 +121,9 @@ static int bmips_cpufreq_target_index(struct cpufreq_policy *policy, return 0; } -static int bmips_cpufreq_exit(struct cpufreq_policy *policy) +static void bmips_cpufreq_exit(struct cpufreq_policy *policy) { kfree(policy->freq_table); - - return 0; } static int bmips_cpufreq_init(struct cpufreq_policy *policy) diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c index 64420d9cfd1e..dccb9c1f087d 100644 --- a/drivers/cpufreq/cppc_cpufreq.c +++ b/drivers/cpufreq/cppc_cpufreq.c @@ -688,7 +688,7 @@ static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy) return ret; } -static int cppc_cpufreq_cpu_exit(struct cpufreq_policy *policy) +static void cppc_cpufreq_cpu_exit(struct cpufreq_policy *policy) { struct cppc_cpudata *cpu_data = policy->driver_data; struct cppc_perf_caps *caps = &cpu_data->perf_caps; @@ -705,7 +705,6 @@ static int cppc_cpufreq_cpu_exit(struct cpufreq_policy *policy) caps->lowest_perf, cpu, ret); cppc_cpufreq_put_cpu_data(policy); - return 0; } static inline u64 get_delta(u64 t1, u64 t0) diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c index 2d83bbc65dd0..eaf02579ea74 100644 --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c @@ -166,10 +166,9 @@ static int cpufreq_offline(struct cpufreq_policy *policy) return 0; } -static int cpufreq_exit(struct cpufreq_policy *policy) +static void cpufreq_exit(struct cpufreq_policy *policy) { clk_put(policy->clk); - return 0; } static struct cpufreq_driver dt_cpufreq_driver = { diff --git a/drivers/cpufreq/cpufreq-nforce2.c b/drivers/cpufreq/cpufreq-nforce2.c index f7a7bcf6f52e..fedad1081973 100644 --- a/drivers/cpufreq/cpufreq-nforce2.c +++ b/drivers/cpufreq/cpufreq-nforce2.c @@ -359,11 +359,6 @@ static int nforce2_cpu_init(struct cpufreq_policy *policy) return 0; } -static int nforce2_cpu_exit(struct cpufreq_policy *policy) -{ - return 0; -} - static struct cpufreq_driver nforce2_driver = { .name = "nforce2", .flags = CPUFREQ_NO_AUTO_DYNAMIC_SWITCHING, @@ -371,7 +366,6 @@ static struct cpufreq_driver nforce2_driver = { .target = nforce2_target, .get = nforce2_get, .init = nforce2_cpu_init, - .exit = nforce2_cpu_exit, }; #ifdef MODULE diff --git a/drivers/cpufreq/e_powersaver.c b/drivers/cpufreq/e_powersaver.c index ab93bce8ae77..6e958b09e1b5 100644 --- a/drivers/cpufreq/e_powersaver.c +++ b/drivers/cpufreq/e_powersaver.c @@ -360,14 +360,13 @@ static int eps_cpu_init(struct cpufreq_policy *policy) return 0; } -static int eps_cpu_exit(struct cpufreq_policy *policy) +static void eps_cpu_exit(struct cpufreq_policy *policy) { unsigned int cpu = policy->cpu; /* Bye */ kfree(eps_cpu[cpu]); eps_cpu[cpu] = NULL; - return 0; } static struct cpufreq_driver eps_driver = { diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 9956afb9acc2..ffb8d85d73ee 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -386,7 +386,7 @@ struct cpufreq_driver { int (*online)(struct cpufreq_policy *policy); int (*offline)(struct cpufreq_policy *policy); - int (*exit)(struct cpufreq_policy *policy); + void (*exit)(struct cpufreq_policy *policy); int (*suspend)(struct cpufreq_policy *policy); int (*resume)(struct cpufreq_policy *policy); -- 2.25.1