Re: [PATCH] kconfig: Print reverse dependencies in groups

From: Petr Vorel
Date: Wed Feb 21 2018 - 06:10:48 EST


Hi Masahiro,

> Signed-off-by: Masahiro Yamada <yamada.masahiro@xxxxxxxxxxxxx>
Acked-by: Petr Vorel <pvorel@xxxxxxx>
Just please fix typo leading to segfault and add ':'

<snip>
> get_symbol_props_str(r, sym, P_SELECT, _(" Selects: "));
> if (sym->rev_dep.expr) {
> - str_append(r, _(" Selected by: \n"));
> - expr_gstr_print_revdep(sym->rev_dep.expr, r);
> + expr_gstr_print_revdep(sym->rev_dep.expr, r, yes, " Selected by [y]\n");
> + expr_gstr_print_revdep(sym->rev_dep.expr, r, mod, " Selected by [m]\n");
> + expr_gstr_print_revdep(sym->rev_dep.expr, r, no, " Selected by [n]\n");
Maybe add ':' to be consistent with the rest of titles?
+ expr_gstr_print_revdep(sym->rev_dep.expr, r, yes, " Selected by [y]:\n");
+ expr_gstr_print_revdep(sym->rev_dep.expr, r, mod, " Selected by [m]:\n");
+ expr_gstr_print_revdep(sym->rev_dep.expr, r, no, " Selected by [n]:\n");

> }

> get_symbol_props_str(r, sym, P_IMPLY, _(" Implies: "));
> if (sym->implied.expr) {
> - str_append(r, _(" Implied by: \n"));
> - expr_gstr_print_revdep(sym->implied.expr, r);
> + expr_gstr_print_revdep(sym->rev_dep.expr, r, yes, " Implied by [y]\n");
> + expr_gstr_print_revdep(sym->rev_dep.expr, r, mod, " Implied by [m]\n");
> + expr_gstr_print_revdep(sym->rev_dep.expr, r, no, " Implied by [n]\n");
And the same here.
+ the most important thing - copy paste error, which obviously leads to segfault on
"Implied by":
Try search for PTP_1588_CLOCK (in x86_64 defconfig). gdb in coredump shows
#0 0x000000000041043e in expr_print_revdep (e=0x0, fn=0x410297 <expr_print_gstr_helper>, data=0x7fff0f2a8640, pr_type=yes, title=0x7fff0f2a85a0) at scripts/kconfig/expr.c:1328
1328 if (e->type == E_OR) {

So the correct is:
expr_gstr_print_revdep(sym->implied.expr, r, yes, " Implied by [y]:\n");
expr_gstr_print_revdep(sym->implied.expr, r, mod, " Implied by [m]:\n");
expr_gstr_print_revdep(sym->implied.expr, r, no, " Implied by [n]:\n");


Kind regards,
Petr