lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <211a274a-e7c2-6f74-7ab0-e122240dc8f7@gmail.com>
Date:   Mon, 5 Jun 2017 18:59:15 +0530
From:   Arvind Yadav <arvind.yadav.cs@...il.com>
To:     Geert Uytterhoeven <geert@...ux-m68k.org>
Cc:     Murali Karicheri <m-karicheri2@...com>,
        Mark Brown <broonie@...nel.org>,
        linux-spi <linux-spi@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] spi: davinci: Fix compilation warning.

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@...il.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@...il.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@...ux-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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ