lkml.org 
[lkml]   [2017]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] leds: pm8058: Silence pointer to integer size warning
On Fri, 01 Dec 2017, Pavel Machek wrote:

> On Fri 2017-12-01 07:57:15, Lee Jones wrote:
> > On Thu, 30 Nov 2017, Bjorn Andersson wrote:
> > > - led->ledtype = (u32)of_device_get_match_data(&pdev->dev);
> > > + led->ledtype = (u32)(unsigned long)of_device_get_match_data(&pdev->dev);
> >
> > Wouldn't (u32)(void *) be even more correct?
> >
> > ... if the compiler will let you get away with it.
>
> Afaict that would still produce the warning. of_device_get_match_data
> already returns void *.

Just tested. It actually still suffers from the original error.

warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]

--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

\
 
 \ /
  Last update: 2017-12-01 09:57    [W:0.060 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site