lkml.org 
[lkml]   [2006]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 18/19] kconfig: warn about leading whitespace for menu prompts

Kconfig does its own indentation of menu prompts, so warn about and
ignore leading whitespace.
Remove also a few unnecessary newlines after other warning prints.

Signed-off-by: Roman Zippel <zippel@linux-m68k.org>

---

scripts/kconfig/menu.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)

Index: linux-2.6-git/scripts/kconfig/menu.c
===================================================================
--- linux-2.6-git.orig/scripts/kconfig/menu.c
+++ linux-2.6-git/scripts/kconfig/menu.c
@@ -114,7 +114,7 @@ void menu_set_type(int type)
sym->type = type;
return;
}
- menu_warn(current_entry, "type of '%s' redefined from '%s' to '%s'\n",
+ menu_warn(current_entry, "type of '%s' redefined from '%s' to '%s'",
sym->name ? sym->name : "<choice>",
sym_type_name(sym->type), sym_type_name(type));
}
@@ -124,15 +124,20 @@ struct property *menu_add_prop(enum prop
struct property *prop = prop_alloc(type, current_entry->sym);

prop->menu = current_entry;
- prop->text = prompt;
prop->expr = expr;
prop->visible.expr = menu_check_dep(dep);

if (prompt) {
+ if (isspace(*prompt)) {
+ prop_warn(prop, "leading whitespace ignored");
+ while (isspace(*prompt))
+ prompt++;
+ }
if (current_entry->prompt)
- menu_warn(current_entry, "prompt redefined\n");
+ prop_warn(prop, "prompt redefined");
current_entry->prompt = prop;
}
+ prop->text = prompt;

return prop;
}
@@ -343,11 +348,10 @@ void menu_finalize(struct menu *parent)

if (sym && !(sym->flags & SYMBOL_WARNED)) {
if (sym->type == S_UNKNOWN)
- menu_warn(parent, "config symbol defined "
- "without type\n");
+ menu_warn(parent, "config symbol defined without type");

if (sym_is_choice(sym) && !parent->prompt)
- menu_warn(parent, "choice must have a prompt\n");
+ menu_warn(parent, "choice must have a prompt");

/* Check properties connected to this symbol */
sym_check_prop(sym);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2006-04-09 17:36    [W:0.416 / U:0.484 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site