Skip to content

Commit

Permalink
PM / devfreq: Remove unneeded extern keyword
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
  • Loading branch information
chanwoochoi committed Mar 24, 2020
1 parent 4bb1faa commit 6d74349
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 60 deletions.
17 changes: 8 additions & 9 deletions drivers/devfreq/governor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
100 changes: 49 additions & 51 deletions include/linux/devfreq.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,60 +201,58 @@ 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
* @devfreq: the devfreq device
*
* 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)
/**
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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)
{
}

Expand All @@ -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);
}
Expand Down

0 comments on commit 6d74349

Please sign in to comment.