Skip to contentSkip to conversation

watchdog: s3c2410: remove unused freq_to_wdt and s3c2410wdt_is_running functions

PATCH In review Tom Rix 3 participants 3 messages Mar 21, 2023 – Apr 8, 2023

Subsystems (2)
lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 1/1 watchdog: s3c2410: remove unused freq_to_wdt and s3c2410wdt_is_running functions

clang with W=1 reports drivers/watchdog/s3c2410_wdt.c:311:35: error: unused function
'freq_to_wdt' [-Werror,-Wunused-function]
static inline struct s3c2410_wdt *freq_to_wdt(struct notifier_block *nb)

                                  ^
drivers/watchdog/s3c2410_wdt.c:446:19: error: unused function
  's3c2410wdt_is_running' [-Werror,-Wunused-function]
static inline int s3c2410wdt_is_running(struct s3c2410_wdt *wdt)
                  ^

These functions are not used, so remove them.

---
 drivers/watchdog/s3c2410_wdt.c | 10 ----------
 1 file changed, 10 deletions(-)
drivers/watchdog/s3c2410_wdt.c +0 -10
index 200ba236a72e..6394dda7a5dc 100644
@@ -308,11 +308,6 @@ static inline unsigned int s3c2410wdt_max_timeout(struct s3c2410_wdt *wdt)
 				       / S3C2410_WTCON_MAXDIV);
 }
 
-static inline struct s3c2410_wdt *freq_to_wdt(struct notifier_block *nb)
-{
-	return container_of(nb, struct s3c2410_wdt, freq_transition);
-}
-
 static int s3c2410wdt_disable_wdt_reset(struct s3c2410_wdt *wdt, bool mask)
 {
 	const u32 mask_val = BIT(wdt->drv_data->mask_bit);
@@ -443,11 +438,6 @@ static int s3c2410wdt_start(struct watchdog_device *wdd)
 	return 0;
 }
 
-static inline int s3c2410wdt_is_running(struct s3c2410_wdt *wdt)
-{
-	return readl(wdt->reg_base + S3C2410_WTCON) & S3C2410_WTCON_ENABLE;
-}
-
 static int s3c2410wdt_set_heartbeat(struct watchdog_device *wdd,
 				    unsigned int timeout)
 {
Signature · 1 line
2.27.0
Reviewed-by on v1 1/1
#1 lore raw

Hi Tom,

Quoted 33 lines · Tom Rix

clang with W=1 reports drivers/watchdog/s3c2410_wdt.c:311:35: error: unused function
'freq_to_wdt' [-Werror,-Wunused-function]
static inline struct s3c2410_wdt *freq_to_wdt(struct notifier_block *nb)

                                  ^
drivers/watchdog/s3c2410_wdt.c:446:19: error: unused function
  's3c2410wdt_is_running' [-Werror,-Wunused-function]
static inline int s3c2410wdt_is_running(struct s3c2410_wdt *wdt)
                  ^

These functions are not used, so remove them.

---
 drivers/watchdog/s3c2410_wdt.c | 10 ----------
 1 file changed, 10 deletions(-)
drivers/watchdog/s3c2410_wdt.c +0 -5
index 200ba236a72e..6394dda7a5dc 100644
@@ -308,11 +308,6 @@ static inline unsigned int s3c2410wdt_max_timeout(struct s3c2410_wdt *wdt)
 				       / S3C2410_WTCON_MAXDIV);
 }
 
-static inline struct s3c2410_wdt *freq_to_wdt(struct notifier_block *nb)
-{
-	return container_of(nb, struct s3c2410_wdt, freq_transition);
-}
-
 static int s3c2410wdt_disable_wdt_reset(struct s3c2410_wdt *wdt, bool mask)
 {
 	const u32 mask_val = BIT(wdt->drv_data->mask_bit);

drivers/watchdog/s3c2410_wdt.c static int s3c2410wdt_start(struct watchdog_device *wdd) · line 450

Quoted 8 lines
drivers/watchdog/s3c2410_wdt.c +0 -5
@@ -443,11 +438,6 @@ static int s3c2410wdt_start(struct watchdog_device *wdd)
 	return 0;
 }
 
-static inline int s3c2410wdt_is_running(struct s3c2410_wdt *wdt)
-{
-	return readl(wdt->reg_base + S3C2410_WTCON) & S3C2410_WTCON_ENABLE;
-}
-

there is only one instance where this can be actually used in the driver, but it's inside a dev_info, so no point having it around.

Andi

Quoted 6 lines
drivers/watchdog/s3c2410_wdt.c +0 -0
 static int s3c2410wdt_set_heartbeat(struct watchdog_device *wdd,
 				    unsigned int timeout)
 {
Signature · 1 line
2.27.0
maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Tom Rix
Quoted 9 lines · Tom Rix

clang with W=1 reports drivers/watchdog/s3c2410_wdt.c:311:35: error: unused function
'freq_to_wdt' [-Werror,-Wunused-function]
static inline struct s3c2410_wdt *freq_to_wdt(struct notifier_block *nb)

                                  ^
drivers/watchdog/s3c2410_wdt.c:446:19: error: unused function
  's3c2410wdt_is_running' [-Werror,-Wunused-function]
static inline int s3c2410wdt_is_running(struct s3c2410_wdt *wdt)
                  ^
Quoted 4 lines

These functions are not used, so remove them.

Quoted 32 lines
---
 drivers/watchdog/s3c2410_wdt.c | 10 ----------
 1 file changed, 10 deletions(-)
drivers/watchdog/s3c2410_wdt.c +0 -10
index 200ba236a72e..6394dda7a5dc 100644
@@ -308,11 +308,6 @@ static inline unsigned int s3c2410wdt_max_timeout(struct s3c2410_wdt *wdt)
 				       / S3C2410_WTCON_MAXDIV);
 }
 
-static inline struct s3c2410_wdt *freq_to_wdt(struct notifier_block *nb)
-{
-	return container_of(nb, struct s3c2410_wdt, freq_transition);
-}
-
 static int s3c2410wdt_disable_wdt_reset(struct s3c2410_wdt *wdt, bool mask)
 {
 	const u32 mask_val = BIT(wdt->drv_data->mask_bit);
@@ -443,11 +438,6 @@ static int s3c2410wdt_start(struct watchdog_device *wdd)
 	return 0;
 }
 
-static inline int s3c2410wdt_is_running(struct s3c2410_wdt *wdt)
-{
-	return readl(wdt->reg_base + S3C2410_WTCON) & S3C2410_WTCON_ENABLE;
-}
-
 static int s3c2410wdt_set_heartbeat(struct watchdog_device *wdd,
 				    unsigned int timeout)
 {