Re: [PATCH] tools/gpio/gpio-event-mon: fix warning

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

 



On Wed, Feb 21, 2018 at 10:33 PM, Anders Roxell
<anders.roxell@xxxxxxxxxx> wrote:

> PRIu64 is defined in user space to match libc's uint64_t definition.
> However, gpioevent_data structure in the kernel is defined using the
> kernel's own __u64 type.
>
> gpio-event-mon.c: In function ‘monitor_device’:
> gpio-event-mon.c:102:19: warning: format ‘%lu’ expects argument of type
>     ‘long unsigned int’, but argument 3 has type ‘__u64 {aka long long
>     unsigned int}’ [-Wformat=]
>    fprintf(stdout, "GPIO EVENT %" PRIu64 ": ", event.timestamp);
>                    ^~~~~~~~~~~~~~
>   LD       /tmp/kselftest/gpiogpio-event-mon-in.o
>   LINK     /tmp/kselftest/gpiogpio-event-mon
>
> Fix is to replace PRIu64 with llu, which we know is what the kernel uses
> for __u64.
>
> Signed-off-by: Anders Roxell <anders.roxell@xxxxxxxxxx>

Patch applied with Daniel's test tag.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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