diff options
author | Antonio Quartulli <ordex@autistici.org> | 2012-12-25 07:14:37 -0500 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2013-01-19 08:18:09 -0500 |
commit | 7241444209f88f804ea33483394a601c1afb1d64 (patch) | |
tree | 28f2b2dae11c5367182eec51d9ad2ff422217406 /net/batman-adv/bridge_loop_avoidance.c | |
parent | 1ad759d8479b4b28f2a6c874d380066cf987b341 (diff) |
batman-adv: a delayed_work has to be initialised once
A delayed_work struct does not need to be initialized each
every time before being enqueued. Therefore the
INIT_DELAYED_WORK() macro should be used during the
initialization process only.
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Diffstat (limited to 'net/batman-adv/bridge_loop_avoidance.c')
-rw-r--r-- | net/batman-adv/bridge_loop_avoidance.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c index 5e834c1df469..bb5fbd64dc28 100644 --- a/net/batman-adv/bridge_loop_avoidance.c +++ b/net/batman-adv/bridge_loop_avoidance.c | |||
@@ -1100,16 +1100,6 @@ void batadv_bla_update_orig_address(struct batadv_priv *bat_priv, | |||
1100 | } | 1100 | } |
1101 | } | 1101 | } |
1102 | 1102 | ||
1103 | |||
1104 | |||
1105 | /* (re)start the timer */ | ||
1106 | static void batadv_bla_start_timer(struct batadv_priv *bat_priv) | ||
1107 | { | ||
1108 | INIT_DELAYED_WORK(&bat_priv->bla.work, batadv_bla_periodic_work); | ||
1109 | queue_delayed_work(batadv_event_workqueue, &bat_priv->bla.work, | ||
1110 | msecs_to_jiffies(BATADV_BLA_PERIOD_LENGTH)); | ||
1111 | } | ||
1112 | |||
1113 | /* periodic work to do: | 1103 | /* periodic work to do: |
1114 | * * purge structures when they are too old | 1104 | * * purge structures when they are too old |
1115 | * * send announcements | 1105 | * * send announcements |
@@ -1180,7 +1170,8 @@ out: | |||
1180 | if (primary_if) | 1170 | if (primary_if) |
1181 | batadv_hardif_free_ref(primary_if); | 1171 | batadv_hardif_free_ref(primary_if); |
1182 | 1172 | ||
1183 | batadv_bla_start_timer(bat_priv); | 1173 | queue_delayed_work(batadv_event_workqueue, &bat_priv->bla.work, |
1174 | msecs_to_jiffies(BATADV_BLA_PERIOD_LENGTH)); | ||
1184 | } | 1175 | } |
1185 | 1176 | ||
1186 | /* The hash for claim and backbone hash receive the same key because they | 1177 | /* The hash for claim and backbone hash receive the same key because they |
@@ -1238,7 +1229,10 @@ int batadv_bla_init(struct batadv_priv *bat_priv) | |||
1238 | 1229 | ||
1239 | batadv_dbg(BATADV_DBG_BLA, bat_priv, "bla hashes initialized\n"); | 1230 | batadv_dbg(BATADV_DBG_BLA, bat_priv, "bla hashes initialized\n"); |
1240 | 1231 | ||
1241 | batadv_bla_start_timer(bat_priv); | 1232 | INIT_DELAYED_WORK(&bat_priv->bla.work, batadv_bla_periodic_work); |
1233 | |||
1234 | queue_delayed_work(batadv_event_workqueue, &bat_priv->bla.work, | ||
1235 | msecs_to_jiffies(BATADV_BLA_PERIOD_LENGTH)); | ||
1242 | return 0; | 1236 | return 0; |
1243 | } | 1237 | } |
1244 | 1238 | ||