Commit d4c19556 authored by Alessandro Rubini's avatar Alessandro Rubini

userspace/ptpd_netif: remove redundant defines

We returned PTPD_NETIF_ERROR or PTPD_NETIF_OK but the caller was
cheking against 0 (or not checking). Use 0 and -1 removing the names.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 86462168
......@@ -9,9 +9,6 @@
#define PTPD_SOCK_RAW_ETHERNET 1
#define PTPD_SOCK_UDP 2
#define PTPD_NETIF_OK 0
#define PTPD_NETIF_ERROR -1
// GCC-specific
#define PACKED __attribute__((packed))
......
......@@ -183,9 +183,9 @@ int ptpd_netif_init()
{
if (halexp_client_try_connect(HAL_CONNECT_RETRIES, HAL_CONNECT_TIMEOUT)
< 0)
return PTPD_NETIF_ERROR;
return -1;
return PTPD_NETIF_OK;
return 0;
}
wr_socket_t *ptpd_netif_create_socket(int sock_type, int flags,
......@@ -514,7 +514,7 @@ int ptpd_netif_adjust_counters(int64_t adjust_sec, int32_t adjust_nsec)
int cmd;
if (!adjust_nsec && !adjust_sec)
return PTPD_NETIF_OK;
return 0;
if (adjust_sec && adjust_nsec) {
fprintf(stderr,
......@@ -531,7 +531,7 @@ int ptpd_netif_adjust_counters(int64_t adjust_sec, int32_t adjust_nsec)
}
if (!halexp_pps_cmd(cmd, &p))
return PTPD_NETIF_OK;
return 0;
return PTPD_NETIF_ERROR;
return -1;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment