Skip to content

Commit

Permalink
clock: remove redundant parameter from the create method.
Browse files Browse the repository at this point in the history
There is no need for the 'ifaces' parameter since the list of network
interfaces is already present in the configuration.

Signed-off-by: Richard Cochran <[email protected]>
  • Loading branch information
richardcochran committed Apr 3, 2016
1 parent 9b27664 commit bbe55fb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
7 changes: 3 additions & 4 deletions clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -798,8 +798,7 @@ static void clock_remove_port(struct clock *c, struct port *p)
port_close(p);
}

struct clock *clock_create(struct config *config, int phc_index,
struct interfaces_head *ifaces)
struct clock *clock_create(struct config *config, int phc_index)
{
enum timestamp_type timestamping =
config_get_int(config, NULL, "time_stamping");
Expand All @@ -810,7 +809,7 @@ struct clock *clock_create(struct config *config, int phc_index,
unsigned char oui[OUI_LEN];
char phc[32], *tmp;
struct interface *udsif = &c->uds_interface;
struct interface *iface = STAILQ_FIRST(ifaces);
struct interface *iface = STAILQ_FIRST(&config->interfaces);
struct timespec ts;
int sfl;

Expand Down Expand Up @@ -1017,7 +1016,7 @@ struct clock *clock_create(struct config *config, int phc_index,
clock_fda_changed(c);

/* Create the ports. */
STAILQ_FOREACH(iface, ifaces, list) {
STAILQ_FOREACH(iface, &config->interfaces, list) {
if (clock_add_port(c, phc_index, timestamping, iface)) {
pr_err("failed to open port %s", iface->name);
return NULL;
Expand Down
4 changes: 1 addition & 3 deletions clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,9 @@ struct config *clock_config(struct clock *c);
* @param config Pointer to the configuration database.
* @param phc_index PTP hardware clock device to use.
* Pass -1 to select CLOCK_REALTIME.
* @param ifaces A queue of network interfaces.
* @return A pointer to the single global clock instance.
*/
struct clock *clock_create(struct config *config, int phc_index,
struct interfaces_head *ifaces);
struct clock *clock_create(struct config *config, int phc_index);

/**
* Obtains a clock's default data set.
Expand Down
2 changes: 1 addition & 1 deletion ptp4l.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ int main(int argc, char *argv[])
pr_info("selected /dev/ptp%d as PTP clock", phc_index);
}

clock = clock_create(cfg, phc_index, &cfg->interfaces);
clock = clock_create(cfg, phc_index);
if (!clock) {
fprintf(stderr, "failed to create a clock\n");
goto out;
Expand Down

0 comments on commit bbe55fb

Please sign in to comment.