Skip to contentSkip to conversation

Some small cleanup/fixes for SPMI driver

PATCH Applied Mauro Carvalho Chehab 5 participants 11 messages Sep 29, 2020 – Dec 29, 2020

Subsystems (2)
lore
Share & tools
lore
#1 lore raw

PATCH v2 1/2 spmi: get rid of a warning when built with W=1

In reply to Mauro Carvalho Chehab

The SPMI core complaing with this warning when built with W=1:

	drivers/spmi/spmi.c: In function ‘spmi_controller_remove’:
	drivers/spmi/spmi.c:548:6: warning: variable ‘dummy’ set but not used [-Wunused-but-set-variable]
	  548 |  int dummy;
	      |      ^~~~~

As the dummy var isn't needed, remove it.

---
 drivers/spmi/spmi.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/spmi/spmi.c +1 -4
index c16b60f645a4..fd3ff6079b15 100644
@@ -545,13 +545,10 @@ static int spmi_ctrl_remove_device(struct device *dev, void *data)
  */
 void spmi_controller_remove(struct spmi_controller *ctrl)
 {
-	int dummy;
-
 	if (!ctrl)
 		return;
 
-	dummy = device_for_each_child(&ctrl->dev, NULL,
-				      spmi_ctrl_remove_device);
+	device_for_each_child(&ctrl->dev, NULL, spmi_ctrl_remove_device);
 	device_del(&ctrl->dev);
 }
 EXPORT_SYMBOL_GPL(spmi_controller_remove);
Signature · 1 line
2.26.2
#0 lore raw

v2 cover Some small cleanup/fixes for SPMI driver

Hi Stephen,

While double-checking against yesterday's linux-next, I noticed that those two patches weren't merge yet.

As you replied to both with your Reviewed-by:, are you expecting them to be merged via someone's tree, or are you intending to merge them via your tree?

Thanks!
Mauro

Mauro Carvalho Chehab (2):
spmi: get rid of a warning when built with W=1
spmi: fix some coding style issues at the spmi core

 drivers/spmi/spmi.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
Signature · 1 line
2.26.2
#3 lore raw

PATCH v2 2/2 spmi: fix some coding style issues at the spmi core

While preparing to port the HiSilicon 6421v600 SPMI driver, I noticed some coding style issues at the SPMI core.

Address them.

---
 drivers/spmi/spmi.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/spmi/spmi.c +4 -1
index fd3ff6079b15..253340e10dab 100644
@@ -23,6 +23,7 @@ static DEFINE_IDA(ctrl_ida);
 static void spmi_dev_release(struct device *dev)
 {
 	struct spmi_device *sdev = to_spmi_device(dev);
+
 	kfree(sdev);
 }
 
@@ -33,6 +34,7 @@ static const struct device_type spmi_dev_type = {
 static void spmi_ctrl_release(struct device *dev)
 {
 	struct spmi_controller *ctrl = to_spmi_controller(dev);
+
 	ida_simple_remove(&ctrl_ida, ctrl->nr);
 	kfree(ctrl);
 }
@@ -487,7 +489,7 @@ static void of_spmi_register_devices(struct spmi_controller *ctrl)
 			continue;
 
 		sdev->dev.of_node = node;
-		sdev->usid = (u8) reg[0];
+		sdev->usid = (u8)reg[0];
 
 		err = spmi_device_add(sdev);
 		if (err) {
@@ -531,6 +533,7 @@ EXPORT_SYMBOL_GPL(spmi_controller_add);
 static int spmi_ctrl_remove_device(struct device *dev, void *data)
 {
 	struct spmi_device *spmidev = to_spmi_device(dev);
+
 	if (dev->type == &spmi_dev_type)
 		spmi_device_remove(spmidev);
 	return 0;
Signature · 1 line
2.26.2
#4 lore raw

Re: [PATCH v2 2/2] spmi: fix some coding style issues at the spmi core

drivers/spmi/spmi.c static void of_spmi_register_devices(struct spmi_controller *ctrl) · line 492

Quoted 6 lines · Mauro Carvalho Chehab
drivers/spmi/spmi.c +1 -1
@@ -487,7 +489,7 @@ static void of_spmi_register_devices(struct spmi_controller *ctrl)
 			continue;
 
 		sdev->dev.of_node = node;
-		sdev->usid = (u8) reg[0];
+		sdev->usid = (u8)reg[0];

typeof(sdev->usid) is u8.

What is the point of this cast?

Does GCC warn that u32 is being truncated to u8?

Regards.

maintainer
#6 lore raw
In reply to Mauro Carvalho Chehab

Quoting Mauro Carvalho Chehab (2020-09-28 23:22:11)

Quoted 8 lines

Hi Stephen,

While double-checking against yesterday's linux-next, I noticed that those two patches weren't merge yet.

As you replied to both with your Reviewed-by:, are you expecting them to be merged via someone's tree, or are you intending to merge them via your tree?

Per the maintainers file I am a reviewer not a maintainer of SPMI. Usually Greg applies patches here. I can collect patches and send them on up if that helps.

#7 lore raw
Quoted 6 lines · Stephen Boyd

Quoting Mauro Carvalho Chehab (2020-09-28 23:22:11)

Quoted 5 lines

Hi Stephen,

While double-checking against yesterday's linux-next, I noticed that those two patches weren't merge yet.

Quoted 7 lines
Quoted 3 lines

As you replied to both with your Reviewed-by:, are you expecting them to be merged via someone's tree, or are you intending to merge them via your tree?

Per the maintainers file I am a reviewer not a maintainer of SPMI. Usually Greg applies patches here. I can collect patches and send them on up if that helps.

Who is the maintainer? Having a "reviewer only" is confusing to everyone involved, as you might have someone who can review patches, but no one to actually merge them anywhere?

Not a good situation :(

greg k-h

maintainer
#8 lore raw

Quoting Greg Kroah-Hartman (2020-10-03 03:56:53)

Quoted 15 lines · Stephen Boyd
Quoted 6 lines

Quoting Mauro Carvalho Chehab (2020-09-28 23:22:11)

Quoted 5 lines

Hi Stephen,

While double-checking against yesterday's linux-next, I noticed that those two patches weren't merge yet.

Quoted 7 lines
Quoted 3 lines

As you replied to both with your Reviewed-by:, are you expecting them to be merged via someone's tree, or are you intending to merge them via your tree?

Per the maintainers file I am a reviewer not a maintainer of SPMI. Usually Greg applies patches here. I can collect patches and send them on up if that helps.

Quoted 6 lines

Who is the maintainer? Having a "reviewer only" is confusing to everyone involved, as you might have someone who can review patches, but no one to actually merge them anywhere?

Not a good situation :(

Ok. I can spin up an SPMI tree on kernel.org and make this change to the MAINTAINERS file (plus whatever tree path I can make). Do you want me to send you patches in email form as a pull request? I imagine the patch load will be fairly low.

----8<-----

MAINTAINERS +1 -1
index deaafb617361..3e09630455d4 100644
@@ -16338,7 +16338,7 @@ F:	Documentation/networking/device_drivers/ethernet/toshiba/spider_net.rst
 F:	drivers/net/ethernet/toshiba/spider_net*
 
 SPMI SUBSYSTEM
-R:	Stephen Boyd <[email protected]>
+M:	Stephen Boyd <[email protected]>
 L:	[email protected]
 F:	Documentation/devicetree/bindings/spmi/
 F:	drivers/spmi/
#9 lore raw
Quoted 20 lines · Stephen Boyd

Quoting Greg Kroah-Hartman (2020-10-03 03:56:53)

Quoted 19 lines · Stephen Boyd
Quoted 6 lines

Quoting Mauro Carvalho Chehab (2020-09-28 23:22:11)

Quoted 5 lines

Hi Stephen,

While double-checking against yesterday's linux-next, I noticed that those two patches weren't merge yet.

Quoted 7 lines
Quoted 3 lines

As you replied to both with your Reviewed-by:, are you expecting them to be merged via someone's tree, or are you intending to merge them via your tree?

Per the maintainers file I am a reviewer not a maintainer of SPMI. Usually Greg applies patches here. I can collect patches and send them on up if that helps.

Who is the maintainer? Having a "reviewer only" is confusing to everyone involved, as you might have someone who can review patches, but no one to actually merge them anywhere?

Quoted 7 lines
Quoted 2 lines

Not a good situation :(

Ok. I can spin up an SPMI tree on kernel.org and make this change to the MAINTAINERS file (plus whatever tree path I can make). Do you want me to send you patches in email form as a pull request? I imagine the patch load will be fairly low.

email form is great, I can handle those easily. IF you really want to create a git tree, I can pull from that too, but for low-volume stuff, it's usually not worth it.

thanks,

greg k-h

maintainer Applied
#2 lore raw

Re: [PATCH v2 1/2] spmi: get rid of a warning when built with W=1

In reply to Mauro Carvalho Chehab

Quoting Mauro Carvalho Chehab (2020-09-28 23:22:12)

Quoted 7 lines

The SPMI core complaing with this warning when built with W=1:

drivers/spmi/spmi.c: In function ‘spmi_controller_remove’:
drivers/spmi/spmi.c:548:6: warning: variable ‘dummy’ set but not used [-Wunused-but-set-variable]
548 | int dummy;
| ^~~~~

Quoted 5 lines

As the dummy var isn't needed, remove it.

---

Applied. Thanks!

#10 lore raw
In reply to Mauro Carvalho Chehab
This series was applied to qcom/linux.git (refs/heads/for-next):

Hello:

This series was applied to qcom/linux.git (refs/heads/for-next):

Quoted 10 lines · On Tue, 29 Sep 2020 08:22:11 +0200 you wrote:

Hi Stephen,

While double-checking against yesterday's linux-next, I noticed that those two patches weren't merge yet.

As you replied to both with your Reviewed-by:, are you expecting them to be merged via someone's tree, or are you intending to merge them via your tree?

[...]

Here is the summary with links:
- [v2,1/2] spmi: get rid of a warning when built with W=1

    https://git.kernel.org/qcom/c/b1f0aeecd25a
  - [v2,2/2] spmi: fix some coding style issues at the spmi core
    https://git.kernel.org/qcom/c/0be0a733c9cd

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html