Hi all,
Am 2019-09-26 16:53, schrieb Erik Hons:
Hi Yangbo,
> > May I have your suggestion here? To maintain gPTP time in software,
> > I just copied kernel timecounter code into linuxptp for usage.
>
> Why? That sounds wrong.
Regarding to physical clock adjustment, that's confusing. This wil
Signed-off-by: Richard Cochran
---
clock.c | 2 +-
port.c | 17 ++---
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/clock.c b/clock.c
index 5001e66..71b3899 100644
--- a/clock.c
+++ b/clock.c
@@ -976,7 +976,7 @@ struct clock *clock_create(enum clock_type type, stru
When compiling with gcc8 and -O2, the clever compiler complains:
interface.c: In function ‘interface_ensure_tslabel’:
interface.c:38:3: error: ‘strncpy’ output may be truncated copying 108 bytes
from a string of length 108 [-Werror=stringop-truncation]
Even though this is a false positive,
Using gcc8 and -O2, the compiler emits an annoying false positive
warning. Since I want to have -Werror, I went about fixing it. Start
pulling on a thread, and ...
The 'struct interface' is wide open to its users, and each user
fiddles with the fields in a different way. The cure is, of course,
The function to open a posix clock never modifies the passed in
string. This patch adds the const keyword to ensure this function
stays that way.
Signed-off-by: Richard Cochran
---
util.c | 2 +-
util.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/util.c b/util.c
index
Signed-off-by: Richard Cochran
---
clock.c | 4 ++--
port.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/clock.c b/clock.c
index 71b3899..845e27a 100644
--- a/clock.c
+++ b/clock.c
@@ -956,7 +956,7 @@ struct clock *clock_create(enum clock_type type, struct
config *co
Signed-off-by: Richard Cochran
---
clock.c | 2 +-
port.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/clock.c b/clock.c
index 845e27a..71b5795 100644
--- a/clock.c
+++ b/clock.c
@@ -957,7 +957,7 @@ struct clock *clock_create(enum clock_type type, struct
config *config
Signed-off-by: Richard Cochran
---
pmc_common.c | 19 ---
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/pmc_common.c b/pmc_common.c
index 41181fb..3aab4b9 100644
--- a/pmc_common.c
+++ b/pmc_common.c
@@ -313,6 +313,7 @@ struct pmc {
struct PortIdentity tar
Signed-off-by: Richard Cochran
---
config.c | 6 ++
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/config.c b/config.c
index 717ee65..e033842 100644
--- a/config.c
+++ b/config.c
@@ -829,13 +829,11 @@ struct interface *config_create_interface(const char
*name, struct config *c
Signed-off-by: Richard Cochran
---
interface.c | 5 +
interface.h | 7 +++
2 files changed, 12 insertions(+)
diff --git a/interface.c b/interface.c
index d7eeb41..02f63a0 100644
--- a/interface.c
+++ b/interface.c
@@ -28,6 +28,11 @@ const char *interface_name(struct interface *iface)
In many cases, the time stamping label will be the same as the name of
the interface. In order to prevent users from open coding the logic that
initializes the label from the interface name, this patch add an
appropriate method.
Signed-off-by: Richard Cochran
---
interface.c | 7 +++
interf
Signed-off-by: Richard Cochran
---
clock.c | 5 +++--
config.c | 2 +-
pmc_common.c | 2 +-
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/clock.c b/clock.c
index 3895d09..159fcb2 100644
--- a/clock.c
+++ b/clock.c
@@ -850,6 +850,7 @@ struct clock *clock_create(enum clock
Signed-off-by: Richard Cochran
---
clock.c | 17 +
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/clock.c b/clock.c
index 71b5795..e5f104e 100644
--- a/clock.c
+++ b/clock.c
@@ -122,7 +122,7 @@ struct clock {
struct clock_stats stats;
int stats_inter
Signed-off-by: Richard Cochran
---
interface.c | 8
interface.h | 8
2 files changed, 16 insertions(+)
diff --git a/interface.c b/interface.c
index 7a3eddc..74a2512 100644
--- a/interface.c
+++ b/interface.c
@@ -47,3 +47,11 @@ bool interface_tsinfo_valid(struct interface *iface
Signed-off-by: Richard Cochran
---
clock.c | 2 +-
port.c | 17 ++---
raw.c | 5 +++--
udp.c | 2 +-
udp6.c | 2 +-
5 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/clock.c b/clock.c
index 7d13b3b..66c6bc1 100644
--- a/clock.c
+++ b/clock.c
@@ -962,7 +962,7 @
The two methods, config_create_interface and config_read, never modify the
strings passed in. This patch adds the const keyword to ensure these
functions stay that way.
Signed-off-by: Richard Cochran
---
config.c | 4 ++--
config.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
dif
Many of the users only require a read only reference to the time
stamping label of the interface. This patch adds an appropriate
method.
Signed-off-by: Richard Cochran
---
interface.c | 5 +
interface.h | 9 +
2 files changed, 14 insertions(+)
diff --git a/interface.c b/interface.c
Signed-off-by: Richard Cochran
---
clock.c | 6 --
nsm.c | 5 -
port.c | 2 +-
rtnl.c | 2 +-
rtnl.h | 4 +++-
5 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/clock.c b/clock.c
index 159fcb2..5001e66 100644
--- a/clock.c
+++ b/clock.c
@@ -846,6 +846,7 @@ struct clock
In order to eventually hide the implementation details of the interface,
users will need to be able to create and destroy instances thereof. This
patch adds the needed methods.
Signed-off-by: Richard Cochran
---
interface.c | 19 +++
interface.h | 13 +
2 files chang
The name field of the interface is set in different ways by different
callers. In order to prevent users from open coding the logic that sets
the name, this patch adds an appropriate method.
Signed-off-by: Richard Cochran
---
interface.c | 5 +
interface.h | 8 +++-
2 files changed, 12
Now that a complete functional API is in place, there is no need to expose
the inner workings of the network interface data type. This patch converts
it into an opaque type while leaving the list marker visible to users
through a simple form of "friendly exposition".
Signed-off-by: Richard Cochra
In order to prevent users from open coding this logic, this patch
provides a method that populates the time stamping information from
the interface label.
Signed-off-by: Richard Cochran
---
interface.c | 5 +
interface.h | 7 +++
2 files changed, 12 insertions(+)
diff --git a/interface.
Now that all call sites have been converted to interface_create(), there
is no longer any needed for a way to set the interface's name. This patch
removes the useless method.
Signed-off-by: Richard Cochran
---
interface.c | 7 +--
interface.h | 7 ---
2 files changed, 1 insertion(+), 13
Signed-off-by: Richard Cochran
---
interface.c | 5 +
interface.h | 8
2 files changed, 13 insertions(+)
diff --git a/interface.c b/interface.c
index 02f63a0..7a3eddc 100644
--- a/interface.c
+++ b/interface.c
@@ -42,3 +42,8 @@ void interface_set_name(struct interface *iface, const
Any program that links to the servo interface must also link with the
implementations of that interface. Similarly, the filter and network
transport interfaces each require their implementations. This patch
re-factors the makefile to reflect this fact in order to simplify
adding new programs maki
Signed-off-by: Richard Cochran
---
clock.c| 21 +++--
config.c | 12 +++-
makefile | 10 +-
nsm.c | 9 +
pmc_common.c | 2 +-
port.c | 19 +++
port_private.h | 2 +-
udp.c | 2 +-
udp6.c
Signed-off-by: Richard Cochran
---
clock.c | 12 +---
nsm.c| 4 +---
pmc_common.c | 4 +---
3 files changed, 3 insertions(+), 17 deletions(-)
diff --git a/clock.c b/clock.c
index f987965..3895d09 100644
--- a/clock.c
+++ b/clock.c
@@ -842,16 +842,6 @@ int clock_required_mo
The ts_label field of the interface is set in different ways by different
callers. In order to prevent users from open coding the logic that sets
the label, this patch adds an appropriate method.
Signed-off-by: Richard Cochran
---
interface.c | 5 +
interface.h | 7 +++
2 files changed,
Signed-off-by: Richard Cochran
---
clock.c | 2 +-
port.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/clock.c b/clock.c
index 66c6bc1..f987965 100644
--- a/clock.c
+++ b/clock.c
@@ -962,7 +962,7 @@ struct clock *clock_create(enum clock_type type, struct
config *config
Many of the users only require a read only reference to the interface name.
This patch adds an appropriate method.
Signed-off-by: Richard Cochran
---
interface.c | 12
interface.h | 7 +++
makefile| 8
3 files changed, 23 insertions(+), 4 deletions(-)
create mode
Up until now, the users of the interface data structure simply access
its fields without restriction. This patch takes the first step
towards abstracting this data structure by giving it a file of its
very own.
Signed-off-by: Richard Cochran
---
config.h| 15 +--
interface.h | 2
Three of the rtnl methods never modify the strings passed in. This
patch adds the const keyword to ensure these functions stay that way.
Signed-off-by: Richard Cochran
---
rtnl.c | 6 +++---
rtnl.h | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/rtnl.c b/rtnl.c
index
32 matches
Mail list logo