ANDROID: power_supply: inline empty power_supply_get_by_phandle_array()

The static empty definition of power_supply_get_by_phandle_array(), used
when CONFIG_OF is not set, is missing an inline keyword. This generates
multiple compiler warnings and adds function-call overhead. This patch
inlines the definition to address such issues.

Fixes:
./include/linux/power_supply.h:405:12: warning: ‘power_supply_get_by_phandle_array’ defined but not used [-Wunused-function]
  405 | static int power_supply_get_by_phandle_array(struct device_node *np,
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Bug: 183339614
Fixes: dea1a925f6 (ANDROID: power_supply: Add a helper function to retrieve psy array from phandle)
Reported-by: kernelci.org bot <bot@kernelci.org>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Change-Id: I6ad919673d0f649d7701c573196c11795663182d
(cherry picked from commit 1dccea76dace5c8abeafdc53de6f87d80ad0dc95)
This commit is contained in:
Carlos Llamas
2021-04-12 17:45:50 +00:00
parent 3ab775d150
commit 615edf1635

View File

@@ -402,10 +402,11 @@ extern struct power_supply *devm_power_supply_get_by_phandle(
static inline struct power_supply *
power_supply_get_by_phandle(struct device_node *np, const char *property)
{ return NULL; }
static int power_supply_get_by_phandle_array(struct device_node *np,
const char *property,
struct power_supply **psy,
int size)
static inline int
power_supply_get_by_phandle_array(struct device_node *np,
const char *property,
struct power_supply **psy,
int size)
{ return 0; }
static inline struct power_supply *
devm_power_supply_get_by_phandle(struct device *dev, const char *property)