> -----Original Message-----
> From: Richard Cochran <richardcoch...@gmail.com>
> Sent: Wednesday, March 10, 2021 7:12 PM
> To: Erez Geva <erez.geva....@siemens.com>
> Cc: linuxptp-devel@lists.sourceforge.net
> Subject: Re: [Linuxptp-devel] [PATCH 1/2] Explicit length byte order swap
> functions.
>
> On Wed, Mar 10, 2021 at 11:17:48PM +0100, Erez Geva wrote:
> > Replace byte order with explicit length.
> >
> > Add function for byte order for 64 bits.
> >
> > Signed-off-by: Erez Geva <erez.geva....@siemens.com>
> > ---
> > clock.c | 4 +-
> > msg.c | 51 ++++++-------
> > nsm.c | 2 +-
> > port.c | 5 +-
> > raw.c | 10 +--
> > tc.c | 8 +-
> > tlv.c | 207 ++++++++++++++++++++++++++--------------------------
> > transport.c | 9 ++-
> > udp.c | 6 +-
> > udp6.c | 4 +-
> > util.h | 67 +++++++++++++++++
> > 11 files changed, 221 insertions(+), 152 deletions(-)
> >
> > diff --git a/clock.c b/clock.c
> > index 7005636..5b3b4d0 100644
> > --- a/clock.c
> > +++ b/clock.c
> > @@ -255,12 +255,12 @@ void clock_send_notification(struct clock *c, struct
> ptp_message *msg,
> > if (!event_bitmask_get(s->events, event))
> > continue;
> > /* send event */
> > - msg->header.sequenceId = htons(s->sequenceId);
> > + msg->header.sequenceId = hton16(s->sequenceId);
>
> I really don't see any improvement here.
>
> Sorry,
> Richard
>
I'm personally a fan of the bit length being in the name myself, but I don't
think it's worth churn for no other reason.
I also generally prefer "cpu_to_le16" or "cpu_to_be16" instead of hotn.. but
again not worth changing just to rename.
Thanks,
Jake
_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel