[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-kbuild
Subject:    Re: [PATCH v2 1/1] kconfig: menuconfig make "selected by:" readable
From:       Petr Vorel <petr.vorel () gmail ! com>
Date:       2015-10-28 2:38:13
Message-ID: 20151028023812.GA27149 () t61
[Download RAW message or body]

> > Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
> > ---
> You want to have that line there because the above text will be dropped
> by the git tools (because it comes are after a --- marker, which signals
> "end of commit explanation"). Note that the text, which I think was
> written by me, was basically a comment. Ie, because it came after that
> marker I used it to say things that I thought were not appropriate for a
> commit explanation.
Thanks for explanation, I'll fix my Signed-off-by: in v3. And also clean up comments.

> > --- a/scripts/kconfig/expr.c
> > +++ b/scripts/kconfig/expr.c
> > @@ -1070,7 +1070,7 @@ struct expr *expr_simplify_unmet_dep(struct expr

> > -void expr_print(struct expr *e, void (*fn)(void *, struct symbol *,
> > const char *), void *data, int prevtoken)
> > +static void expr_print_impl(struct expr *e, void (*fn)(void *, struct

> What does _impl stand for?
_impl is for implementation. I didn't want to add new parameter which is meaningless to
most of expr_print() calls, so I created wrapper function. Ugly approach, I know.

> > @@ -1125,9 +1125,12 @@ void expr_print(struct expr *e, void (*fn)(void

> >  	case E_OR:
> > -		expr_print(e->left.expr, fn, data, E_OR);
> > -		fn(data, NULL, " || ");
> > -		expr_print(e->right.expr, fn, data, E_OR);
> > +		expr_print_impl(e->left.expr, fn, data, E_OR,
> revdep);
> > +		if (revdep)
> > +			fn(data, NULL, "\n  - ");
> > +		else
> > +			fn(data, NULL, " || ");
> > +		expr_print_impl(e->right.expr, fn, data, E_OR,
> revdep);

> >  		break;
> >  	case E_AND:
> >  		expr_print(e->left.expr, fn, data, E_AND);

> Lazy question: will the "-" only be printed for the _top level_ E_OR
> expressions in "Selected by:" lines?
Well, I don't check for it in the code. But IMHO all non top level E_OR expressions are in
parentheses, which aren't split by "-". So, yes.
Anyway, do you have an example of non top level E_OR, which is not in parentheses?

Kind regards,
Petr
--
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
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic