Skip to contentSkip to conversation

watchdog: imx_sc_wdt: Remove unused includes

PATCH NAK Anson Huang 2 participants 9 messages Feb 21, 2020 – Feb 24, 2020

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

PATCH 1/3 watchdog: imx_sc_wdt: Remove unused includes

There is nothing in use from init.h/reboot.h, remove them.

---
 drivers/watchdog/imx_sc_wdt.c | 2 --
 1 file changed, 2 deletions(-)
drivers/watchdog/imx_sc_wdt.c +0 -2
index 8ed89f0..60a3246 100644
@@ -6,13 +6,11 @@
 #include <linux/arm-smccc.h>
 #include <linux/firmware/imx/sci.h>
 #include <linux/io.h>
-#include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
-#include <linux/reboot.h>
 #include <linux/watchdog.h>
 
 #define DEFAULT_TIMEOUT 60
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/3 watchdog: imx7ulp: Remove unused include of init.h

There is nothing in use from init.h, remove it.

---
 drivers/watchdog/imx7ulp_wdt.c | 1 -
 1 file changed, 1 deletion(-)
drivers/watchdog/imx7ulp_wdt.c +0 -1
index 11b9e7c..7993c8c 100644
@@ -4,7 +4,6 @@
  */
 
 #include <linux/clk.h>
-#include <linux/init.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
Signature · 1 line
2.7.4
maintainer Reviewed-by on v1 2/3
#2 lore raw

Re: [PATCH 2/3] watchdog: imx7ulp: Remove unused include of init.h

Quoted 3 lines · Anson Huang

There is nothing in use from init.h, remove it.

Quoted 16 lines
---
 drivers/watchdog/imx7ulp_wdt.c | 1 -
 1 file changed, 1 deletion(-)
drivers/watchdog/imx7ulp_wdt.c +0 -1
index 11b9e7c..7993c8c 100644
@@ -4,7 +4,6 @@
  */
 
 #include <linux/clk.h>
-#include <linux/init.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
#3 lore raw

PATCH 3/3 watchdog: imx2_wdt: Remove unused include of init.h

In reply to Anson Huang

There is nothing in use from init.h, remove it.

---
 drivers/watchdog/imx2_wdt.c | 1 -
 1 file changed, 1 deletion(-)
drivers/watchdog/imx2_wdt.c +0 -1
index f8d58bf..ce28e40 100644
@@ -20,7 +20,6 @@
 
 #include <linux/clk.h>
 #include <linux/delay.h>
-#include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
Signature · 1 line
2.7.4
maintainer NAK
#4 lore raw

Re: [PATCH 3/3] watchdog: imx2_wdt: Remove unused include of init.h

Quoted 2 lines · Anson Huang

There is nothing in use from init.h, remove it.

NACK, sorry; this driver uses __init and __exit_p.

Guenter

Quoted 17 lines
---
 drivers/watchdog/imx2_wdt.c | 1 -
 1 file changed, 1 deletion(-)
drivers/watchdog/imx2_wdt.c +0 -1
index f8d58bf..ce28e40 100644
@@ -20,7 +20,6 @@
 
 #include <linux/clk.h>
 #include <linux/delay.h>
-#include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
#5 lore raw

RE: [PATCH 3/3] watchdog: imx2_wdt: Remove unused include of init.h

Hi, Guenter

Quoted 8 lines

Subject: Re: [PATCH 3/3] watchdog: imx2_wdt: Remove unused include of init.h

Quoted 2 lines · Anson Huang

There is nothing in use from init.h, remove it.

NACK, sorry; this driver uses __init and __exit_p.

Ah, yes, just notice them. But I don't understand why the .probe callback needs __init and .remove callback needs __exit_p? Should they need to be removed?

Thanks,
Anson

Quoted 13 lines

Guenter

Quoted 11 lines
---
 drivers/watchdog/imx2_wdt.c | 1 -
 1 file changed, 1 deletion(-)
drivers/watchdog/imx2_wdt.c +0 -0
index f8d58bf..ce28e40 100644
@@ -20,7 +20,6 @@
 
Quoted 6 lines

drivers/watchdog/imx2_wdt.c line 25

Quoted 6 lines
drivers/watchdog/imx2_wdt.c +0 -1
 #include <linux/clk.h>
 #include <linux/delay.h>
-#include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/kernel.h>

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

maintainer
#6 lore raw

Re: [PATCH 3/3] watchdog: imx2_wdt: Remove unused include of init.h

Quoted 5 lines · Anson Huang

Hi, Guenter

Quoted 3 lines

Subject: Re: [PATCH 3/3] watchdog: imx2_wdt: Remove unused include of init.h

Quoted 9 lines
Quoted 5 lines · Anson Huang
Quoted 2 lines

There is nothing in use from init.h, remove it.

NACK, sorry; this driver uses __init and __exit_p.

Ah, yes, just notice them. But I don't understand why the .probe callback needs __init and .remove callback needs __exit_p? Should they need to be removed?

That is not a matter of "needs". __init causes the code to be removed after initialization. This is ok and desirable if it is known that the hardware is built-in and will only ever be probed once.

exit_p causes the code to be removed if it is built into the kernel. This is desirable and makes sense if the device is known to never be removed.

Having said that, what _is_ unnecessary is the remove function. Registration could use devm_watchdog_register_device(), and the watchdog subsystem should prevent removal if the watchdog is running. Plus, the removal function is
buggy: It doesn' call clk_disable_unprepare() (but that could be handled with devm_add_action_or_reset() in the probe function). In my opinion, fixing all that would be more valuable than trying to drop an include file.

Thanks,
Guenter

#7 lore raw

RE: [PATCH 3/3] watchdog: imx2_wdt: Remove unused include of init.h

Hi, Guenter

Quoted 20 lines

Subject: Re: [PATCH 3/3] watchdog: imx2_wdt: Remove unused include of init.h

Quoted 5 lines · Anson Huang

Hi, Guenter

Quoted 3 lines

Subject: Re: [PATCH 3/3] watchdog: imx2_wdt: Remove unused include of init.h

Quoted 8 lines
Quoted 5 lines · Anson Huang
Quoted 2 lines

There is nothing in use from init.h, remove it.

NACK, sorry; this driver uses __init and __exit_p.

Ah, yes, just notice them. But I don't understand why the .probe callback needs __init and .remove callback needs __exit_p? Should they

need to be removed?

Quoted 1 line
Quoted 6 lines

That is not a matter of "needs". __init causes the code to be removed after initialization. This is ok and desirable if it is known that the hardware is built- in and will only ever be probed once.

exit_p causes the code to be removed if it is built into the kernel. This is desirable and makes sense if the device is known to never be removed.

Make sense, for now, there is no i.MX SoC needs watchdog driver as module, so I will keep it here.

Quoted 8 lines

Having said that, what _is_ unnecessary is the remove function. Registration could use devm_watchdog_register_device(), and the watchdog subsystem should prevent removal if the watchdog is running. Plus, the removal function is
buggy: It doesn' call clk_disable_unprepare() (but that could be handled with devm_add_action_or_reset() in the probe function). In my opinion, fixing all that would be more valuable than trying to drop an include file.

Thanks for pointing out the clock operation issue in .remove callback, I will cut a patch using devm_watchdog_register_device() and devm_add_action_or_reset() to handle all necessary operations for remove action, then drop .remove callback.

Thanks,
Anson

maintainer Reviewed-by on v1 1/3
#8 lore raw
In reply to Anson Huang
Quoted 3 lines · Anson Huang

There is nothing in use from init.h/reboot.h, remove them.

Quoted 23 lines
---
  drivers/watchdog/imx_sc_wdt.c | 2 --
  1 file changed, 2 deletions(-)
drivers/watchdog/imx_sc_wdt.c +0 -2
index 8ed89f0..60a3246 100644
@@ -6,13 +6,11 @@
  #include <linux/arm-smccc.h>
  #include <linux/firmware/imx/sci.h>
  #include <linux/io.h>
-#include <linux/init.h>
  #include <linux/kernel.h>
  #include <linux/module.h>
  #include <linux/moduleparam.h>
  #include <linux/of.h>
  #include <linux/platform_device.h>
-#include <linux/reboot.h>
  #include <linux/watchdog.h>
 
  #define DEFAULT_TIMEOUT 60