lkml.org 
[lkml]   [2017]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] fs:orangefs:orangefs-debug, orangefs-kernel: Fixing warning issues and use ARRAY_SIZE
Date
Fix warning issues produced by kbuild test and use a ARRAY_SIZE
kernel defined macro more safe and remove unnecessary cast
when __KERNEL__ is defined.

Signed-off-by: Karim Eshapa <karim.eshapa@gmail.com>
---
fs/orangefs/orangefs-debug.h | 6 ++++++
fs/orangefs/orangefs-kernel.h | 2 ++
2 files changed, 8 insertions(+)

diff --git a/fs/orangefs/orangefs-debug.h b/fs/orangefs/orangefs-debug.h
index 387db17..ff1f592 100644
--- a/fs/orangefs/orangefs-debug.h
+++ b/fs/orangefs/orangefs-debug.h
@@ -14,6 +14,7 @@

#ifdef __KERNEL__
#include <linux/types.h>
+#include <orangefs-kernel.h>
#else
#include <stdint.h>
#endif
@@ -86,7 +87,12 @@ static struct __keyword_mask_s s_kmod_keyword_mask_map[] = {
{"all", GOSSIP_MAX_DEBUG}
};

+#ifdef __KERNEL__
+static const int num_kmod_keyword_mask_map = ARRAY_SIZE(
+ s_kmod_keyword_mask_map);
+#else
static const int num_kmod_keyword_mask_map = (int)
(sizeof(s_kmod_keyword_mask_map) / sizeof(struct __keyword_mask_s));
+#endif

#endif /* __ORANGEFS_DEBUG_H */
diff --git a/fs/orangefs/orangefs-kernel.h b/fs/orangefs/orangefs-kernel.h
index 8afac46..e9330c1 100644
--- a/fs/orangefs/orangefs-kernel.h
+++ b/fs/orangefs/orangefs-kernel.h
@@ -54,6 +54,8 @@
#include <asm/unaligned.h>

#include "orangefs-dev-proto.h"
+#include "protocol.h"
+#include "orangefs-debug.h"

#ifdef ORANGEFS_KERNEL_DEBUG
#define ORANGEFS_DEFAULT_OP_TIMEOUT_SECS 10
--
2.7.4
\
 
 \ /
  Last update: 2017-04-20 15:05    [W:0.158 / U:11.524 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site