lkml.org 
[lkml]   [2015]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] staging: net: core: skbuff.c: Added do-while pair for complex macros
Date
This patch is to file skbuff.c that fixes up following error,
reported by checkpatch.pl tool,

1. ERROR: Macros with multiple statements should be enclosed
in a do - while loop.

Signed-off-by: Jitendra Kumar Khasdev <jkhasdev@gmail.com>
---
net/core/skbuff.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index aa41e6d..4d31228 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -748,11 +748,13 @@ void consume_skb(struct sk_buff *skb)
EXPORT_SYMBOL(consume_skb);

/* Make sure a field is enclosed inside headers_start/headers_end section */
-#define CHECK_SKB_FIELD(field) \
- BUILD_BUG_ON(offsetof(struct sk_buff, field) < \
- offsetof(struct sk_buff, headers_start)); \
- BUILD_BUG_ON(offsetof(struct sk_buff, field) > \
- offsetof(struct sk_buff, headers_end)); \
+#define CHECK_SKB_FIELD(field) \
+ do { \
+ BUILD_BUG_ON(offsetof(struct sk_buff, field) < \
+ offsetof(struct sk_buff, headers_start)); \
+ BUILD_BUG_ON(offsetof(struct sk_buff, field) > \
+ offsetof(struct sk_buff, headers_end)); \
+ } while (0) \

static void __copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
{
--
1.9.1


\
 
 \ /
  Last update: 2015-11-26 18:01    [W:0.082 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site