[PATCH] selftests/ir: fix build with ancient kernel headers

Sean Young posted 1 patch 4 years, 4 months ago
tools/testing/selftests/ir/ir_loopback.c | 7 +++++++
1 file changed, 7 insertions(+)
[PATCH] selftests/ir: fix build with ancient kernel headers
Posted by Sean Young 4 years, 4 months ago
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.

Fixes: e2bcbd7769ee ("tools headers UAPI: remove stale lirc.h")

Reported-by: kernel test robot <oliver.sang@intel.com>
Signed-off-by: Sean Young <sean@mess.org>
---
 tools/testing/selftests/ir/ir_loopback.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tools/testing/selftests/ir/ir_loopback.c b/tools/testing/selftests/ir/ir_loopback.c
index 06256c96df12..8dc104690adc 100644
--- a/tools/testing/selftests/ir/ir_loopback.c
+++ b/tools/testing/selftests/ir/ir_loopback.c
@@ -29,6 +29,13 @@
 #define SYSFS_PATH_MAX 256
 #define DNAME_PATH_MAX 256
 
+/* Support ancient lirc.h which does not have these values */
+#if RC_PROTO_MAX < 26
+#define RC_PROTO_RCMM12 24
+#define RC_PROTO_RCMM24 25
+#define RC_PROTO_RCMM32 26
+#endif
+
 static const struct {
 	enum rc_proto proto;
 	const char *name;
-- 
2.34.1

Re: [PATCH] selftests/ir: fix build with ancient kernel headers
Posted by Matthew Wilcox 4 years, 4 months ago
On Tue, Feb 01, 2022 at 04:53:11PM +0000, Sean Young wrote:
> +/* Support ancient lirc.h which does not have these values */

Can we have a little more information here, such as "Can be removed once
RHEL 8 is no longer a relevant testing platform"?  That will save people
doing archaology to find out when it's safe to remove.

Re: [PATCH] selftests/ir: fix build with ancient kernel headers
Posted by Sean Young 4 years, 4 months ago
On Tue, Feb 01, 2022 at 04:58:48PM +0000, Matthew Wilcox wrote:
> On Tue, Feb 01, 2022 at 04:53:11PM +0000, Sean Young wrote:
> > +/* Support ancient lirc.h which does not have these values */
> 
> Can we have a little more information here, such as "Can be removed once
> RHEL 8 is no longer a relevant testing platform"?  That will save people
> doing archaology to find out when it's safe to remove.

That totally makes sense.

Having said that, I have no idea what platforms are being used for testing,
so I don't know if RHEL 8 is the only one that needs this. Is there anyone
who could shed some light on what platforms should be supported?

Thanks,

Sean
Re: [PATCH] selftests/ir: fix build with ancient kernel headers
Posted by Shuah Khan 4 years, 4 months ago
On 2/1/22 10:10 AM, Sean Young wrote:
> On Tue, Feb 01, 2022 at 04:58:48PM +0000, Matthew Wilcox wrote:
>> On Tue, Feb 01, 2022 at 04:53:11PM +0000, Sean Young wrote:
>>> +/* Support ancient lirc.h which does not have these values */
>>
>> Can we have a little more information here, such as "Can be removed once
>> RHEL 8 is no longer a relevant testing platform"?  That will save people
>> doing archaology to find out when it's safe to remove.
> 
> That totally makes sense.
> 
> Having said that, I have no idea what platforms are being used for testing,
> so I don't know if RHEL 8 is the only one that needs this. Is there anyone
> who could shed some light on what platforms should be supported?
> 
> Thanks,
> 
> Sean
> 

Sean,

It isn't important on platforms that get tested. We really don't have much
control over the platforms these tests get run.

Let's add a FIXME to remove and also add link to the kbuild thread where with
the discussion.

I am assuming this has to go through bpf since it fixes the commit already
in that tree:

With the change Matthew requested,

Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>

Or I can take this through my tree.

thanks,
-- SHuah