From: sashiko-bot@kernel.org
To: "Sean Young" <sean@mess.org>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH v2] selftests/bpf: convert lirc_mode2 to prog_tests and extend coverage
Date: Thu, 20 Aug 2026 21:11:16 +0000 [thread overview]
Message-ID: <20260820211117.26D691F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260820210156.50603-1-sean@mess.org>
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [Low] A stray `?` character before a closing brace causes a compilation error.
- [Low] Multi-line block comments use C++ style `//` instead of the required kernel `/* ... */` style.
- [Low] The printed error message for missing rc devices incorrectly repeats `CONFIG_RC_LOOPBACK`.
--
--- Patch [1]: [PATCH v2] selftests/bpf: convert lirc_mode2 to prog_tests and extend coverage ---
commit b838818703c3bdf7a467c66079361ca289b5a98e
Author: Sean Young <sean@mess.org>
selftests/bpf: convert lirc_mode2 to prog_tests and extend coverage
This patch ports the lirc_mode2 test to the prog_tests framework and extends
its coverage. It tests attaching, querying, and detaching BPF programs to
and from a lirc chardev.
> diff --git a/tools/testing/selftests/bpf/prog_tests/lirc_mode2.c b/tools/testing/selftests/bpf/prog_tests/lirc_mode2.c
> new file mode 100644
> index 0000000000000..8e485db70b78a
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/prog_tests/lirc_mode2.c
> @@ -0,0 +1,334 @@
> +// SPDX-License-Identifier: GPL-2.0
> +// test ir decoder
> +//
> +// Copyright (C) 2018 Sean Young <sean@mess.org>
> +
> +// A lirc chardev is a device representing a consumer IR (cir) device which
> +// can receive infrared signals from remote control and/or transmit IR.
> +//
> +// IR is sent as a series of pulses and space somewhat like morse code. The
> +// BPF program can decode this into scancodes so that rc-core can translate
> +// this into input key codes using the rc keymap.
> +//
> +// This test works by sending IR over rc-loopback, so the IR is processed by
> +// BPF and then decoded into scancodes. The lirc chardev must be the one
> +// associated with rc-loopback, see the output of ir-keytable(1).
> +//
> +// The following CONFIG options must be enabled for the test to succeed:
> +// CONFIG_RC_CORE=y
> +// CONFIG_BPF_RAWIR_EVENT=y
> +// CONFIG_RC_LOOPBACK=y
> +// CONFIG_LIRC=y
[Severity: Low]
Is it possible to use standard C-style multi-line comments (/* ... */) here
instead of C++ style comments? The BPF subsystem guidelines prefer the standard
kernel multi-line comment style.
[ ... ]
> +out:
> + if (!found) {
> + fprintf(stderr, "No rc devices found\n");
> + fprintf(stderr, "Enable CONFIG_RC_LOOPBACK, CONFIG_RC_LOOPBACK, and CONFIG_LIRC\n");
[Severity: Low]
This isn't a bug, but there's a typo here where CONFIG_RC_LOOPBACK is listed
twice in the error message.
> +? }
[Severity: Low]
Is this stray '?' character intended? It appears this will cause a compilation
error when building the selftests.
> +
> + globfree(&gl);
> + return found;
> +}
[ ... ]
> diff --git a/tools/testing/selftests/bpf/progs/lirc_mode2.c b/tools/testing/selftests/bpf/progs/lirc_mode2.c
> new file mode 100644
> index 0000000000000..98137f3c5c03d
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/progs/lirc_mode2.c
> @@ -0,0 +1,32 @@
> +// SPDX-License-Identifier: GPL-2.0
> +// test ir decoder
> +//
> +// Copyright (C) 2018 Sean Young <sean@mess.org>
[Severity: Low]
Similarly here, should this be converted to a standard C-style multi-line
comment block?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260820210156.50603-1-sean@mess.org?part=1
prev parent reply other threads:[~2026-08-20 21:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-20 21:01 [PATCH v2] selftests/bpf: convert lirc_mode2 to prog_tests and extend coverage Sean Young
2026-08-20 21:11 ` sashiko-bot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260820211117.26D691F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=sean@mess.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox