linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs:orangefs:orangefs-debug.h: Use ARRAY_SIZE kernel macro
@ 2017-04-20  0:59 Karim Eshapa
  2017-04-20  5:07 ` kbuild test robot
  2017-04-20  7:17 ` [PATCH] fs:orangefs:orangefs-debug.h: Use ARRAY_SIZE kernel macro kbuild test robot
  0 siblings, 2 replies; 6+ messages in thread
From: Karim Eshapa @ 2017-04-20  0:59 UTC (permalink / raw)
  To: hubcap; +Cc: linux-kernel, Karim Eshapa

Let's use the defined kernel macro more safe
and remove unnecessary cast.

Signed-off-by: Karim Eshapa <karim.eshapa@gmail.com>
---
 fs/orangefs/orangefs-debug.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/orangefs/orangefs-debug.h b/fs/orangefs/orangefs-debug.h
index 387db17..becd229 100644
--- a/fs/orangefs/orangefs-debug.h
+++ b/fs/orangefs/orangefs-debug.h
@@ -12,6 +12,7 @@
 #ifndef __ORANGEFS_DEBUG_H
 #define __ORANGEFS_DEBUG_H
 
+#include "orangefs-kernel.h"
 #ifdef __KERNEL__
 #include <linux/types.h>
 #else
@@ -86,7 +87,7 @@ static struct __keyword_mask_s s_kmod_keyword_mask_map[] = {
 	{"all", GOSSIP_MAX_DEBUG}
 };
 
-static const int num_kmod_keyword_mask_map = (int)
-	(sizeof(s_kmod_keyword_mask_map) / sizeof(struct __keyword_mask_s));
+static const int num_kmod_keyword_mask_map = ARRAY_SIZE(
+	s_kmod_keyword_mask_map);
 
 #endif /* __ORANGEFS_DEBUG_H */
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-04-20 17:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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   ` [PATCH] fs:orangefs:orangefs-debug, orangefs-kernel: Fixing warning issues and use ARRAY_SIZE Karim Eshapa
2017-04-20 17:20     ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).