linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] regulator: core: Fix argument to _notifier_call_chain call
@ 2012-07-29  7:53 Axel Lin
  2012-07-29 20:39 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2012-07-29  7:53 UTC (permalink / raw)
  To: Mark Brown; +Cc: Liam Girdwood, linux-kernel

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.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]

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/regulator/core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index f092588..37ce62b 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -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);
 
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] regulator: core: Fix argument to _notifier_call_chain call
  2012-07-29  7:53 [PATCH] regulator: core: Fix argument to _notifier_call_chain call Axel Lin
@ 2012-07-29 20:39 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2012-07-29 20:39 UTC (permalink / raw)
  To: Axel Lin; +Cc: Liam Girdwood, linux-kernel

On Sun, Jul 29, 2012 at 03:53:16PM +0800, Axel Lin wrote:
> 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.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]

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-07-29 20:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-29  7:53 [PATCH] regulator: core: Fix argument to _notifier_call_chain call Axel Lin
2012-07-29 20:39 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).