kconfig: Print reverse dependencies in groups
[carl9170fw.git] / config / expr.c
index cd3a8f501f38e1c3d6290bd4c34572943e3fc793..49376e12fa303df54ff84caa39863534a32657f5 100644 (file)
@@ -1323,19 +1323,25 @@ void expr_gstr_print(struct expr *e, struct gstr *gs)
  */
 static void expr_print_revdep(struct expr *e,
                              void (*fn)(void *, struct symbol *, const char *),
-                             void *data)
+                             void *data, tristate pr_type, const char **title)
 {
        if (e->type == E_OR) {
-               expr_print_revdep(e->left.expr, fn, data);
-               expr_print_revdep(e->right.expr, fn, data);
-       } else {
+               expr_print_revdep(e->left.expr, fn, data, pr_type, title);
+               expr_print_revdep(e->right.expr, fn, data, pr_type, title);
+       } else if (expr_calc_value(e) == pr_type) {
+               if (*title) {
+                       fn(data, NULL, *title);
+                       *title = NULL;
+               }
+
                fn(data, NULL, "  - ");
                expr_print(e, fn, data, E_NONE);
                fn(data, NULL, "\n");
        }
 }
 
-void expr_gstr_print_revdep(struct expr *e, struct gstr *gs)
+void expr_gstr_print_revdep(struct expr *e, struct gstr *gs,
+                           tristate pr_type, const char *title)
 {
-       expr_print_revdep(e, expr_print_gstr_helper, gs);
+       expr_print_revdep(e, expr_print_gstr_helper, gs, pr_type, &title);
 }