Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/ir: fix build with ancient kernel headers

Since commit e2bcbd7769ee ("tools headers UAPI: remove stale lirc.h"),
the build of the selftests fails on rhel 8 since its version of
/usr/include/linux/lirc.h has no definition of RC_PROTO_RCMM32, etc [1].

[1] https://lkml.org/lkml/2022/1/28/275

Fixes: e2bcbd7769ee ("tools headers UAPI: remove stale lirc.h")
Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Reported-by: kernel test robot <oliver.sang@intel.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

Sean Young and committed by
Shuah Khan
183f80fd e2aa5e65

+10
+10
tools/testing/selftests/ir/ir_loopback.c
··· 29 29 #define SYSFS_PATH_MAX 256 30 30 #define DNAME_PATH_MAX 256 31 31 32 + /* 33 + * Support ancient lirc.h which does not have these values. Can be removed 34 + * once RHEL 8 is no longer a relevant testing platform. 35 + */ 36 + #if RC_PROTO_MAX < 26 37 + #define RC_PROTO_RCMM12 24 38 + #define RC_PROTO_RCMM24 25 39 + #define RC_PROTO_RCMM32 26 40 + #endif 41 + 32 42 static const struct { 33 43 enum rc_proto proto; 34 44 const char *name;