cpuidle: Drop unused cpuidle_driver_ref/unref() functions
PATCH 1/1 cpuidle: Drop unused cpuidle_driver_ref/unref() functions
From: Rafael J. Wysocki <[email protected]>
The cpuidle_driver_ref() and cpuidle_driver_unref() functions are not used and the refcnt field in struct cpuidle_driver operated by them is not updated anywhere else (so it is permanently equal to 0), so drop both of them along with refcnt.
Signed-off-by Rafael J. Wysocki <[email protected]>
--- drivers/cpuidle/driver.c | 46 ---------------------------------------------- include/linux/cpuidle.h | 5 ----- 2 files changed, 51 deletions(-)
drivers/cpuidle/driver.c +0 -46
@@ -155,8 +155,6 @@ static void __cpuidle_driver_init(struct {int i; - drv->refcnt =0 ; -/* * Use all possible CPUs as the default, because if the kernel boots * with some CPUs offline and then we online one of them, the CPU
@@ -240,9 +238,6 @@ static int __cpuidle_register_driver(str*/ static void __cpuidle_unregister_driver (struct cpuidle_driver *drv) { -if (WARN_ON (drv->refcnt >0 )) -return ; -if (drv->bctimer) { drv->bctimer =0 ; on_each_cpu_mask(drv->cpumask, cpuidle_setup_broadcast_timer,
@@ -350,47 +345,6 @@ struct cpuidle_driver *cpuidle_get_cpu_dEXPORT_SYMBOL_GPL (cpuidle_get_cpu_driver);/** -* cpuidle_driver_ref - get a reference to the driver. -* -* Increment the reference counter of the cpuidle driver associated with -* the current CPU. -* -* Returns a pointer to the driver, or NULL if the current CPU has no driver. -*/ -struct cpuidle_driver *cpuidle_driver_ref (void ) -{ -struct cpuidle_driver *drv; - -spin_lock (&cpuidle_driver_lock); - - drv =cpuidle_get_driver (); -if (drv) - drv->refcnt++; - -spin_unlock (&cpuidle_driver_lock); -return drv; -} - -/** -* cpuidle_driver_unref - puts down the refcount for the driver -* -* Decrement the reference counter of the cpuidle driver associated with -* the current CPU. -*/ -void cpuidle_driver_unref (void ) -{ -struct cpuidle_driver *drv; - -spin_lock (&cpuidle_driver_lock); - - drv =cpuidle_get_driver (); -if (drv && !WARN_ON (drv->refcnt <=0 )) - drv->refcnt--; - -spin_unlock (&cpuidle_driver_lock); -} - -/** * cpuidle_driver_state_disabled - Disable or enable an idle state * @drv: cpuidle driver owning the state * @idx: State index
include/linux/cpuidle.h +0 -5
@@ -116,7 +116,6 @@ DECLARE_PER_CPU(struct cpuidle_device, cstruct cpuidle_driver {const char *name;struct module *owner; -int refcnt;/* used by the cpuidle framework to setup the broadcast timer */ unsigned int bctimer:1 ;
@@ -148,8 +147,6 @@ extern u64 cpuidle_poll_time(struct cpuiextern int cpuidle_register_driver (struct cpuidle_driver *drv);extern struct cpuidle_driver *cpuidle_get_driver (void ); -extern struct cpuidle_driver *cpuidle_driver_ref (void ); -extern void cpuidle_driver_unref (void );extern void cpuidle_driver_state_disabled (struct cpuidle_driver *drv,int idx,bool disable);extern void cpuidle_unregister_driver (struct cpuidle_driver *drv);
@@ -187,8 +184,6 @@ static inline u64 cpuidle_poll_time(strustatic inline int cpuidle_register_driver (struct cpuidle_driver *drv) {return -ENODEV ; }static inline struct cpuidle_driver *cpuidle_get_driver (void ) {return NULL ; } -static inline struct cpuidle_driver *cpuidle_driver_ref (void ) {return NULL ; } -static inline void cpuidle_driver_unref (void ) {}static inline void cpuidle_driver_state_disabled (struct cpuidle_driver *drv,int idx,bool disable) { }static inline void cpuidle_unregister_driver (struct cpuidle_driver *drv) { }
Quoted 8 lines · Rafael J. Wysocki
From: Rafael J. Wysocki <[email protected]>
The
cpuidle_driver_ref()andcpuidle_driver_unref()functions are not used and the refcnt field in structcpuidle_driveroperated by them is not updated anywhere else (so it is permanently equal to 0), so drop both of them along with refcnt.Signed-off-by Rafael J. Wysocki <[email protected]>
Acked-by Daniel Lezcano <[email protected]>
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog