Skip to contentSkip to conversation

mx6sxsabresd: Use 'int' for return values

PATCH New Fabio Estevam 2 participants 2 messages Jul 21, 2015 – Jul 26, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mx6sxsabresd: Use 'int' for return values

From: Fabio Estevam <[email protected]>

The variable 'ret' is used to store the value returned by pfuze_mode_init(), so it should be of type 'int' instead of 'unsigned int' in order to correctly handle negative numbers.

Fix the variable type.

---
 board/freescale/mx6sxsabresd/mx6sxsabresd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
board/freescale/mx6sxsabresd/mx6sxsabresd.c +2 -1
index 2ff960e..d58a79a 100644
@@ -199,7 +199,8 @@ static struct i2c_pads_info i2c_pad_info1 = {
 int power_init_board(void)
 {
 	struct pmic *p;
-	unsigned int reg, ret;
+	unsigned int reg;
+	int ret;
 
 	p = pfuze_common_init(I2C_PMIC);
 	if (!p)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 mx6sxsabresd: Use 'int' for return values

Hi Fabio,

Quoted 19 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

The variable 'ret' is used to store the value returned by pfuze_mode_init(), so it should be of type 'int' instead of 'unsigned int' in order to correctly handle negative numbers.

Fix the variable type.

---
 board/freescale/mx6sxsabresd/mx6sxsabresd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
board/freescale/mx6sxsabresd/mx6sxsabresd.c +0 -0
index 2ff960e..d58a79a 100644

board/freescale/mx6sxsabresd/mx6sxsabresd.c static struct i2c_pads_info i2c_pad_info1 = { · line 206

Quoted 9 lines
board/freescale/mx6sxsabresd/mx6sxsabresd.c +2 -1
@@ -199,7 +199,8 @@ static struct i2c_pads_info i2c_pad_info1 = {
 int power_init_board(void)
 {
 	struct pmic *p;
-	unsigned int reg, ret;
+	unsigned int reg;
+	int ret;
 
 	p = pfuze_common_init(I2C_PMIC);
 	if (!p)

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================