Re: [Linuxptp-devel] [PATCH v3 08/11] port: event notification

2014-05-05 Thread Jiri Benc
On Sat, 3 May 2014 20:49:16 +0200, Richard Cochran wrote:
> On Fri, May 02, 2014 at 12:37:51PM +0200, Jiri Benc wrote:
> > Split management message creation to more fine-grained functions to allow
> > notification messages to be created.
> 
> I must admit I didn't understand what you did, at first reading. Can
> you lose a few words about how you split the code and why?
> 
> Is it that the 'fill' method is shared by regular management replies
> and by the event notifiers?

Yes. And I wanted to avoid code duplication, thus I extracted the
generic part of port_management_get_response to a separate function.

The new port_management_fill_response is called from
port_management_get_response (so the function behaves exactly the same
as before this patch) and from a new port_notify_event function. The
difference is port_management_get_response uses the request message to
construct the reply message, while port_notify_event constructs the
reply message based on the notification id.

> > +struct ptp_message *port_management_reply(struct PortIdentity pid,
> > + struct port *ingress,
> > + struct ptp_message *req)
> > +{
> > +   UInteger8 boundaryHops;
> > +
> > +   boundaryHops = req->management.startingBoundaryHops - 
> > req->management.boundaryHops;
> 
> Line too long.

Will split it.

 Jiri

-- 
Jiri Benc

--
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity
• Requirements for releasing software faster
• Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel


Re: [Linuxptp-devel] [PATCH v3 08/11] port: event notification

2014-05-03 Thread Richard Cochran
On Fri, May 02, 2014 at 12:37:51PM +0200, Jiri Benc wrote:
> Split management message creation to more fine-grained functions to allow
> notification messages to be created.

I must admit I didn't understand what you did, at first reading. Can
you lose a few words about how you split the code and why?

Is it that the 'fill' method is shared by regular management replies
and by the event notifiers?

...

> +struct ptp_message *port_management_reply(struct PortIdentity pid,
> +   struct port *ingress,
> +   struct ptp_message *req)
> +{
> + UInteger8 boundaryHops;
> +
> + boundaryHops = req->management.startingBoundaryHops - 
> req->management.boundaryHops;

Line too long.

Thanks,
Richard

--
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel