Re: [pinctrl:devel 85/91] drivers/pinctrl/bcm/pinctrl-ns.c:288:29: warning: cast from pointer to integer of different size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/10/18, Linus Walleij <linus.walleij@xxxxxxxxxx> wrote:
> On Wed, Oct 10, 2018 at 6:03 PM kbuild test robot <lkp@xxxxxxxxx> wrote:
>
>> >> drivers/pinctrl/bcm/pinctrl-ns.c:288:29: warning: cast from pointer to
>> >> integer of different size [-Wpointer-to-int-cast]
>>      ns_pinctrl->chipset_flag = (unsigned int)of_id->data;
>>                                 ^
>>    drivers/pinctrl/bcm/pinctrl-ns.c:310:27: warning: cast from pointer to
>> integer of different size [-Wpointer-to-int-cast]
>>       unsigned int chipsets = (unsigned int)src->drv_data;
>
> Grrr how do we fix this kind of stuff, the unsigned int is probably 32 bit
> on
> 32bit and 64bit on 64 bit.
>
> Just use unsigned long?
>
> Arnd, do you have a quick hint?

I recommend casting to 'uintptr_t', which is guaranteed to be the
same size as a pointer. In practice, 'unsigned long' is also the same,
but uintptr_t documents better what you mean here.

      Arnd



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux