Enforce type correctness and make all callers of pmc_agent_query_port_properties
pass an enum port_state argument instead of plain int.

Signed-off-by: Vladimir Oltean <olte...@gmail.com>
---
v4->v5: patch is new

 phc2sys.c   | 6 ++++--
 pmc_agent.c | 2 +-
 pmc_agent.h | 3 ++-
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/phc2sys.c b/phc2sys.c
index 6815c3dee8a0..786831cd3112 100644
--- a/phc2sys.c
+++ b/phc2sys.c
@@ -292,7 +292,8 @@ static struct port *port_add(struct phc2sys_private *priv, 
unsigned int number,
 static void clock_reinit(struct phc2sys_private *priv, struct clock *clock,
                         int new_state)
 {
-       int err = -1, phc_index = -1, phc_switched = 0, state, timestamping;
+       int err = -1, phc_index = -1, phc_switched = 0, timestamping;
+       enum port_state state;
        struct port *p;
        struct sk_ts_info ts_info;
        char iface[IFNAMSIZ];
@@ -844,7 +845,8 @@ static int phc2sys_recv_subscribed(void *context, struct 
ptp_message *msg,
 
 static int auto_init_ports(struct phc2sys_private *priv, int add_rt)
 {
-       int err, number_ports, state, timestamping;
+       int err, number_ports, timestamping;
+       enum port_state state;
        char iface[IFNAMSIZ];
        struct clock *clock;
        struct port *port;
diff --git a/pmc_agent.c b/pmc_agent.c
index 86350d8e6fd1..0dc99a4a83b5 100644
--- a/pmc_agent.c
+++ b/pmc_agent.c
@@ -303,7 +303,7 @@ int pmc_agent_query_dds(struct pmc_agent *node, int timeout)
 }
 
 int pmc_agent_query_port_properties(struct pmc_agent *node, int timeout,
-                                   unsigned int port, int *state,
+                                   unsigned int port, enum port_state *state,
                                    int *tstamping, char *iface)
 {
        struct port_properties_np *ppn;
diff --git a/pmc_agent.h b/pmc_agent.h
index 11b93479fb0b..43738fa71fe5 100644
--- a/pmc_agent.h
+++ b/pmc_agent.h
@@ -24,6 +24,7 @@
 
 #include <stdbool.h>
 
+#include "fsm.h"
 #include "pmc_common.h"
 
 struct pmc_agent;
@@ -107,7 +108,7 @@ int pmc_agent_query_dds(struct pmc_agent *agent, int 
timeout);
  * @return           Zero on success, negative error code otherwise.
  */
 int pmc_agent_query_port_properties(struct pmc_agent *agent, int timeout,
-                                   unsigned int port, int *state,
+                                   unsigned int port, enum port_state *state,
                                    int *tstamping, char *iface);
 
 /**
-- 
2.25.1



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

Reply via email to