From f63907a127ed029f35ff9e10b8f62e200d5c73bd Mon Sep 17 00:00:00 2001 From: Vladimir Oltean Date: Tue, 23 Nov 2021 02:14:09 +0200 Subject: [PATCH] pmc_agent: make pmc_agent_query_port_properties take an enum port_state argument Enforce type correctness and make all callers of pmc_agent_query_port_properties pass an enum port_state argument instead of plain int. [ RC: trivial fix up for current git head ] Signed-off-by: Vladimir Oltean Signed-off-by: Richard Cochran --- 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 15dd6893..599f9bd6 100644 --- a/phc2sys.c +++ b/phc2sys.c @@ -299,8 +299,9 @@ 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; char iface[IFNAMSIZ], phc_device[19]; + enum port_state state; struct port *p; clockid_t clkid = CLOCK_INVALID; @@ -824,7 +825,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, phc_index, state, timestamping; + int err, number_ports, phc_index, 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 79971e25..62d1a860 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, int *phc_index, char *iface) { struct port_properties_np *ppn; diff --git a/pmc_agent.h b/pmc_agent.h index ad4b7715..2fb1cc86 100644 --- a/pmc_agent.h +++ b/pmc_agent.h @@ -24,6 +24,7 @@ #include +#include "fsm.h" #include "pmc_common.h" struct pmc_agent; @@ -108,7 +109,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, int *phc_index, char *iface);