Re: [Linuxptp-devel] [PATCH 4/4] Improve detection of clock_nanosleep

2017-05-21 Thread Richard Cochran
On Mon, May 15, 2017 at 11:37:05PM +0200, Petr Kulhavy wrote: > However it is too weak. On some targets clock_nanosleep is defined > conditionally in #if preprocessor directives. > There is no way to detect that with grep. Is this a configuration option for uClibc? If so, then correct solution is

Re: [Linuxptp-devel] [PATCH] clock: fix possible buffer overrun

2017-05-21 Thread Richard Cochran
On Tue, May 16, 2017 at 04:56:48PM +0200, Petr Kulhavy wrote: > This is not a fix of an actual issue rather than prevention of a potential > issue. > On two places a fixed array size (different to the actual size) is used in > snprintf. > Replace with sizeof(array) I merged this change, but I co

Re: [Linuxptp-devel] [PATCH 1/2] pmc: optimize duplicated code in do_set_action()

2017-05-21 Thread Richard Cochran
On Wed, May 17, 2017 at 03:58:39PM +0200, Petr Kulhavy wrote: > TLV_PRIORITY1 and TLV_PRIORITY2 cases in do_set_action() use the same repeated > piece of generic code for setting one-value parameter. Remove the duplicated > code and let both cases use the same code. > > Signed-off-by: Petr Kulhavy

Re: [Linuxptp-devel] [PATCH 2/2] Implement SET method for DOMAIN

2017-05-21 Thread Richard Cochran
On Wed, May 17, 2017 at 04:08:53PM +0200, Miroslav Lichvar wrote: > On Wed, May 17, 2017 at 03:58:40PM +0200, Petr Kulhavy wrote: > > + case TLV_DOMAIN: > > + mtd = (struct management_tlv_datum *) tlv->data; > > + c->dds.domainNumber = mtd->val; > > + *changed = 1; >

Re: [Linuxptp-devel] [PATCH 2/2] Implement SET method for DOMAIN

2017-05-21 Thread Richard Cochran
On Sun, May 21, 2017 at 10:02:06PM +0200, Richard Cochran wrote: > On Wed, May 17, 2017 at 04:08:53PM +0200, Miroslav Lichvar wrote: > > Shouldn't this also reset the state of the clock? Thinking out loud, the cleanest way might be to introduce a new fault type called "reconfiguration" with a defa

[Linuxptp-devel] [PATCH] phc2sys: fix maybe uninitialized warnings

2017-05-21 Thread Petr Kulhavy
Fix "may be used uninitialized in this function" warnings for state and timestamping. Signed-off-by: Petr Kulhavy --- phc2sys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phc2sys.c b/phc2sys.c index 4c8b552..f3cfed8 100644 --- a/phc2sys.c +++ b/phc2sys.c @@ -1037,7 +1037

Re: [Linuxptp-devel] [PATCH 4/4] Improve detection of clock_nanosleep

2017-05-21 Thread Petr Kulhavy
Hi Richard, the clock_nanosleep test fails in 6 of 49 built targets of Buildroot: br-arm-full-nothread, br-bfin-full, br-m68k-68040-full, br-microblazeel-full, br-openrisc-uclibc, br-sparc-uclibc. They all use uclibc. I'm not a uclibc expert, so I can't answer under what conditions clock_nanos

Re: [Linuxptp-devel] [PATCH 4/4] Improve detection of clock_nanosleep

2017-05-21 Thread Richard Cochran
On Mon, May 22, 2017 at 12:09:06AM +0200, Petr Kulhavy wrote: > I'm not a uclibc expert, so I can't answer under what conditions > clock_nanosleep is defined. TYou would need to ask the uclibc authors. And just who might they be? If you want this to work on uClibc, then *you* could ask them! > B

Re: [Linuxptp-devel] [PATCH] phc2sys: fix maybe uninitialized warnings

2017-05-21 Thread Richard Cochran
On Sun, May 21, 2017 at 10:32:10PM +0200, Petr Kulhavy wrote: > Fix "may be used uninitialized in this function" warnings for state and > timestamping. Please tell us more: What gcc version produces this warning? Is the warning a false positive or not? > @@ -1037,7 +1037,7 @@ static int auto_in