regulator: core: Fix argument to _notifier_call_chain call
PATCH 1/1 regulator: core: Fix argument to _notifier_call_chain call
Pass the address of best_val rather than the value of best_val for the third argument to _notifier_call_chain().
This fixes below build warning:
CC drivers/regulator/core.odrivers/regulator/core.c: In function '_regulator_do_set_voltage':drivers/regulator/core.c:2183:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
--- drivers/regulator/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/core.c +1 -1
@@ -2180,7 +2180,7 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev,if (ret ==0 && best_val >=0 )_notifier_call_chain (rdev,REGULATOR_EVENT_VOLTAGE_CHANGE , - (void *)best_val); + (void *)&best_val);trace_regulator_set_voltage_complete (rdev_get_name (rdev), best_val);
Signature · 1 line
1.7.9.5
Quoted 7 lines · Axel Lin
Pass the address of
best_valrather than the value ofbest_valfor the third argument to_notifier_call_chain().This fixes below build warning:
CCdrivers/regulator/core.odrivers/regulator/core.c: In function '_regulator_do_set_voltage':drivers/regulator/core.c:2183:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
No, this isn't a good idea - you're fixing a warning by changing the semantics to be something obscure and not terribly helpful. Just add a cast if your compiler is getting upset.