Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932328AbcJPPUe (ORCPT ); Sun, 16 Oct 2016 11:20:34 -0400 Received: from userp1050.oracle.com ([156.151.31.82]:45922 "EHLO userp1050.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755640AbcJPPUZ (ORCPT ); Sun, 16 Oct 2016 11:20:25 -0400 From: Vegard Nossum To: linux-kernel@vger.kernel.org, Greg Kroah-Hartman Cc: Jiri Slaby , Linus Torvalds , "Luis R . Rodriguez" , Vegard Nossum , Greg Banks , Jason Baron Subject: [PATCH 12/12] dynamic debug: declare table as external array Date: Sun, 16 Oct 2016 17:16:16 +0200 Message-Id: <20161016151616.31451-13-vegard.nossum@oracle.com> X-Mailer: git-send-email 2.10.0.479.g221bd91 In-Reply-To: <20161016151616.31451-1-vegard.nossum@oracle.com> References: <20161016151616.31451-1-vegard.nossum@oracle.com> X-Source-IP: userp1040.oracle.com [156.151.31.81] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1968 Lines: 58 Cc: Greg Banks Cc: Jason Baron Signed-off-by: Vegard Nossum --- lib/dynamic_debug.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index da796e2..101a420 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -13,6 +13,7 @@ #define pr_fmt(fmt) KBUILD_MODNAME ":%s: " fmt, __func__ +#include #include #include #include @@ -37,8 +38,7 @@ #include #include -extern struct _ddebug __start___verbose[]; -extern struct _ddebug __stop___verbose[]; +DECLARE_EXTARRAY(struct _ddebug, __verbose); struct ddebug_table { struct list_head link; @@ -978,14 +978,14 @@ static int __init dynamic_debug_init(void) int n = 0, entries = 0, modct = 0; int verbose_bytes = 0; - if (__start___verbose == __stop___verbose) { + if (!ext_size(__verbose)) { pr_warn("_ddebug table is empty in a CONFIG_DYNAMIC_DEBUG build\n"); return 1; } - iter = __start___verbose; + iter = ext_start(__verbose); modname = iter->modname; iter_start = iter; - for (; iter < __stop___verbose; iter++) { + for (; iter < ext_end(__verbose); iter++) { entries++; verbose_bytes += strlen(iter->modname) + strlen(iter->function) + strlen(iter->filename) + strlen(iter->format); @@ -1008,7 +1008,7 @@ static int __init dynamic_debug_init(void) ddebug_init_success = 1; vpr_info("%d modules, %d entries and %d bytes in ddebug tables, %d bytes in (readonly) verbose section\n", modct, entries, (int)(modct * sizeof(struct ddebug_table)), - verbose_bytes + (int)(__stop___verbose - __start___verbose)); + verbose_bytes + (int)(ext_size(__verbose) * sizeof(struct _ddebug))); /* apply ddebug_query boot param, dont unload tables on err */ if (ddebug_setup_string[0] != '\0') { -- 2.10.0.479.g221bd91