From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S945583AbdDTNE5 (ORCPT ); Thu, 20 Apr 2017 09:04:57 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:33293 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S943450AbdDTNEy (ORCPT ); Thu, 20 Apr 2017 09:04:54 -0400 From: Karim Eshapa To: hubcap@omnibond.com Cc: linux-kernel@vger.kernel.org, Karim Eshapa Subject: [PATCH] fs:orangefs:orangefs-debug, orangefs-kernel: Fixing warning issues and use ARRAY_SIZE Date: Thu, 20 Apr 2017 15:04:42 +0200 Message-Id: <1492693482-7885-1-git-send-email-karim.eshapa@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <201704201239.Rx0mdbIl%fengguang.wu@intel.com> References: <201704201239.Rx0mdbIl%fengguang.wu@intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 +#include #else #include #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 #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