[LTP] lib: Add SAFE_FILE_VPRINTF()

Andrea Cervesato andrea.cervesato@suse.com
Wed Sep 9 14:05:18 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).

both correct, im gonna send a patch

--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com


More information about the ltp mailing list