On Thu, Jun 07, 2018 at 09:28:15AM +0000, Anders Selhammer wrote:
> > +static struct unicast_master_address *unicast_client_ok(struct port *p,
> > +                                                   struct ptp_message *m)
> 
> Why use *m some times and *msg sometime?
> Isn“t it better to use only *m or *msg as an inparameter and the other one if 
> declared
> inside a function?

In general, stack variables and parameters should be about three
letters long, as this aids in reading and searching, BUT...

In really simple functions, a single letter variable is fine,
especially if it helps avoid really long lines.

> > +static int unicast_client_peer(struct port *p)
> 
> The naming does not say anything abour renew (like below function)
> Sugguest unicast_client_peer_renew or unicast_client_renew_peer

Sure.

> > +   struct unicast_master_address *ucma
> > +   struct unicast_master_address *peer
> > +   struct unicast_master_address *dst
> > +   struct unicast_master_address *master
> 
> General: Same goes for this, why not use ucma always, find it more easier to 
> read the code
> when the naming has less variations.

Well, these are named to make the role of the variable clear.

> > +   struct grant_unicast_xmit_tlv *g;
> 
> Why not *grant; ?  You have used ack, req and cancel in other functions, not 
> with single letters.

Here it is to avoid super long lines.

Thanks,
Richard


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linuxptp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to