Skip to contentSkip to conversation

regulator: fan53555: fix wrong cast in probe

PATCH Applied Heiko Stübner 2 participants 2 messages Sep 17, 2014 Voltage and current regulator framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 regulator: fan53555: fix wrong cast in probe

The vendor-id gathered from the dt match-data was cast to int but assigned to an unsigned long, producing warnings on at least sparc, like

drivers/regulator/fan53555.c: In function 'fan53555_regulator_probe':

Quoted 1 line
Quoted 1 line

drivers/regulator/fan53555.c:373:16: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]

      di->vendor = (int) match->data;

Fix this by using an appropriate cast.

Reported-by kbuild test robot
---
 drivers/regulator/fan53555.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/fan53555.c +1 -1
index f2f5535..6ca6e26 100644
@@ -370,7 +370,7 @@ static int fan53555_regulator_probe(struct i2c_client *client,
 		if (!match)
 			return -ENODEV;
 
-		di->vendor = (int) match->data;
+		di->vendor = (unsigned long) match->data;
 	} else {
 		/* if no ramp constraint set, get the pdata ramp_delay */
 		if (!di->regulator->constraints.ramp_delay) {
Signature · 1 line
2.0.1
maintainer Applied
#1 lore raw
Quoted 2 lines · Heiko Stübner

The vendor-id gathered from the dt match-data was cast to int but assigned to an unsigned long, producing warnings on at least sparc, like

Applied, thanks.