diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2009-10-01 22:40:07 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-02 13:54:05 -0400 |
commit | f1489cfb173509a3c13444b46b6c989bad4f5b16 (patch) | |
tree | cd8fc93b73081e358371b9852c7b62cb02516ded | |
parent | 18366b05a00349c1606269ba7422bf9b3a357ff2 (diff) |
connector: Removed the destruct_data callback since it is always kfree_skb()
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Acked-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/connector/cn_queue.c | 4 | ||||
-rw-r--r-- | drivers/connector/connector.c | 11 | ||||
-rw-r--r-- | include/linux/connector.h | 3 |
3 files changed, 5 insertions, 13 deletions
diff --git a/drivers/connector/cn_queue.c b/drivers/connector/cn_queue.c index 163c3e3d0d11..210338ea222f 100644 --- a/drivers/connector/cn_queue.c +++ b/drivers/connector/cn_queue.c | |||
@@ -83,8 +83,8 @@ void cn_queue_wrapper(struct work_struct *work) | |||
83 | 83 | ||
84 | d->callback(msg, nsp); | 84 | d->callback(msg, nsp); |
85 | 85 | ||
86 | d->destruct_data(d->ddata); | 86 | kfree_skb(d->skb); |
87 | d->ddata = NULL; | 87 | d->skb = NULL; |
88 | 88 | ||
89 | kfree(d->free); | 89 | kfree(d->free); |
90 | } | 90 | } |
diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c index e59f0ab8f828..f06024668f99 100644 --- a/drivers/connector/connector.c +++ b/drivers/connector/connector.c | |||
@@ -129,7 +129,7 @@ EXPORT_SYMBOL_GPL(cn_netlink_send); | |||
129 | /* | 129 | /* |
130 | * Callback helper - queues work and setup destructor for given data. | 130 | * Callback helper - queues work and setup destructor for given data. |
131 | */ | 131 | */ |
132 | static int cn_call_callback(struct sk_buff *skb, void (*destruct_data)(void *), void *data) | 132 | static int cn_call_callback(struct sk_buff *skb) |
133 | { | 133 | { |
134 | struct cn_callback_entry *__cbq, *__new_cbq; | 134 | struct cn_callback_entry *__cbq, *__new_cbq; |
135 | struct cn_dev *dev = &cdev; | 135 | struct cn_dev *dev = &cdev; |
@@ -140,12 +140,9 @@ static int cn_call_callback(struct sk_buff *skb, void (*destruct_data)(void *), | |||
140 | list_for_each_entry(__cbq, &dev->cbdev->queue_list, callback_entry) { | 140 | list_for_each_entry(__cbq, &dev->cbdev->queue_list, callback_entry) { |
141 | if (cn_cb_equal(&__cbq->id.id, &msg->id)) { | 141 | if (cn_cb_equal(&__cbq->id.id, &msg->id)) { |
142 | if (likely(!work_pending(&__cbq->work) && | 142 | if (likely(!work_pending(&__cbq->work) && |
143 | __cbq->data.ddata == NULL)) { | 143 | __cbq->data.skb == NULL)) { |
144 | __cbq->data.skb = skb; | 144 | __cbq->data.skb = skb; |
145 | 145 | ||
146 | __cbq->data.ddata = data; | ||
147 | __cbq->data.destruct_data = destruct_data; | ||
148 | |||
149 | if (queue_cn_work(__cbq, &__cbq->work)) | 146 | if (queue_cn_work(__cbq, &__cbq->work)) |
150 | err = 0; | 147 | err = 0; |
151 | else | 148 | else |
@@ -159,8 +156,6 @@ static int cn_call_callback(struct sk_buff *skb, void (*destruct_data)(void *), | |||
159 | d = &__new_cbq->data; | 156 | d = &__new_cbq->data; |
160 | d->skb = skb; | 157 | d->skb = skb; |
161 | d->callback = __cbq->data.callback; | 158 | d->callback = __cbq->data.callback; |
162 | d->ddata = data; | ||
163 | d->destruct_data = destruct_data; | ||
164 | d->free = __new_cbq; | 159 | d->free = __new_cbq; |
165 | 160 | ||
166 | __new_cbq->pdev = __cbq->pdev; | 161 | __new_cbq->pdev = __cbq->pdev; |
@@ -208,7 +203,7 @@ static void cn_rx_skb(struct sk_buff *__skb) | |||
208 | return; | 203 | return; |
209 | } | 204 | } |
210 | 205 | ||
211 | err = cn_call_callback(skb, (void (*)(void *))kfree_skb, skb); | 206 | err = cn_call_callback(skb); |
212 | if (err < 0) | 207 | if (err < 0) |
213 | kfree_skb(skb); | 208 | kfree_skb(skb); |
214 | } | 209 | } |
diff --git a/include/linux/connector.h b/include/linux/connector.h index 545728e20b63..3a14615fd35c 100644 --- a/include/linux/connector.h +++ b/include/linux/connector.h | |||
@@ -132,9 +132,6 @@ struct cn_callback_id { | |||
132 | }; | 132 | }; |
133 | 133 | ||
134 | struct cn_callback_data { | 134 | struct cn_callback_data { |
135 | void (*destruct_data) (void *); | ||
136 | void *ddata; | ||
137 | |||
138 | struct sk_buff *skb; | 135 | struct sk_buff *skb; |
139 | void (*callback) (struct cn_msg *, struct netlink_skb_parms *); | 136 | void (*callback) (struct cn_msg *, struct netlink_skb_parms *); |
140 | 137 | ||