From patchwork Mon Apr 20 19:48:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 6244031 Return-Path: X-Original-To: patchwork-linux-nvdimm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8DFD99F32B for ; Mon, 20 Apr 2015 19:51:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C5E1320429 for ; Mon, 20 Apr 2015 19:51:42 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D272720220 for ; Mon, 20 Apr 2015 19:51:41 +0000 (UTC) Received: from ml01.vlan14.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 9902181000; Mon, 20 Apr 2015 12:51:41 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by ml01.01.org (Postfix) with ESMTP id C4B9C80FFE for ; Mon, 20 Apr 2015 12:51:39 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 20 Apr 2015 12:51:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,610,1422950400"; d="scan'208";a="682951657" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.23.232.36]) by orsmga001.jf.intel.com with ESMTP; 20 Apr 2015 12:51:39 -0700 From: Dan Williams To: linux-nvdimm@lists.01.org Date: Mon, 20 Apr 2015 15:48:59 -0400 Message-ID: <20150420194852.16504.65097.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.17.1-8-g92dd MIME-Version: 1.0 Subject: [Linux-nvdimm] [ndctl PATCH] ndctl: reorder header include for ARRAY_SIZE() definition X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On a system without /usr/include/linux/ndctl.h (provided by the kernel "make INSTALL_HDR_PATH=/usr headers_install"). The ndctl build falls back to using the local copy of ndctl.h, triggering these warnings. CC lib/test-dpa-alloc.o In file included from lib/test-dpa-alloc.c:33:0: ./ndctl.h: In function ‘nfit_bus_cmd_name’: ./ndctl.h:122:2: warning: implicit declaration of function ‘ARRAY_SIZE’ [-Wimplicit-function-declaration] if (cmd < ARRAY_SIZE(names) && names[cmd]) Arrange for ARRAY_SIZE() to be picked up from as a fallback. Reported-by: Robert Elliott Signed-off-by: Dan Williams --- lib/test-dpa-alloc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/test-dpa-alloc.c b/lib/test-dpa-alloc.c index 5b7db7c2f542..f94838ac0b9b 100644 --- a/lib/test-dpa-alloc.c +++ b/lib/test-dpa-alloc.c @@ -27,13 +27,14 @@ #include #include +#include +#include + #ifdef HAVE_NDCTL_H #include #else #include #endif -#include -#include static const char *NFIT_TEST_MODULE = "nfit_test"; static const char *NFIT_PROVIDER0 = "nfit_test.0";