Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PM / clk: don't return int on __pm_clk_enable()

Static analysis by cppcheck found an issue that was recently introduced by
commit 471f7707b6f0b1 ("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: 471f7707b6f0b1 ("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>

authored by

Colin Ian King and committed by
Rafael J. Wysocki
f4745a92 21bdb584

+1 -3
+1 -3
drivers/base/power/clock_ops.c
··· 38 38 * @dev: The device for the given clock 39 39 * @ce: PM clock entry corresponding to the clock. 40 40 */ 41 - static inline int __pm_clk_enable(struct device *dev, struct pm_clock_entry *ce) 41 + static inline void __pm_clk_enable(struct device *dev, struct pm_clock_entry *ce) 42 42 { 43 43 int ret; 44 44 ··· 50 50 dev_err(dev, "%s: failed to enable clk %p, error %d\n", 51 51 __func__, ce->clk, ret); 52 52 } 53 - 54 - return ret; 55 53 } 56 54 57 55 /**