From 1b8dc451e866f221a1d0dfbd28b31f28833600d9 Mon Sep 17 00:00:00 2001 From: Jiri Pirko Date: Sun, 5 Aug 2012 16:18:50 +0200 Subject: [PATCH] teamd: get rid of link_watch_handler Signed-off-by: Jiri Pirko --- teamd/teamd.h | 9 --------- teamd/teamd_link_watch.c | 19 +------------------ 2 files changed, 1 insertion(+), 27 deletions(-) diff --git a/teamd/teamd.h b/teamd/teamd.h index 0a19a42..b424562 100644 --- a/teamd/teamd.h +++ b/teamd/teamd.h @@ -53,8 +53,6 @@ enum teamd_command { struct teamd_runner; struct teamd_context; -typedef int (*teamd_link_watch_handler_t)(struct teamd_context *ctx); - struct teamd_context { enum teamd_command cmd; bool daemonize; @@ -69,7 +67,6 @@ struct teamd_context { struct team_handle * th; const struct teamd_runner * runner; void * runner_priv; - teamd_link_watch_handler_t link_watch_handler; struct list_item port_obj_list; unsigned int port_obj_list_count; struct list_item option_watch_list; @@ -235,12 +232,6 @@ bool teamd_link_watch_port_up(struct teamd_context *ctx, int teamd_link_watch_init(struct teamd_context *ctx); void teamd_link_watch_fini(struct teamd_context *ctx); -static inline void teamd_link_watch_set_handler(struct teamd_context *ctx, - teamd_link_watch_handler_t handler) -{ - ctx->link_watch_handler = handler; -} - int teamd_option_watch_init(struct teamd_context *ctx); void teamd_option_watch_fini(struct teamd_context *ctx); diff --git a/teamd/teamd_link_watch.c b/teamd/teamd_link_watch.c index 35c7e14..9944e8a 100644 --- a/teamd/teamd_link_watch.c +++ b/teamd/teamd_link_watch.c @@ -196,8 +196,6 @@ lw_psr_ppriv_get(struct lw_common_port_priv *common_ppriv) return (struct lw_psr_port_priv *) common_ppriv; } -static int call_link_watch_handler(struct teamd_context *ctx); - static int lw_psr_callback_periodic(struct teamd_context *ctx, int events, void *func_priv) { @@ -224,9 +222,6 @@ static int lw_psr_callback_periodic(struct teamd_context *ctx, int events, teamd_log_info("%s: %s-link went %s.", tdport->ifname, lw_name, psr_ppriv->link_up ? "up" : "down"); err = teamd_event_port_link_changed(ctx, tdport); - if (err) - return err; - err = call_link_watch_handler(ctx); if (err) return err; err = team_set_port_user_linkup(ctx->th, @@ -891,13 +886,6 @@ static const struct teamd_link_watch *teamd_find_link_watch(const char *link_wat return NULL; } -static int call_link_watch_handler(struct teamd_context *ctx) -{ - if (ctx->link_watch_handler) - return ctx->link_watch_handler(ctx); - return 0; -} - bool teamd_link_watch_port_up(struct teamd_context *ctx, struct teamd_port *tdport) { @@ -970,12 +958,7 @@ static int link_watch_event_watch_port_changed(struct teamd_context *ctx, struct teamd_port *tdport, void *priv) { - int err; - - err = teamd_event_port_link_changed(ctx, tdport); - if (err) - return err; - return call_link_watch_handler(ctx); + return teamd_event_port_link_changed(ctx, tdport); } static const struct teamd_event_watch_ops link_watch_port_watch_ops = {