[LTP] [PATCH v3 1/2] lib: add a checked-attribute counter to sysfs assert helpers

Li Wang li.wang@linux.dev
Wed Oct 21 05:10:57 CEST 2026


> --- a/lib/tst_sysfs_assert.c
> +++ b/lib/tst_sysfs_assert.c
> @@ -15,6 +15,17 @@
>  #include "tst_test.h"
>  #include "tst_sysfs_assert.h"
>  
> +static unsigned int tst_sysfs_cnt;
> +
> +static int silent_attr_exists(const char *path)
> +{
> +	if (access(path, F_OK))
> +		return 0;
> +
> +	tst_sysfs_cnt++;
> +	return 1;
> +}

After sending out the patch, I realized that the silent_attr_exists()
helper isn't really necessary — we can just add tst_sysfs_cnt++ directly
in the silent functions.

So let me resend v4.

-- 
Regards,
Li Wang


More information about the ltp mailing list