From patchwork Wed Sep 9 18:25:18 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Holt X-Patchwork-Id: 46443 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n89IPLu1020270 for ; Wed, 9 Sep 2009 18:25:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752046AbZIISZR (ORCPT ); Wed, 9 Sep 2009 14:25:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753654AbZIISZR (ORCPT ); Wed, 9 Sep 2009 14:25:17 -0400 Received: from relay1.sgi.com ([192.48.179.29]:42335 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752046AbZIISZQ (ORCPT ); Wed, 9 Sep 2009 14:25:16 -0400 Received: from estes.americas.sgi.com (estes.americas.sgi.com [128.162.236.10]) by relay1.corp.sgi.com (Postfix) with ESMTP id 0C9D08F80BC for ; Wed, 9 Sep 2009 11:25:19 -0700 (PDT) Received: from lnx-holt.americas.sgi.com (lnx-holt.americas.sgi.com [128.162.233.109]) by estes.americas.sgi.com (Postfix) with ESMTP id ED3977000103; Wed, 9 Sep 2009 13:25:18 -0500 (CDT) Received: from holt by lnx-holt.americas.sgi.com with local (Exim 4.69) (envelope-from ) id 1MlRr4-0004yY-Um; Wed, 09 Sep 2009 13:25:18 -0500 Date: Wed, 9 Sep 2009 13:25:18 -0500 From: Robin Holt To: linux-kbuild@vger.kernel.org Cc: holt@sgi.com Subject: [Patch] menuconfig: Display current values with symbols. Message-ID: <20090909182518.GB9913@sgi.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org While investigating why a CONFIG_ symbol was not displayed, I was frustrated with finding each of the dependent symbol's values. This patch adds a display of the symbol's value along side the symbol's name. Signed-off-by: Robin Holt --- One additional suggestion would be an easy way to navigate from the search screen to the spot in the menus where that CONFIG_ value is set. I could not figure out a clear and convenient method for that. Some of the menus are fairly long and since they are not sorted, can result in some frustration while searching for the individual setting. -- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: xpmem_numatools_kernel/scripts/kconfig/expr.c =================================================================== --- xpmem_numatools_kernel.orig/scripts/kconfig/expr.c 2009-09-08 13:30:57.000000000 -0500 +++ xpmem_numatools_kernel/scripts/kconfig/expr.c 2009-09-09 11:53:07.000000000 -0500 @@ -1013,6 +1013,19 @@ int expr_compare_type(enum expr_type t1, #endif } +void expr_print_symbol(void (*fn)(void *, struct symbol *, const char *), void *data, struct symbol *sym) +{ + char sym_value_str[5]; + + if (sym->name) { + fn(data, sym, sym->name); + if (snprintf(sym_value_str, 5, "[=%s]", sym_get_string_value(sym)) < 5) + fn(data, sym, sym_value_str); + } else { + fn(data, NULL, ""); + } +} + void expr_print(struct expr *e, void (*fn)(void *, struct symbol *, const char *), void *data, int prevtoken) { if (!e) { @@ -1024,28 +1037,19 @@ void expr_print(struct expr *e, void (*f fn(data, NULL, "("); switch (e->type) { case E_SYMBOL: - if (e->left.sym->name) - fn(data, e->left.sym, e->left.sym->name); - else - fn(data, NULL, ""); + expr_print_symbol(fn, data, e->left.sym); break; case E_NOT: fn(data, NULL, "!"); expr_print(e->left.expr, fn, data, E_NOT); break; case E_EQUAL: - if (e->left.sym->name) - fn(data, e->left.sym, e->left.sym->name); - else - fn(data, NULL, ""); + expr_print_symbol(fn, data, e->left.sym); fn(data, NULL, "="); fn(data, e->right.sym, e->right.sym->name); break; case E_UNEQUAL: - if (e->left.sym->name) - fn(data, e->left.sym, e->left.sym->name); - else - fn(data, NULL, ""); + expr_print_symbol(fn, data, e->left.sym); fn(data, NULL, "!="); fn(data, e->right.sym, e->right.sym->name); break;