* [PATCH] spi: davinci: Fix compilation warning. @ 2017-06-05 12:14 ` Arvind Yadav 0 siblings, 0 replies; 6+ messages in thread From: Arvind Yadav @ 2017-06-05 12:14 UTC (permalink / raw) To: broonie-DgEjT+Ai2ygdnm+yROfE0A Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA If CONFIG_OF is disable, it'll through compilation warning. drivers/spi/spi-davinci.c: In function ‘spi_davinci_get_pdata’: drivers/spi/spi-davinci.c:880:2: warning: return makes pointer from integer without a cast [enabled by default] return -ENODEV; Signed-off-by: Arvind Yadav <arvind.yadav.cs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> --- drivers/spi/spi-davinci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c index 2b0805d..93a4009 100644 --- a/drivers/spi/spi-davinci.c +++ b/drivers/spi/spi-davinci.c @@ -877,7 +877,7 @@ static int spi_davinci_get_pdata(struct platform_device *pdev, *spi_davinci_get_pdata(struct platform_device *pdev, struct davinci_spi *dspi) { - return -ENODEV; + return ERR_PTR(-ENODEV); } #endif -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] spi: davinci: Fix compilation warning. @ 2017-06-05 12:14 ` Arvind Yadav 0 siblings, 0 replies; 6+ messages in thread From: Arvind Yadav @ 2017-06-05 12:14 UTC (permalink / raw) To: broonie; +Cc: linux-spi, linux-kernel If CONFIG_OF is disable, it'll through compilation warning. drivers/spi/spi-davinci.c: In function ‘spi_davinci_get_pdata’: drivers/spi/spi-davinci.c:880:2: warning: return makes pointer from integer without a cast [enabled by default] return -ENODEV; Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> --- drivers/spi/spi-davinci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c index 2b0805d..93a4009 100644 --- a/drivers/spi/spi-davinci.c +++ b/drivers/spi/spi-davinci.c @@ -877,7 +877,7 @@ static int spi_davinci_get_pdata(struct platform_device *pdev, *spi_davinci_get_pdata(struct platform_device *pdev, struct davinci_spi *dspi) { - return -ENODEV; + return ERR_PTR(-ENODEV); } #endif -- 1.9.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
[parent not found: <b6b0d421633c6ea51cdaf3e582f8bebd2034251c.1496664791.git.arvind.yadav.cs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* Re: [PATCH] spi: davinci: Fix compilation warning. 2017-06-05 12:14 ` Arvind Yadav @ 2017-06-05 13:07 ` Geert Uytterhoeven -1 siblings, 0 replies; 6+ messages in thread From: Geert Uytterhoeven @ 2017-06-05 13:07 UTC (permalink / raw) To: Arvind Yadav Cc: Murali Karicheri, Mark Brown, linux-spi, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Hi Arvind, On Mon, Jun 5, 2017 at 2:14 PM, Arvind Yadav <arvind.yadav.cs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > If CONFIG_OF is disable, it'll through compilation warning. > > drivers/spi/spi-davinci.c: In function ‘spi_davinci_get_pdata’: > drivers/spi/spi-davinci.c:880:2: warning: return makes pointer from integer without a cast [enabled by default] > return -ENODEV; > > Signed-off-by: Arvind Yadav <arvind.yadav.cs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > --- > drivers/spi/spi-davinci.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c > index 2b0805d..93a4009 100644 > --- a/drivers/spi/spi-davinci.c > +++ b/drivers/spi/spi-davinci.c > @@ -877,7 +877,7 @@ static int spi_davinci_get_pdata(struct platform_device *pdev, > *spi_davinci_get_pdata(struct platform_device *pdev, > struct davinci_spi *dspi) > { > - return -ENODEV; > + return ERR_PTR(-ENODEV); > } > #endif And you don't get a warning for spi_davinci_probe() doing int ret; ret = spi_davinci_get_pdata(pdev, dspi); ? spi_davinci_get_pdata() returns int if CONFIG_OF, else a pointer. I guess it always should return int instead. It's been like this since the function was introduced, in commit aae7147dfc522062 ("spi/davinci: add OF support for the spi controller"). Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] spi: davinci: Fix compilation warning. @ 2017-06-05 13:07 ` Geert Uytterhoeven 0 siblings, 0 replies; 6+ messages in thread From: Geert Uytterhoeven @ 2017-06-05 13:07 UTC (permalink / raw) To: Arvind Yadav Cc: Murali Karicheri, Mark Brown, linux-spi, linux-kernel@vger.kernel.org Hi Arvind, On Mon, Jun 5, 2017 at 2:14 PM, Arvind Yadav <arvind.yadav.cs@gmail.com> wrote: > If CONFIG_OF is disable, it'll through compilation warning. > > drivers/spi/spi-davinci.c: In function ‘spi_davinci_get_pdata’: > drivers/spi/spi-davinci.c:880:2: warning: return makes pointer from integer without a cast [enabled by default] > return -ENODEV; > > Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> > --- > drivers/spi/spi-davinci.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c > index 2b0805d..93a4009 100644 > --- a/drivers/spi/spi-davinci.c > +++ b/drivers/spi/spi-davinci.c > @@ -877,7 +877,7 @@ static int spi_davinci_get_pdata(struct platform_device *pdev, > *spi_davinci_get_pdata(struct platform_device *pdev, > struct davinci_spi *dspi) > { > - return -ENODEV; > + return ERR_PTR(-ENODEV); > } > #endif And you don't get a warning for spi_davinci_probe() doing int ret; ret = spi_davinci_get_pdata(pdev, dspi); ? spi_davinci_get_pdata() returns int if CONFIG_OF, else a pointer. I guess it always should return int instead. It's been like this since the function was introduced, in commit aae7147dfc522062 ("spi/davinci: add OF support for the spi controller"). Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] spi: davinci: Fix compilation warning. 2017-06-05 13:07 ` Geert Uytterhoeven (?) @ 2017-06-05 13:29 ` Arvind Yadav 2017-06-05 13:37 ` Mark Brown -1 siblings, 1 reply; 6+ messages in thread From: Arvind Yadav @ 2017-06-05 13:29 UTC (permalink / raw) To: Geert Uytterhoeven Cc: Murali Karicheri, Mark Brown, linux-spi, linux-kernel@vger.kernel.org Hi, yes, You are right. we are getting this warning. drivers/spi/spi-davinci.c: In function ‘davinci_spi_probe’: drivers/spi/spi-davinci.c:919:7: warning: assignment makes integer from pointer without a cast [enabled by default] ret = spi_davinci_get_pdata(pdev, dspi); We should return 'int' in both the case. Thanks ~arvind On Monday 05 June 2017 06:37 PM, Geert Uytterhoeven wrote: > Hi Arvind, > > On Mon, Jun 5, 2017 at 2:14 PM, Arvind Yadav <arvind.yadav.cs@gmail.com> wrote: >> If CONFIG_OF is disable, it'll through compilation warning. >> >> drivers/spi/spi-davinci.c: In function ‘spi_davinci_get_pdata’: >> drivers/spi/spi-davinci.c:880:2: warning: return makes pointer from integer without a cast [enabled by default] >> return -ENODEV; >> >> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> >> --- >> drivers/spi/spi-davinci.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c >> index 2b0805d..93a4009 100644 >> --- a/drivers/spi/spi-davinci.c >> +++ b/drivers/spi/spi-davinci.c >> @@ -877,7 +877,7 @@ static int spi_davinci_get_pdata(struct platform_device *pdev, >> *spi_davinci_get_pdata(struct platform_device *pdev, >> struct davinci_spi *dspi) >> { >> - return -ENODEV; >> + return ERR_PTR(-ENODEV); >> } >> #endif > And you don't get a warning for spi_davinci_probe() doing > > int ret; > > ret = spi_davinci_get_pdata(pdev, dspi); > > ? > > spi_davinci_get_pdata() returns int if CONFIG_OF, else a pointer. > I guess it always should return int instead. > > It's been like this since the function was introduced, in commit > aae7147dfc522062 ("spi/davinci: add OF support for the spi controller"). > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like that. > -- Linus Torvalds ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] spi: davinci: Fix compilation warning. 2017-06-05 13:29 ` Arvind Yadav @ 2017-06-05 13:37 ` Mark Brown 0 siblings, 0 replies; 6+ messages in thread From: Mark Brown @ 2017-06-05 13:37 UTC (permalink / raw) To: Arvind Yadav Cc: Geert Uytterhoeven, Murali Karicheri, linux-spi, linux-kernel@vger.kernel.org [-- Attachment #1: Type: text/plain, Size: 436 bytes --] On Mon, Jun 05, 2017 at 06:59:15PM +0530, Arvind Yadav wrote: > Hi, > yes, You are right. we are getting this warning. > drivers/spi/spi-davinci.c: In function ‘davinci_spi_probe’: Please don't top post, reply in line with needed context. This allows readers to readily follow the flow of conversation and understand what you are talking about and also helps ensure that everything in the discussion is being addressed. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 488 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-06-05 13:37 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-05 12:14 [PATCH] spi: davinci: Fix compilation warning Arvind Yadav
2017-06-05 12:14 ` Arvind Yadav
[not found] ` <b6b0d421633c6ea51cdaf3e582f8bebd2034251c.1496664791.git.arvind.yadav.cs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-06-05 13:07 ` Geert Uytterhoeven
2017-06-05 13:07 ` Geert Uytterhoeven
2017-06-05 13:29 ` Arvind Yadav
2017-06-05 13:37 ` Mark Brown
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.