skbuff: struct ubuf_info callback type safety
The skb struct ubuf_info callback gets passed struct ubuf_info itself, not the arg value as the field name and the function signature seem to imply. Rename the arg field to ctx to match usage, add documentation and change the callback argument type to make usage clear and to have compiler check correctness. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
9a5d2bd99e
commit
ca8f4fb21d
@@ -238,11 +238,12 @@ enum {
|
||||
/*
|
||||
* The callback notifies userspace to release buffers when skb DMA is done in
|
||||
* lower device, the skb last reference should be 0 when calling this.
|
||||
* The desc is used to track userspace buffer index.
|
||||
* The ctx field is used to track device context.
|
||||
* The desc field is used to track userspace buffer index.
|
||||
*/
|
||||
struct ubuf_info {
|
||||
void (*callback)(void *);
|
||||
void *arg;
|
||||
void (*callback)(struct ubuf_info *);
|
||||
void *ctx;
|
||||
unsigned long desc;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user