[LTP] tst_kvercmp: Factor out error handling

Petr Vorel pvorel@suse.cz
Wed Aug 12 14:18:38 CEST 2026


> Hi!
> > > > tst_kvercmp: Factor out error handling

> > > --- [PATCH 1/9] ---

> > > > static int _tst_parse_kver(const char *str_kver, int *v1, int *v2, int *v3)

> > > Could this be renamed to parse_kver? File-scope identifiers beginning with an
> > > underscore are reserved by C, and LTP's coding rules prohibit such names.

> > I thought this is wrong, because we have functions with underscore, but it's
> > trailing underscore, not the leading one.

> > => I'll rename to tst_parse_kver_().

> > Also, agent does not know about LTP rule to have functions in lib with leading
> > tst_.

> This is a static function, so the identifier is not visible outside of
> the file, therefore there is no need for the tst_ prefix. On the
> contrary it's better if there is no prefix so that it's clear that it's
> not external API.

OK, agent was correct to user parse_kver().

Kind regards,
Petr


More information about the ltp mailing list