[LTP] lib: Add SAFE_FILE_VPRINTF()

linuxtestproject.agent@gmail.com linuxtestproject.agent@gmail.com
Wed Sep 9 12:35:52 CEST 2026


Hi Andrea,

On Wed, 9 Sep 2026 12:04:48 +0200, Andrea Cervesato <andrea.cervesato@suse.com> wrote:
> [PATCH 1/3] lib: Add SAFE_FILE_VPRINTF()

--- [PATCH 1/3] ---

> +#define SAFE_FILE_VPRINTF(path, fmt, va) \
> +	safe_file_vprintf(__FILE__, __LINE__, NULL, \
> +			  (path), (fmt), (va))

Missing kernel-doc comment for SAFE_FILE_VPRINTF(). Public macros added to
include/tst_safe_file_ops.h must be documented with kernel-doc syntax
recognized by linuxdoc.

--- [PATCH 3/3] ---

> +	if (type == NT_PRPSINFO && descsz >= sizeof(struct elf_prpsinfo)) {
> +		struct elf_prpsinfo info;
> +
> +		memcpy(&info, desc, sizeof(info));
> +		TST_EXP_EQ_STRN(info.pr_fname, "coredump02", sizeof("coredump02"));
> +
> +		prpsinfo_seen = 1;

Using sizeof("coredump02") as the length argument triggers a
-Wsizeof-pointer-memaccess compiler warning from TST_EXP_EQ_STRN(). Use
TST_EXP_EQ_STR(info.pr_fname, "coredump02") since pr_fname is
null-terminated, or pass sizeof(info.pr_fname).

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