firewire: add KUnit test to check layout of UAPI structures
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Mon, 29 May 2023 23:12:39 +0000 (08:12 +0900)
committerTakashi Sakamoto <o-takashi@sakamocchi.jp>
Mon, 29 May 2023 23:12:39 +0000 (08:12 +0900)
commitdc7c51638f4660cc6c72b5c8151970341b6d9587
tree8f5d519725b8bc68faeaeaeacacf99eaf608f691
parent44c026a73be8038f03dbdeef028b642880cf1511
firewire: add KUnit test to check layout of UAPI structures

In future commits, some new structure will be added to express new type
of event. They are exposed to user space as the part of UAPI. It is likely
to get trouble in ioctl compatibility layer for 32 bit binaries in 64 bit
host machine since the layout of structure could differ depending on
System V ABI for these architectures. Actually the subsystem already got
such trouble at v2.6.27. It is preferable to decide the layout of
structure carefully so that the layer is free from such trouble.

This commit utilizes KUnit framework to check the layout of structure for
the purpose. A test is added for the existent issue.

Cc: kunit-dev@googlegroups.com
Link: https://lore.kernel.org/r/20230529113406.986289-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
drivers/firewire/.kunitconfig [new file with mode: 0644]
drivers/firewire/Kconfig
drivers/firewire/Makefile
drivers/firewire/uapi-test.c [new file with mode: 0644]