[PATCH v2 0/6] Add GPIO chardev ioctl decoding

Dmitry V. Levin ldv at altlinux.org
Tue Jan 19 19:42:21 UTC 2021

On Mon, Jan 11, 2021 at 11:09:06PM +0800, Kent Gibson wrote:
> This patch set implements decoding of the GPIO character device ioctls
> first added in Linux v4.8, extended in v5.5 and v5.7, and the v2 ioctls
> added in v5.10, and a minor update for v5.11.
> The first patch adds a helper method used to print arrays of uint8,
> as found in the GPIO API.
> The second and third patches add the decoding of the GPIO ioctls and
> corresponding tests.
> the fourth and fifth patches add the decoding of the GPIO v2 ioctls and
> corresponding tests.
> The sixth patch adds decoding of the
> GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME flag which is on track to be added
> in Linux v5.11.

This looks very good, yet I have several more comments (in separate messages).

> There is some duplicate code in gpio_ioctl.c and tests/ioctl_gpio.c to
> allow the complete decoders and tests to compile on old kernels.
> Perhaps that should be relocated into types/gpio.h?

Although we don't normally use types/ in tests (yet?), there is at least
one example I found in tests/ioctl_loop.c where we do exactly that.

So yes, this probably makes sense.


More information about the Strace-devel mailing list