linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Viresh Kumar <vireshk@kernel.org>, Nishanth Menon <nm@ti.com>,
	Stephen Boyd <sboyd@kernel.org>
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
	linux-pm@vger.kernel.org,
	Vincent Guittot <vincent.guittot@linaro.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Dmitry Osipenko <dmitry.osipenko@collabora.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH V2 01/13] OPP: Use consistent names for OPP table instances
Date: Tue,  5 Jul 2022 12:30:04 +0530	[thread overview]
Message-ID: <17bd927869b3a4d34c21aadad3536ccdcdf1078f.1657003420.git.viresh.kumar@linaro.org> (raw)
In-Reply-To: <cover.1657003420.git.viresh.kumar@linaro.org>

The OPP table is called "opp_table" at most of the places and "table" at
few. Make all of them follow the same naming convention, "opp_table".

Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/opp/core.c |  7 ++++---
 drivers/opp/cpu.c  | 12 ++++++------
 drivers/opp/of.c   | 12 ++++++------
 3 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/drivers/opp/core.c b/drivers/opp/core.c
index 5ad43dbfd87f..e836d3043d22 100644
--- a/drivers/opp/core.c
+++ b/drivers/opp/core.c
@@ -1585,15 +1585,16 @@ void dev_pm_opp_remove_all_dynamic(struct device *dev)
 }
 EXPORT_SYMBOL_GPL(dev_pm_opp_remove_all_dynamic);
 
-struct dev_pm_opp *_opp_allocate(struct opp_table *table)
+struct dev_pm_opp *_opp_allocate(struct opp_table *opp_table)
 {
 	struct dev_pm_opp *opp;
 	int supply_count, supply_size, icc_size;
 
 	/* Allocate space for at least one supply */
-	supply_count = table->regulator_count > 0 ? table->regulator_count : 1;
+	supply_count = opp_table->regulator_count > 0 ?
+			opp_table->regulator_count : 1;
 	supply_size = sizeof(*opp->supplies) * supply_count;
-	icc_size = sizeof(*opp->bandwidth) * table->path_count;
+	icc_size = sizeof(*opp->bandwidth) * opp_table->path_count;
 
 	/* allocate new OPP node and supplies structures */
 	opp = kzalloc(sizeof(*opp) + supply_size + icc_size, GFP_KERNEL);
diff --git a/drivers/opp/cpu.c b/drivers/opp/cpu.c
index 5004335cf0de..3c3506021501 100644
--- a/drivers/opp/cpu.c
+++ b/drivers/opp/cpu.c
@@ -41,7 +41,7 @@
  * the table if any of the mentioned functions have been invoked in the interim.
  */
 int dev_pm_opp_init_cpufreq_table(struct device *dev,
-				  struct cpufreq_frequency_table **table)
+				  struct cpufreq_frequency_table **opp_table)
 {
 	struct dev_pm_opp *opp;
 	struct cpufreq_frequency_table *freq_table = NULL;
@@ -76,7 +76,7 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev,
 	freq_table[i].driver_data = i;
 	freq_table[i].frequency = CPUFREQ_TABLE_END;
 
-	*table = &freq_table[0];
+	*opp_table = &freq_table[0];
 
 out:
 	if (ret)
@@ -94,13 +94,13 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_init_cpufreq_table);
  * Free up the table allocated by dev_pm_opp_init_cpufreq_table
  */
 void dev_pm_opp_free_cpufreq_table(struct device *dev,
-				   struct cpufreq_frequency_table **table)
+				   struct cpufreq_frequency_table **opp_table)
 {
-	if (!table)
+	if (!opp_table)
 		return;
 
-	kfree(*table);
-	*table = NULL;
+	kfree(*opp_table);
+	*opp_table = NULL;
 }
 EXPORT_SYMBOL_GPL(dev_pm_opp_free_cpufreq_table);
 #endif	/* CONFIG_CPU_FREQ */
diff --git a/drivers/opp/of.c b/drivers/opp/of.c
index 30394929d700..e07fc31de416 100644
--- a/drivers/opp/of.c
+++ b/drivers/opp/of.c
@@ -767,7 +767,7 @@ void dev_pm_opp_of_remove_table(struct device *dev)
 }
 EXPORT_SYMBOL_GPL(dev_pm_opp_of_remove_table);
 
-static int _read_bw(struct dev_pm_opp *new_opp, struct opp_table *table,
+static int _read_bw(struct dev_pm_opp *new_opp, struct opp_table *opp_table,
 		    struct device_node *np, bool peak)
 {
 	const char *name = peak ? "opp-peak-kBps" : "opp-avg-kBps";
@@ -780,9 +780,9 @@ static int _read_bw(struct dev_pm_opp *new_opp, struct opp_table *table,
 		return -ENODEV;
 
 	count = prop->length / sizeof(u32);
-	if (table->path_count != count) {
+	if (opp_table->path_count != count) {
 		pr_err("%s: Mismatch between %s and paths (%d %d)\n",
-				__func__, name, count, table->path_count);
+				__func__, name, count, opp_table->path_count);
 		return -EINVAL;
 	}
 
@@ -808,7 +808,7 @@ static int _read_bw(struct dev_pm_opp *new_opp, struct opp_table *table,
 	return ret;
 }
 
-static int _read_opp_key(struct dev_pm_opp *new_opp, struct opp_table *table,
+static int _read_opp_key(struct dev_pm_opp *new_opp, struct opp_table *opp_table,
 			 struct device_node *np, bool *rate_not_available)
 {
 	bool found = false;
@@ -832,10 +832,10 @@ static int _read_opp_key(struct dev_pm_opp *new_opp, struct opp_table *table,
 	 * opp-peak-kBps = <path1_value path2_value>;
 	 * opp-avg-kBps = <path1_value path2_value>;
 	 */
-	ret = _read_bw(new_opp, table, np, true);
+	ret = _read_bw(new_opp, opp_table, np, true);
 	if (!ret) {
 		found = true;
-		ret = _read_bw(new_opp, table, np, false);
+		ret = _read_bw(new_opp, opp_table, np, false);
 	}
 
 	/* The properties were found but we failed to parse them */
-- 
2.31.1.272.g89b43f80a514


  reply	other threads:[~2022-07-05  7:00 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-05  7:00 [PATCH V2 00/13] OPP: Add support for multiple clocks* Viresh Kumar
2022-07-05  7:00 ` Viresh Kumar [this message]
2022-07-05  7:00 ` [PATCH V2 02/13] OPP: Remove rate_not_available parameter to _opp_add() Viresh Kumar
2022-07-05  7:00 ` [PATCH V2 03/13] OPP: Reuse _opp_compare_key() in _opp_add_static_v2() Viresh Kumar
2022-07-05  7:00 ` [PATCH V2 04/13] OPP: Make dev_pm_opp_set_opp() independent of frequency Viresh Kumar
2022-07-05  7:00 ` [PATCH V2 05/13] dt-bindings: opp: accept array of frequencies Viresh Kumar
2022-07-05  7:00 ` [PATCH V2 06/13] OPP: Allow multiple clocks for a device Viresh Kumar
2022-07-05  7:00 ` [PATCH V2 07/13] OPP: Compare bandwidths for all paths in _opp_compare_key() Viresh Kumar
2022-07-05  7:00 ` [PATCH V2 08/13] OPP: Add key specific assert() method to key finding helpers Viresh Kumar
2022-07-05  7:00 ` [PATCH V2 09/13] OPP: Assert clk_count == 1 for single clk helpers Viresh Kumar
2022-07-05 17:21   ` Krzysztof Kozlowski
2022-07-06  6:39     ` Viresh Kumar
2022-07-05  7:00 ` [PATCH V2 10/13] OPP: Provide a simple implementation to configure multiple clocks Viresh Kumar
2022-07-05  7:00 ` [PATCH V2 11/13] OPP: Allow config_clks helper for single clk case Viresh Kumar
2022-07-05  7:00 ` [PATCH V2 12/13] PM / devfreq: tegra30: Register config_clks helper Viresh Kumar
2022-07-05  7:00 ` [PATCH V2 13/13] OPP: Remove dev{m}_pm_opp_of_add_table_noclk() Viresh Kumar
2022-07-07 19:43 ` [PATCH V2 00/13] OPP: Add support for multiple clocks* Dmitry Osipenko
2022-07-08  7:19   ` Viresh Kumar
2022-07-08  7:26     ` Dmitry Osipenko
2022-07-08  7:30       ` Dmitry Osipenko
2022-07-08  8:13         ` Viresh Kumar
2022-07-08  8:12       ` Viresh Kumar
2022-07-08 16:15         ` Dmitry Osipenko
2022-07-11 16:40 ` Johan Hovold
2022-07-12  7:52   ` Viresh Kumar
2022-07-12 12:25     ` Manivannan Sadhasivam
2022-07-12 14:29     ` Johan Hovold
2022-07-12 15:10       ` Viresh Kumar
2022-07-12 15:55         ` Johan Hovold
2022-07-13  6:55           ` Viresh Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=17bd927869b3a4d34c21aadad3536ccdcdf1078f.1657003420.git.viresh.kumar@linaro.org \
    --to=viresh.kumar@linaro.org \
    --cc=dmitry.osipenko@collabora.com \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=rafael@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vireshk@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).