linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] regulator: raa215300: Change the scope of the variables {clkin_name, xin_name}
@ 2023-06-29 10:42 Biju Das
  2023-07-12 10:35 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Biju Das @ 2023-06-29 10:42 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown
  Cc: Biju Das, Geert Uytterhoeven, Prabhakar Mahadev Lad,
	linux-renesas-soc, kernel test robot

Change the scope of the variables {clkin_name, xin_name} from global->local
to fix the below warning.

drivers/regulator/raa215300.c:42:12: sparse: sparse: symbol 'xin_name' was
not declared. Should it be static?

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202306250552.Fan9WTiN-lkp@intel.com/
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v1->v2:
 * Invert the second if-condition and exchange the two branches,
   to make the code flow easier to follow for the casual reader.
 * Pre-initialized clk_name to NULL and clk_name is set only when
   ret > 0.
 * RTC driver is instantiated only when there is valid clock. So replaced the
   if conditional check ret->clk_name.
 * Added Rb tag from Geert.
---
 drivers/regulator/raa215300.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/regulator/raa215300.c b/drivers/regulator/raa215300.c
index 24a1c89f5dbc..8e1a4c86b978 100644
--- a/drivers/regulator/raa215300.c
+++ b/drivers/regulator/raa215300.c
@@ -38,8 +38,6 @@
 #define RAA215300_REG_BLOCK_EN_RTC_EN	BIT(6)
 #define RAA215300_RTC_DEFAULT_ADDR	0x6f
 
-const char *clkin_name = "clkin";
-const char *xin_name = "xin";
 static struct clk *clk;
 
 static const struct regmap_config raa215300_regmap_config = {
@@ -71,8 +69,10 @@ static int raa215300_clk_present(struct i2c_client *client, const char *name)
 static int raa215300_i2c_probe(struct i2c_client *client)
 {
 	struct device *dev = &client->dev;
-	const char *clk_name = xin_name;
+	const char *clkin_name = "clkin";
 	unsigned int pmic_version, val;
+	const char *xin_name = "xin";
+	const char *clk_name = NULL;
 	struct regmap *regmap;
 	int ret;
 
@@ -114,15 +114,17 @@ static int raa215300_i2c_probe(struct i2c_client *client)
 	ret = raa215300_clk_present(client, xin_name);
 	if (ret < 0) {
 		return ret;
-	} else if (!ret) {
+	} else if (ret) {
+		clk_name = xin_name;
+	} else {
 		ret = raa215300_clk_present(client, clkin_name);
 		if (ret < 0)
 			return ret;
-
-		clk_name = clkin_name;
+		if (ret)
+			clk_name = clkin_name;
 	}
 
-	if (ret) {
+	if (clk_name) {
 		char *name = pmic_version >= 0x12 ? "isl1208" : "raa215300_a0";
 		struct device_node *np = client->dev.of_node;
 		u32 addr = RAA215300_RTC_DEFAULT_ADDR;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] regulator: raa215300: Change the scope of the variables {clkin_name, xin_name}
  2023-06-29 10:42 [PATCH v2] regulator: raa215300: Change the scope of the variables {clkin_name, xin_name} Biju Das
@ 2023-07-12 10:35 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2023-07-12 10:35 UTC (permalink / raw)
  To: Liam Girdwood, Biju Das
  Cc: Geert Uytterhoeven, Prabhakar Mahadev Lad, linux-renesas-soc,
	kernel test robot

On Thu, 29 Jun 2023 11:42:00 +0100, Biju Das wrote:
> Change the scope of the variables {clkin_name, xin_name} from global->local
> to fix the below warning.
> 
> drivers/regulator/raa215300.c:42:12: sparse: sparse: symbol 'xin_name' was
> not declared. Should it be static?
> 
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next

Thanks!

[1/1] regulator: raa215300: Change the scope of the variables {clkin_name, xin_name}
      commit: 42a95739c5bc4d7a6e93a43117e9283598ba2287

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-12 10:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-29 10:42 [PATCH v2] regulator: raa215300: Change the scope of the variables {clkin_name, xin_name} Biju Das
2023-07-12 10:35 ` Mark Brown

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).