Message ID | 20200203011733.7639-1-cw00.choi@samsung.com (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Chanwoo Choi |
Headers | show |
Series | [PATCHv2,1/2] PM / devfreq: Remove unneeded extern keyword | expand |
On 2/3/20 10:17 AM, Chanwoo Choi wrote: > Remove unneeded extern keyword from devfreq-related header file > and adjust the indentation of function parameter to keep the > consistency in header file > > Reviewed-by: Lukasz Luba <lukasz.luba@arm.com> > Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> > --- > Changes from v1: > - Add reviewed tag of Lukasz > > drivers/devfreq/governor.h | 17 +++---- > include/linux/devfreq.h | 100 ++++++++++++++++++------------------- > 2 files changed, 57 insertions(+), 60 deletions(-) > > diff --git a/drivers/devfreq/governor.h b/drivers/devfreq/governor.h > index dc7533ccc3db..5ba3e051b1d0 100644 > --- a/drivers/devfreq/governor.h > +++ b/drivers/devfreq/governor.h > @@ -57,17 +57,16 @@ struct devfreq_governor { > unsigned int event, void *data); > }; > > -extern void devfreq_monitor_start(struct devfreq *devfreq); > -extern void devfreq_monitor_stop(struct devfreq *devfreq); > -extern void devfreq_monitor_suspend(struct devfreq *devfreq); > -extern void devfreq_monitor_resume(struct devfreq *devfreq); > -extern void devfreq_interval_update(struct devfreq *devfreq, > - unsigned int *delay); > +void devfreq_monitor_start(struct devfreq *devfreq); > +void devfreq_monitor_stop(struct devfreq *devfreq); > +void devfreq_monitor_suspend(struct devfreq *devfreq); > +void devfreq_monitor_resume(struct devfreq *devfreq); > +void devfreq_interval_update(struct devfreq *devfreq, unsigned int *delay); > > -extern int devfreq_add_governor(struct devfreq_governor *governor); > -extern int devfreq_remove_governor(struct devfreq_governor *governor); > +int devfreq_add_governor(struct devfreq_governor *governor); > +int devfreq_remove_governor(struct devfreq_governor *governor); > > -extern int devfreq_update_status(struct devfreq *devfreq, unsigned long freq); > +int devfreq_update_status(struct devfreq *devfreq, unsigned long freq); > > static inline int devfreq_update_stats(struct devfreq *df) > { > diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h > index c6f82d4bec9f..82630fafacde 100644 > --- a/include/linux/devfreq.h > +++ b/include/linux/devfreq.h > @@ -201,24 +201,23 @@ struct devfreq_freqs { > }; > > #if defined(CONFIG_PM_DEVFREQ) > -extern struct devfreq *devfreq_add_device(struct device *dev, > - struct devfreq_dev_profile *profile, > - const char *governor_name, > - void *data); > -extern int devfreq_remove_device(struct devfreq *devfreq); > -extern struct devfreq *devm_devfreq_add_device(struct device *dev, > - struct devfreq_dev_profile *profile, > - const char *governor_name, > - void *data); > -extern void devm_devfreq_remove_device(struct device *dev, > - struct devfreq *devfreq); > +struct devfreq *devfreq_add_device(struct device *dev, > + struct devfreq_dev_profile *profile, > + const char *governor_name, > + void *data); > +int devfreq_remove_device(struct devfreq *devfreq); > +struct devfreq *devm_devfreq_add_device(struct device *dev, > + struct devfreq_dev_profile *profile, > + const char *governor_name, > + void *data); > +void devm_devfreq_remove_device(struct device *dev, struct devfreq *devfreq); > > /* Supposed to be called by PM callbacks */ > -extern int devfreq_suspend_device(struct devfreq *devfreq); > -extern int devfreq_resume_device(struct devfreq *devfreq); > +int devfreq_suspend_device(struct devfreq *devfreq); > +int devfreq_resume_device(struct devfreq *devfreq); > > -extern void devfreq_suspend(void); > -extern void devfreq_resume(void); > +void devfreq_suspend(void); > +void devfreq_resume(void); > > /** > * update_devfreq() - Reevaluate the device and configure frequency > @@ -226,35 +225,34 @@ extern void devfreq_resume(void); > * > * Note: devfreq->lock must be held > */ > -extern int update_devfreq(struct devfreq *devfreq); > +int update_devfreq(struct devfreq *devfreq); > > /* Helper functions for devfreq user device driver with OPP. */ > -extern struct dev_pm_opp *devfreq_recommended_opp(struct device *dev, > - unsigned long *freq, u32 flags); > -extern int devfreq_register_opp_notifier(struct device *dev, > - struct devfreq *devfreq); > -extern int devfreq_unregister_opp_notifier(struct device *dev, > - struct devfreq *devfreq); > -extern int devm_devfreq_register_opp_notifier(struct device *dev, > - struct devfreq *devfreq); > -extern void devm_devfreq_unregister_opp_notifier(struct device *dev, > - struct devfreq *devfreq); > -extern int devfreq_register_notifier(struct devfreq *devfreq, > - struct notifier_block *nb, > - unsigned int list); > -extern int devfreq_unregister_notifier(struct devfreq *devfreq, > - struct notifier_block *nb, > - unsigned int list); > -extern int devm_devfreq_register_notifier(struct device *dev, > +struct dev_pm_opp *devfreq_recommended_opp(struct device *dev, > + unsigned long *freq, u32 flags); > +int devfreq_register_opp_notifier(struct device *dev, > + struct devfreq *devfreq); > +int devfreq_unregister_opp_notifier(struct device *dev, > + struct devfreq *devfreq); > +int devm_devfreq_register_opp_notifier(struct device *dev, > + struct devfreq *devfreq); > +void devm_devfreq_unregister_opp_notifier(struct device *dev, > + struct devfreq *devfreq); > +int devfreq_register_notifier(struct devfreq *devfreq, > + struct notifier_block *nb, > + unsigned int list); > +int devfreq_unregister_notifier(struct devfreq *devfreq, > + struct notifier_block *nb, > + unsigned int list); > +int devm_devfreq_register_notifier(struct device *dev, > struct devfreq *devfreq, > struct notifier_block *nb, > unsigned int list); > -extern void devm_devfreq_unregister_notifier(struct device *dev, > +void devm_devfreq_unregister_notifier(struct device *dev, > struct devfreq *devfreq, > struct notifier_block *nb, > unsigned int list); > -extern struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev, > - int index); > +struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev, int index); > > #if IS_ENABLED(CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND) > /** > @@ -311,9 +309,9 @@ struct devfreq_passive_data { > > #else /* !CONFIG_PM_DEVFREQ */ > static inline struct devfreq *devfreq_add_device(struct device *dev, > - struct devfreq_dev_profile *profile, > - const char *governor_name, > - void *data) > + struct devfreq_dev_profile *profile, > + const char *governor_name, > + void *data) > { > return ERR_PTR(-ENOSYS); > } > @@ -350,31 +348,31 @@ static inline void devfreq_suspend(void) {} > static inline void devfreq_resume(void) {} > > static inline struct dev_pm_opp *devfreq_recommended_opp(struct device *dev, > - unsigned long *freq, u32 flags) > + unsigned long *freq, u32 flags) > { > return ERR_PTR(-EINVAL); > } > > static inline int devfreq_register_opp_notifier(struct device *dev, > - struct devfreq *devfreq) > + struct devfreq *devfreq) > { > return -EINVAL; > } > > static inline int devfreq_unregister_opp_notifier(struct device *dev, > - struct devfreq *devfreq) > + struct devfreq *devfreq) > { > return -EINVAL; > } > > static inline int devm_devfreq_register_opp_notifier(struct device *dev, > - struct devfreq *devfreq) > + struct devfreq *devfreq) > { > return -EINVAL; > } > > static inline void devm_devfreq_unregister_opp_notifier(struct device *dev, > - struct devfreq *devfreq) > + struct devfreq *devfreq) > { > } > > @@ -393,22 +391,22 @@ static inline int devfreq_unregister_notifier(struct devfreq *devfreq, > } > > static inline int devm_devfreq_register_notifier(struct device *dev, > - struct devfreq *devfreq, > - struct notifier_block *nb, > - unsigned int list) > + struct devfreq *devfreq, > + struct notifier_block *nb, > + unsigned int list) > { > return 0; > } > > static inline void devm_devfreq_unregister_notifier(struct device *dev, > - struct devfreq *devfreq, > - struct notifier_block *nb, > - unsigned int list) > + struct devfreq *devfreq, > + struct notifier_block *nb, > + unsigned int list) > { > } > > static inline struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev, > - int index) > + int index) > { > return ERR_PTR(-ENODEV); > } > Applied it. Thanks.
diff --git a/drivers/devfreq/governor.h b/drivers/devfreq/governor.h index dc7533ccc3db..5ba3e051b1d0 100644 --- a/drivers/devfreq/governor.h +++ b/drivers/devfreq/governor.h @@ -57,17 +57,16 @@ struct devfreq_governor { unsigned int event, void *data); }; -extern void devfreq_monitor_start(struct devfreq *devfreq); -extern void devfreq_monitor_stop(struct devfreq *devfreq); -extern void devfreq_monitor_suspend(struct devfreq *devfreq); -extern void devfreq_monitor_resume(struct devfreq *devfreq); -extern void devfreq_interval_update(struct devfreq *devfreq, - unsigned int *delay); +void devfreq_monitor_start(struct devfreq *devfreq); +void devfreq_monitor_stop(struct devfreq *devfreq); +void devfreq_monitor_suspend(struct devfreq *devfreq); +void devfreq_monitor_resume(struct devfreq *devfreq); +void devfreq_interval_update(struct devfreq *devfreq, unsigned int *delay); -extern int devfreq_add_governor(struct devfreq_governor *governor); -extern int devfreq_remove_governor(struct devfreq_governor *governor); +int devfreq_add_governor(struct devfreq_governor *governor); +int devfreq_remove_governor(struct devfreq_governor *governor); -extern int devfreq_update_status(struct devfreq *devfreq, unsigned long freq); +int devfreq_update_status(struct devfreq *devfreq, unsigned long freq); static inline int devfreq_update_stats(struct devfreq *df) { diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h index c6f82d4bec9f..82630fafacde 100644 --- a/include/linux/devfreq.h +++ b/include/linux/devfreq.h @@ -201,24 +201,23 @@ struct devfreq_freqs { }; #if defined(CONFIG_PM_DEVFREQ) -extern struct devfreq *devfreq_add_device(struct device *dev, - struct devfreq_dev_profile *profile, - const char *governor_name, - void *data); -extern int devfreq_remove_device(struct devfreq *devfreq); -extern struct devfreq *devm_devfreq_add_device(struct device *dev, - struct devfreq_dev_profile *profile, - const char *governor_name, - void *data); -extern void devm_devfreq_remove_device(struct device *dev, - struct devfreq *devfreq); +struct devfreq *devfreq_add_device(struct device *dev, + struct devfreq_dev_profile *profile, + const char *governor_name, + void *data); +int devfreq_remove_device(struct devfreq *devfreq); +struct devfreq *devm_devfreq_add_device(struct device *dev, + struct devfreq_dev_profile *profile, + const char *governor_name, + void *data); +void devm_devfreq_remove_device(struct device *dev, struct devfreq *devfreq); /* Supposed to be called by PM callbacks */ -extern int devfreq_suspend_device(struct devfreq *devfreq); -extern int devfreq_resume_device(struct devfreq *devfreq); +int devfreq_suspend_device(struct devfreq *devfreq); +int devfreq_resume_device(struct devfreq *devfreq); -extern void devfreq_suspend(void); -extern void devfreq_resume(void); +void devfreq_suspend(void); +void devfreq_resume(void); /** * update_devfreq() - Reevaluate the device and configure frequency @@ -226,35 +225,34 @@ extern void devfreq_resume(void); * * Note: devfreq->lock must be held */ -extern int update_devfreq(struct devfreq *devfreq); +int update_devfreq(struct devfreq *devfreq); /* Helper functions for devfreq user device driver with OPP. */ -extern struct dev_pm_opp *devfreq_recommended_opp(struct device *dev, - unsigned long *freq, u32 flags); -extern int devfreq_register_opp_notifier(struct device *dev, - struct devfreq *devfreq); -extern int devfreq_unregister_opp_notifier(struct device *dev, - struct devfreq *devfreq); -extern int devm_devfreq_register_opp_notifier(struct device *dev, - struct devfreq *devfreq); -extern void devm_devfreq_unregister_opp_notifier(struct device *dev, - struct devfreq *devfreq); -extern int devfreq_register_notifier(struct devfreq *devfreq, - struct notifier_block *nb, - unsigned int list); -extern int devfreq_unregister_notifier(struct devfreq *devfreq, - struct notifier_block *nb, - unsigned int list); -extern int devm_devfreq_register_notifier(struct device *dev, +struct dev_pm_opp *devfreq_recommended_opp(struct device *dev, + unsigned long *freq, u32 flags); +int devfreq_register_opp_notifier(struct device *dev, + struct devfreq *devfreq); +int devfreq_unregister_opp_notifier(struct device *dev, + struct devfreq *devfreq); +int devm_devfreq_register_opp_notifier(struct device *dev, + struct devfreq *devfreq); +void devm_devfreq_unregister_opp_notifier(struct device *dev, + struct devfreq *devfreq); +int devfreq_register_notifier(struct devfreq *devfreq, + struct notifier_block *nb, + unsigned int list); +int devfreq_unregister_notifier(struct devfreq *devfreq, + struct notifier_block *nb, + unsigned int list); +int devm_devfreq_register_notifier(struct device *dev, struct devfreq *devfreq, struct notifier_block *nb, unsigned int list); -extern void devm_devfreq_unregister_notifier(struct device *dev, +void devm_devfreq_unregister_notifier(struct device *dev, struct devfreq *devfreq, struct notifier_block *nb, unsigned int list); -extern struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev, - int index); +struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev, int index); #if IS_ENABLED(CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND) /** @@ -311,9 +309,9 @@ struct devfreq_passive_data { #else /* !CONFIG_PM_DEVFREQ */ static inline struct devfreq *devfreq_add_device(struct device *dev, - struct devfreq_dev_profile *profile, - const char *governor_name, - void *data) + struct devfreq_dev_profile *profile, + const char *governor_name, + void *data) { return ERR_PTR(-ENOSYS); } @@ -350,31 +348,31 @@ static inline void devfreq_suspend(void) {} static inline void devfreq_resume(void) {} static inline struct dev_pm_opp *devfreq_recommended_opp(struct device *dev, - unsigned long *freq, u32 flags) + unsigned long *freq, u32 flags) { return ERR_PTR(-EINVAL); } static inline int devfreq_register_opp_notifier(struct device *dev, - struct devfreq *devfreq) + struct devfreq *devfreq) { return -EINVAL; } static inline int devfreq_unregister_opp_notifier(struct device *dev, - struct devfreq *devfreq) + struct devfreq *devfreq) { return -EINVAL; } static inline int devm_devfreq_register_opp_notifier(struct device *dev, - struct devfreq *devfreq) + struct devfreq *devfreq) { return -EINVAL; } static inline void devm_devfreq_unregister_opp_notifier(struct device *dev, - struct devfreq *devfreq) + struct devfreq *devfreq) { } @@ -393,22 +391,22 @@ static inline int devfreq_unregister_notifier(struct devfreq *devfreq, } static inline int devm_devfreq_register_notifier(struct device *dev, - struct devfreq *devfreq, - struct notifier_block *nb, - unsigned int list) + struct devfreq *devfreq, + struct notifier_block *nb, + unsigned int list) { return 0; } static inline void devm_devfreq_unregister_notifier(struct device *dev, - struct devfreq *devfreq, - struct notifier_block *nb, - unsigned int list) + struct devfreq *devfreq, + struct notifier_block *nb, + unsigned int list) { } static inline struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev, - int index) + int index) { return ERR_PTR(-ENODEV); }