[PATCH] net: use bitfields API in skbuff

From: Vegard Nossum
Date: Wed Aug 27 2008 - 12:44:29 EST


Signed-off-by: Vegard Nossum <vegard.nossum@xxxxxxxxx>
---
include/linux/skbuff.h | 6 ++++--
net/core/skbuff.c | 2 ++
2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 9099237..35fe08d 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -14,6 +14,7 @@
#ifndef _LINUX_SKBUFF_H
#define _LINUX_SKBUFF_H

+#include <linux/bitfield.h>
#include <linux/kernel.h>
#include <linux/compiler.h>
#include <linux/time.h>
@@ -285,11 +286,12 @@ struct sk_buff {
};
};
__u32 priority;
- __u8 local_df:1,
+ DEFINE_BITFIELD(__u8, flags1,
+ local_df:1,
cloned:1,
ip_summed:2,
nohdr:1,
- nfctinfo:3;
+ nfctinfo:3);
__u8 pkt_type:3,
fclone:2,
ipvs_property:1,
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index ca1ccdf..1a2505b 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -36,6 +36,7 @@
* The functions in this file will not compile correctly with gcc 2.4.x
*/

+#include <linux/bitfield.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
@@ -438,6 +439,7 @@ static void __copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
memcpy(new->cb, old->cb, sizeof(old->cb));
new->csum_start = old->csum_start;
new->csum_offset = old->csum_offset;
+ bitfield_begin_init(new->flags1);
new->local_df = old->local_df;
new->pkt_type = old->pkt_type;
new->ip_summed = old->ip_summed;
--
1.5.5.1


--ibTvN161/egqYuK8--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/