Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751517AbdFENHe (ORCPT ); Mon, 5 Jun 2017 09:07:34 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:35930 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751369AbdFENHd (ORCPT ); Mon, 5 Jun 2017 09:07:33 -0400 MIME-Version: 1.0 In-Reply-To: References: From: Geert Uytterhoeven Date: Mon, 5 Jun 2017 15:07:31 +0200 X-Google-Sender-Auth: jP33I7kK_SslX1kyqAgRO4zbYok Message-ID: Subject: Re: [PATCH] spi: davinci: Fix compilation warning. To: Arvind Yadav Cc: Murali Karicheri , Mark Brown , linux-spi , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v55D7cqV006819 Content-Length: 1671 Lines: 51 Hi Arvind, On Mon, Jun 5, 2017 at 2:14 PM, Arvind Yadav 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 > --- > 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