Re: [Linuxptp-devel] [PATCH RFC 21/30] Convert call sites to the proper method for testing time stamp info validity.

2020-02-18 Thread Jacob Keller



On 2/11/2020 6:04 AM, Richard Cochran wrote:
> Signed-off-by: Richard Cochran 

Straight forward.

Reviewed-by: Jacob Keller 

> ---
>  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 *config,
>   interface_set_label(iface, ts_label);
>   interface_ensure_tslabel(iface);
>   interface_get_tsinfo(iface);
> - if (iface->ts_info.valid &&
> + if (interface_tsinfo_valid(iface) &&
>   ((iface->ts_info.so_timestamping & required_modes) != 
> required_modes)) {
>   pr_err("interface '%s' does not support requested 
> timestamping mode",
>  interface_name(iface));
> @@ -975,7 +975,7 @@ struct clock *clock_create(enum clock_type type, struct 
> config *config,
>   if (1 != sscanf(phc_device, "/dev/ptp%d", &phc_index)) {
>   phc_index = -1;
>   }
> - } else if (iface->ts_info.valid) {
> + } else if (interface_tsinfo_valid(iface)) {
>   phc_index = interface_phc_index(iface);
>   } else {
>   pr_err("PTP device not specified and automatic determination"
> diff --git a/port.c b/port.c
> index f4834ba..b590024 100644
> --- a/port.c
> +++ b/port.c
> @@ -2511,7 +2511,7 @@ void port_link_status(void *ctx, int linkup, int 
> ts_index)
>   interface_get_tsinfo(p->iface);
>  
>   /* Only switch phc with HW time stamping mode */
> - if (p->iface->ts_info.valid &&
> + if (interface_tsinfo_valid(p->iface) &&
>   interface_phc_index(p->iface) >= 0) {
>   required_modes = clock_required_modes(p->clock);
>   if ((p->iface->ts_info.so_timestamping & 
> required_modes) != required_modes) {
> @@ -3001,7 +3001,7 @@ struct port *port_open(const char *phc_device,
>  
>   if (transport == TRANS_UDS) {
>   ; /* UDS cannot have a PHC. */
> - } else if (!interface->ts_info.valid) {
> + } else if (!interface_tsinfo_valid(interface)) {
>   pr_warning("port %d: get_ts_info not supported", number);
>   } else if (phc_index >= 0 &&
>  phc_index != interface_phc_index(interface)) {
> 


___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel


[Linuxptp-devel] [PATCH RFC 21/30] Convert call sites to the proper method for testing time stamp info validity.

2020-02-11 Thread Richard Cochran
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 *config,
interface_set_label(iface, ts_label);
interface_ensure_tslabel(iface);
interface_get_tsinfo(iface);
-   if (iface->ts_info.valid &&
+   if (interface_tsinfo_valid(iface) &&
((iface->ts_info.so_timestamping & required_modes) != 
required_modes)) {
pr_err("interface '%s' does not support requested 
timestamping mode",
   interface_name(iface));
@@ -975,7 +975,7 @@ struct clock *clock_create(enum clock_type type, struct 
config *config,
if (1 != sscanf(phc_device, "/dev/ptp%d", &phc_index)) {
phc_index = -1;
}
-   } else if (iface->ts_info.valid) {
+   } else if (interface_tsinfo_valid(iface)) {
phc_index = interface_phc_index(iface);
} else {
pr_err("PTP device not specified and automatic determination"
diff --git a/port.c b/port.c
index f4834ba..b590024 100644
--- a/port.c
+++ b/port.c
@@ -2511,7 +2511,7 @@ void port_link_status(void *ctx, int linkup, int ts_index)
interface_get_tsinfo(p->iface);
 
/* Only switch phc with HW time stamping mode */
-   if (p->iface->ts_info.valid &&
+   if (interface_tsinfo_valid(p->iface) &&
interface_phc_index(p->iface) >= 0) {
required_modes = clock_required_modes(p->clock);
if ((p->iface->ts_info.so_timestamping & 
required_modes) != required_modes) {
@@ -3001,7 +3001,7 @@ struct port *port_open(const char *phc_device,
 
if (transport == TRANS_UDS) {
; /* UDS cannot have a PHC. */
-   } else if (!interface->ts_info.valid) {
+   } else if (!interface_tsinfo_valid(interface)) {
pr_warning("port %d: get_ts_info not supported", number);
} else if (phc_index >= 0 &&
   phc_index != interface_phc_index(interface)) {
-- 
2.20.1



___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel