From: Karim Eshapa <karim.eshapa@gmail.com>
To: hubcap@omnibond.com
Cc: linux-kernel@vger.kernel.org, Karim Eshapa <karim.eshapa@gmail.com>
Subject: [PATCH] fs:orangefs:orangefs-debug, orangefs-kernel: Fixing warning issues and use ARRAY_SIZE
Date: Thu, 20 Apr 2017 15:04:42 +0200 [thread overview]
Message-ID: <1492693482-7885-1-git-send-email-karim.eshapa@gmail.com> (raw)
In-Reply-To: <201704201239.Rx0mdbIl%fengguang.wu@intel.com>
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
next prev parent reply other threads:[~2017-04-20 13:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-20 0:59 [PATCH] fs:orangefs:orangefs-debug.h: Use ARRAY_SIZE kernel macro Karim Eshapa
2017-04-20 5:07 ` kbuild test robot
2017-04-20 13:04 ` Karim Eshapa [this message]
2017-04-20 17:20 ` [PATCH] fs:orangefs:orangefs-debug, orangefs-kernel: Fixing warning issues and use ARRAY_SIZE kbuild test robot
2017-04-20 17:25 ` kbuild test robot
2017-04-20 7:17 ` [PATCH] fs:orangefs:orangefs-debug.h: Use ARRAY_SIZE kernel macro kbuild test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1492693482-7885-1-git-send-email-karim.eshapa@gmail.com \
--to=karim.eshapa@gmail.com \
--cc=hubcap@omnibond.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®