Skip to contentSkip to conversation

i2c: imx: make bitrate an u32 type

PATCH New Wolfram Sang 3 participants 3 messages Jul 9, 2012 – Jul 10, 2012

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 i2c: imx: make bitrate an u32 type

sparse found this assignment of u32 to an int. Fix it:

drivers/i2c/busses/i2c-imx.c:540:56: warning: incorrect type in argument 3 (different signedness)

and also fix the type in platform_data. All current users use values which fit into the old and new type, so it is a safe change.

Cc Richard Zhao <[email protected]>
Cc Sascha Hauer <[email protected]>

---

Changes since V1: also change type in platform_data. Thanks to Richard.

 arch/arm/plat-mxc/include/mach/i2c.h |    2 +-
 drivers/i2c/busses/i2c-imx.c         |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/plat-mxc/include/mach/i2c.h +1 -1
index 375cdd0..8289d91 100644
@@ -15,7 +15,7 @@
  *
  **/
 struct imxi2c_platform_data {
-	int bitrate;
+	u32 bitrate;
 };
 
 #endif /* __ASM_ARCH_I2C_H_ */
drivers/i2c/busses/i2c-imx.c +2 -2
index dd2a083..90460dd 100644
@@ -471,8 +471,8 @@ static int __init i2c_imx_probe(struct platform_device *pdev)
 	struct imxi2c_platform_data *pdata = pdev->dev.platform_data;
 	struct pinctrl *pinctrl;
 	void __iomem *base;
-	int irq, bitrate;
-	int ret;
+	int irq, ret;
+	u32 bitrate;
 
 	dev_dbg(&pdev->dev, "<%s>\n", __func__);
 
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH v2 1/1 i2c: imx: make bitrate an u32 type

Quoted 10 lines · Wolfram Sang

sparse found this assignment of u32 to an int. Fix it:

drivers/i2c/busses/i2c-imx.c:540:56: warning: incorrect type in argument 3 (different signedness)

and also fix the type in platform_data. All current users use values which fit into the old and new type, so it is a safe change.

Cc Richard Zhao <[email protected]>
Cc Sascha Hauer <[email protected]>
Quoted 44 lines

---

Changes since V1: also change type in platform_data. Thanks to Richard.

 arch/arm/plat-mxc/include/mach/i2c.h |    2 +-
 drivers/i2c/busses/i2c-imx.c         |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/plat-mxc/include/mach/i2c.h +1 -1
index 375cdd0..8289d91 100644
@@ -15,7 +15,7 @@
  *
  **/
 struct imxi2c_platform_data {
-	int bitrate;
+	u32 bitrate;
 };
 
 #endif /* __ASM_ARCH_I2C_H_ */
drivers/i2c/busses/i2c-imx.c +2 -2
index dd2a083..90460dd 100644
@@ -471,8 +471,8 @@ static int __init i2c_imx_probe(struct platform_device *pdev)
 	struct imxi2c_platform_data *pdata = pdev->dev.platform_data;
 	struct pinctrl *pinctrl;
 	void __iomem *base;
-	int irq, bitrate;
-	int ret;
+	int irq, ret;
+	u32 bitrate;
 
 	dev_dbg(&pdev->dev, "<%s>\n", __func__);
 
Signature · 7 lines
1.7.10.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
maintainer
#2 lore raw

PATCH v2 1/1 i2c: imx: make bitrate an u32 type

In reply to Wolfram Sang
Quoted 10 lines · Wolfram Sang

sparse found this assignment of u32 to an int. Fix it:

drivers/i2c/busses/i2c-imx.c:540:56: warning: incorrect type in argument 3 (different signedness)

and also fix the type in platform_data. All current users use values which fit into the old and new type, so it is a safe change.

Cc Richard Zhao <[email protected]>
Cc Sascha Hauer <[email protected]>

Sascha

Quoted 40 lines

---

Changes since V1: also change type in platform_data. Thanks to Richard.

 arch/arm/plat-mxc/include/mach/i2c.h |    2 +-
 drivers/i2c/busses/i2c-imx.c         |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/plat-mxc/include/mach/i2c.h +1 -1
index 375cdd0..8289d91 100644
@@ -15,7 +15,7 @@
  *
  **/
 struct imxi2c_platform_data {
-	int bitrate;
+	u32 bitrate;
 };
 
 #endif /* __ASM_ARCH_I2C_H_ */
drivers/i2c/busses/i2c-imx.c +2 -2
index dd2a083..90460dd 100644
@@ -471,8 +471,8 @@ static int __init i2c_imx_probe(struct platform_device *pdev)
 	struct imxi2c_platform_data *pdata = pdev->dev.platform_data;
 	struct pinctrl *pinctrl;
 	void __iomem *base;
-	int irq, bitrate;
-	int ret;
+	int irq, ret;
+	u32 bitrate;
 
 	dev_dbg(&pdev->dev, "<%s>\n", __func__);
 
Signature · 1 line
1.7.10.4
Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |