Skip to content

Commit

Permalink
regulator: core: Fix cast to pointer from integer of different size w…
Browse files Browse the repository at this point in the history
…arning

This is to address the following warning during compilation time: (Compile on x86_64)

  CC      drivers/regulator/core.o
drivers/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]

This patch adds a temporary variable to avoid double cast.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Axel Lin authored and Mark Brown committed Aug 7, 2012
1 parent c6d678b commit 2f6c797
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2179,9 +2179,12 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev,
}
}

if (ret == 0 && best_val >= 0)
if (ret == 0 && best_val >= 0) {
unsigned long data = best_val;

_notifier_call_chain(rdev, REGULATOR_EVENT_VOLTAGE_CHANGE,
(void *)best_val);
(void *)data);
}

trace_regulator_set_voltage_complete(rdev_get_name(rdev), best_val);

Expand Down

0 comments on commit 2f6c797

Please sign in to comment.