Skip to content

Commit

Permalink
PM / clk: don't return int on __pm_clk_enable()
Browse files Browse the repository at this point in the history
Static analysis by cppcheck found an issue that was recently introduced by
commit 471f770 ("PM / clock_ops: make __pm_clk_enable more generic")
where a return status in ret was not being initialised and garbage
being returned when ce->status >= PCE_STATUS_ERROR.

The fact that ret is not being checked by the caller and that
ret is only used internally __pm_clk_enable() to check if clk_enable()
was OK means we can ignore returning it instead turn
__pm_clk_enable() into function with a void return.

Fixes: 471f770 ("PM / clock_ops: make __pm_clk_enable more generic")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Colin Ian King authored and Rafael J. Wysocki committed Jul 17, 2015
1 parent 21bdb58 commit f4745a9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/base/power/clock_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct pm_clock_entry {
* @dev: The device for the given clock
* @ce: PM clock entry corresponding to the clock.
*/
static inline int __pm_clk_enable(struct device *dev, struct pm_clock_entry *ce)
static inline void __pm_clk_enable(struct device *dev, struct pm_clock_entry *ce)
{
int ret;

Expand All @@ -50,8 +50,6 @@ static inline int __pm_clk_enable(struct device *dev, struct pm_clock_entry *ce)
dev_err(dev, "%s: failed to enable clk %p, error %d\n",
__func__, ce->clk, ret);
}

return ret;
}

/**
Expand Down

0 comments on commit f4745a9

Please sign in to comment.