On Mon, 8 Aug 2022 at 12:36, Miroslav Lichvar <mlich...@redhat.com> wrote:
> On Mon, Aug 08, 2022 at 12:20:30PM +0200, Erez wrote: > > On Mon, 8 Aug 2022 at 11:56, Magnus Armholt <magnus.armh...@gmail.com> > > wrote: > > > +static int has_prp_trailer(unsigned char *ptr, int cnt, int eth_hlen) > > > > > > > A POSIX function usually uses 0 as success and negative on failure. > > In order to avoid confusion, it is better to use the boolean type here. > > You may include <stdbool.h> to define the type. > > There are other is_* and has_* functions that return 1 for true. It's > not a success or failure. If they should be declared as boolean, it > bool is used. For example in "interface.h" bool interface_tsinfo_valid(struct interface *iface); "_valid" does suggest boolean, though might be ambiguous. "is_" is the best choice for boolean value. > would be nice to convert them all avoid confusion. > Richard usually does not require rebase of all code to a single convention. For example, new code uses the SPDX tags, while old code does not. The question is not if other code uses it, but what is better. Though the function name suggests boolean. I think we should do both, to make code clearer and more readable. It also makes the patch more coherent. Erez > -- > Miroslav Lichvar > >
_______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel