lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200729151208.27737-4-lukasz.luba@arm.com>
Date:   Wed, 29 Jul 2020 16:12:07 +0100
From:   Lukasz Luba <lukasz.luba@....com>
To:     linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-pm@...r.kernel.org
Cc:     sudeep.holla@....com, cristian.marussi@....com,
        viresh.kumar@...aro.org, lukasz.luba@....com, rjw@...ysocki.net
Subject: [PATCH 3/4] cpufreq: scmi: Move scmi_cpufreq_driver structure to the top

Move the scmi_cpufreq_driver to top of the file in order to prepare for
upcoming changes, which will extend it based on discoverable
functionality.

Signed-off-by: Lukasz Luba <lukasz.luba@....com>
---
 drivers/cpufreq/scmi-cpufreq.c | 36 +++++++++++++++++++++-------------
 1 file changed, 22 insertions(+), 14 deletions(-)

diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c
index fb42e3390377..fe95350eb844 100644
--- a/drivers/cpufreq/scmi-cpufreq.c
+++ b/drivers/cpufreq/scmi-cpufreq.c
@@ -24,6 +24,28 @@ struct scmi_data {
 	struct device *cpu_dev;
 };
 
+static unsigned int scmi_cpufreq_get_rate(unsigned int cpu);
+static int scmi_cpufreq_set_target(struct cpufreq_policy *policy,
+				   unsigned int index);
+static unsigned int scmi_cpufreq_fast_switch(struct cpufreq_policy *policy,
+					     unsigned int target_freq);
+static int scmi_cpufreq_init(struct cpufreq_policy *policy);
+static int scmi_cpufreq_exit(struct cpufreq_policy *policy);
+
+static struct cpufreq_driver scmi_cpufreq_driver = {
+	.name	= "scmi",
+	.flags	= CPUFREQ_STICKY | CPUFREQ_HAVE_GOVERNOR_PER_POLICY |
+		  CPUFREQ_NEED_INITIAL_FREQ_CHECK |
+		  CPUFREQ_IS_COOLING_DEV,
+	.verify	= cpufreq_generic_frequency_table_verify,
+	.attr	= cpufreq_generic_attr,
+	.target_index	= scmi_cpufreq_set_target,
+	.fast_switch	= scmi_cpufreq_fast_switch,
+	.get	= scmi_cpufreq_get_rate,
+	.init	= scmi_cpufreq_init,
+	.exit	= scmi_cpufreq_exit,
+};
+
 static const struct scmi_handle *handle;
 
 static unsigned int scmi_cpufreq_get_rate(unsigned int cpu)
@@ -219,20 +241,6 @@ static int scmi_cpufreq_exit(struct cpufreq_policy *policy)
 	return 0;
 }
 
-static struct cpufreq_driver scmi_cpufreq_driver = {
-	.name	= "scmi",
-	.flags	= CPUFREQ_STICKY | CPUFREQ_HAVE_GOVERNOR_PER_POLICY |
-		  CPUFREQ_NEED_INITIAL_FREQ_CHECK |
-		  CPUFREQ_IS_COOLING_DEV,
-	.verify	= cpufreq_generic_frequency_table_verify,
-	.attr	= cpufreq_generic_attr,
-	.target_index	= scmi_cpufreq_set_target,
-	.fast_switch	= scmi_cpufreq_fast_switch,
-	.get	= scmi_cpufreq_get_rate,
-	.init	= scmi_cpufreq_init,
-	.exit	= scmi_cpufreq_exit,
-};
-
 static int scmi_cpufreq_probe(struct scmi_device *sdev)
 {
 	int ret;
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ