[LTP] rfim: add new test for verifying RFIM sysfs interface
linuxtestproject.agent@gmail.com
linuxtestproject.agent@gmail.com
Tue Jun 16 16:28:04 CEST 2026
Hi Piotr,
On Tue, 16 Jun 2026, Piotr Kubaj wrote:
> rfim: add new test for verifying RFIM sysfs interface
> /*\
> * Validate presence and permissions of RFIM attributes.
> * The test checks first validity of general RFIM attributes,
> * and then checks either DLVR or FIVR, depending on hardware.
> */
The test sets .needs_root = 1 but the doc comment does not explain
why root is required. Other tests in the same directory document
this (e.g. "The test needs root because reading /dev/cpu/N/msr
needs CAP_SYS_RAWIO / root."). Could a line be added explaining
that root is needed for write-access checks on sysfs attributes?
> } else if (!stat(RFIM_ROOT"/fivr", &stats)) {
> if (S_ISDIR(stats.st_mode))
> variant = RFIM_FIVR;
> else
> tst_brk(TBROK, "%s exists but is not a directory", RFIM_ROOT"/fivr");
> } else
> tst_brk(TCONF, "Neither %s nor %s exists", RFIM_ROOT"/dlvr", RFIM_ROOT"/fivr");
The first two branches of this if/else-if/else chain use braces but
the final else does not. Kernel coding style requires braces on all
branches when any branch needs them.
Verdict - Needs revision
---
Note:
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
More information about the ltp
mailing list