* [PATCH V2] i2c: imx: make bitrate an u32 type @ 2012-07-09 22:28 Wolfram Sang [not found] ` <1341872910-26687-1-git-send-email-wolfram-z923LK4zBo2bacvFa/9K2g@public.gmane.org> 0 siblings, 1 reply; 3+ messages in thread From: Wolfram Sang @ 2012-07-09 22:28 UTC (permalink / raw) To: linux-i2c-u79uwXL29TY76Z2rM5mHXA Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Wolfram Sang, Richard Zhao, Sascha Hauer 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. Signed-off-by: Wolfram Sang <wolfram-z923LK4zBo2bacvFa/9K2g@public.gmane.org> Cc: Richard Zhao <richard.zhao-KZfg59tc24xl57MIdRCFDg@public.gmane.org> Cc: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> --- 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(-) diff --git a/arch/arm/plat-mxc/include/mach/i2c.h b/arch/arm/plat-mxc/include/mach/i2c.h index 375cdd0..8289d91 100644 --- a/arch/arm/plat-mxc/include/mach/i2c.h +++ b/arch/arm/plat-mxc/include/mach/i2c.h @@ -15,7 +15,7 @@ * **/ struct imxi2c_platform_data { - int bitrate; + u32 bitrate; }; #endif /* __ASM_ARCH_I2C_H_ */ diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index dd2a083..90460dd 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c @@ -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__); -- 1.7.10.4 ^ permalink raw reply related [flat|nested] 3+ messages in thread
[parent not found: <1341872910-26687-1-git-send-email-wolfram-z923LK4zBo2bacvFa/9K2g@public.gmane.org>]
* Re: [PATCH V2] i2c: imx: make bitrate an u32 type [not found] ` <1341872910-26687-1-git-send-email-wolfram-z923LK4zBo2bacvFa/9K2g@public.gmane.org> @ 2012-07-09 23:08 ` Richard Zhao 2012-07-10 8:42 ` Sascha Hauer 1 sibling, 0 replies; 3+ messages in thread From: Richard Zhao @ 2012-07-09 23:08 UTC (permalink / raw) To: Wolfram Sang Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, Sascha Hauer, Richard Zhao, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r On Tue, Jul 10, 2012 at 12:28:30AM +0200, Wolfram Sang wrote: > 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. > > Signed-off-by: Wolfram Sang <wolfram-z923LK4zBo2bacvFa/9K2g@public.gmane.org> > Cc: Richard Zhao <richard.zhao-KZfg59tc24xl57MIdRCFDg@public.gmane.org> > Cc: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> Reviewed-by: Richard Zhao <richard.zhao-KZfg59tc24xl57MIdRCFDg@public.gmane.org> > --- > > 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(-) > > diff --git a/arch/arm/plat-mxc/include/mach/i2c.h b/arch/arm/plat-mxc/include/mach/i2c.h > index 375cdd0..8289d91 100644 > --- a/arch/arm/plat-mxc/include/mach/i2c.h > +++ b/arch/arm/plat-mxc/include/mach/i2c.h > @@ -15,7 +15,7 @@ > * > **/ > struct imxi2c_platform_data { > - int bitrate; > + u32 bitrate; > }; > > #endif /* __ASM_ARCH_I2C_H_ */ > diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c > index dd2a083..90460dd 100644 > --- a/drivers/i2c/busses/i2c-imx.c > +++ b/drivers/i2c/busses/i2c-imx.c > @@ -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__); > > -- > 1.7.10.4 > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH V2] i2c: imx: make bitrate an u32 type [not found] ` <1341872910-26687-1-git-send-email-wolfram-z923LK4zBo2bacvFa/9K2g@public.gmane.org> 2012-07-09 23:08 ` Richard Zhao @ 2012-07-10 8:42 ` Sascha Hauer 1 sibling, 0 replies; 3+ messages in thread From: Sascha Hauer @ 2012-07-10 8:42 UTC (permalink / raw) To: Wolfram Sang Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Richard Zhao On Tue, Jul 10, 2012 at 12:28:30AM +0200, Wolfram Sang wrote: > 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. > > Signed-off-by: Wolfram Sang <wolfram-z923LK4zBo2bacvFa/9K2g@public.gmane.org> > Cc: Richard Zhao <richard.zhao-KZfg59tc24xl57MIdRCFDg@public.gmane.org> > Cc: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> Acked-by: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> Sascha > --- > > 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(-) > > diff --git a/arch/arm/plat-mxc/include/mach/i2c.h b/arch/arm/plat-mxc/include/mach/i2c.h > index 375cdd0..8289d91 100644 > --- a/arch/arm/plat-mxc/include/mach/i2c.h > +++ b/arch/arm/plat-mxc/include/mach/i2c.h > @@ -15,7 +15,7 @@ > * > **/ > struct imxi2c_platform_data { > - int bitrate; > + u32 bitrate; > }; > > #endif /* __ASM_ARCH_I2C_H_ */ > diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c > index dd2a083..90460dd 100644 > --- a/drivers/i2c/busses/i2c-imx.c > +++ b/drivers/i2c/busses/i2c-imx.c > @@ -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__); > > -- > 1.7.10.4 > > -- 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 | ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-07-10 8:42 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-07-09 22:28 [PATCH V2] i2c: imx: make bitrate an u32 type Wolfram Sang [not found] ` <1341872910-26687-1-git-send-email-wolfram-z923LK4zBo2bacvFa/9K2g@public.gmane.org> 2012-07-09 23:08 ` Richard Zhao 2012-07-10 8:42 ` Sascha Hauer
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).