diff options
author | Antonio Quartulli <ordex@autistici.org> | 2012-12-25 13:14:37 +0100 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2013-01-19 21:18:09 +0800 |
commit | 7241444209f88f804ea33483394a601c1afb1d64 (patch) | |
tree | 28f2b2dae11c5367182eec51d9ad2ff422217406 /net/batman-adv/send.c | |
parent | 1ad759d8479b4b28f2a6c874d380066cf987b341 (diff) | |
download | op-kernel-dev-7241444209f88f804ea33483394a601c1afb1d64.zip op-kernel-dev-7241444209f88f804ea33483394a601c1afb1d64.tar.gz |
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/send.c')
-rw-r--r-- | net/batman-adv/send.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c index 89810ce..0b6f65b 100644 --- a/net/batman-adv/send.c +++ b/net/batman-adv/send.c @@ -155,8 +155,6 @@ _batadv_add_bcast_packet_to_list(struct batadv_priv *bat_priv, spin_unlock_bh(&bat_priv->forw_bcast_list_lock); /* start timer for this packet */ - INIT_DELAYED_WORK(&forw_packet->delayed_work, - batadv_send_outstanding_bcast_packet); queue_delayed_work(batadv_event_workqueue, &forw_packet->delayed_work, send_time); } @@ -210,6 +208,9 @@ int batadv_add_bcast_packet_to_list(struct batadv_priv *bat_priv, /* how often did we send the bcast packet ? */ forw_packet->num_packets = 0; + INIT_DELAYED_WORK(&forw_packet->delayed_work, + batadv_send_outstanding_bcast_packet); + _batadv_add_bcast_packet_to_list(bat_priv, forw_packet, delay); return NETDEV_TX_OK; |