Re: [PATCH 13/21] dynamic_debug: require 'a' flag to explicitly markpending queries

From: Bart Van Assche
Date: Tue Jul 12 2011 - 05:21:12 EST


On Mon, Jul 11, 2011 at 9:46 AM, Jim Cromie <jim.cromie@xxxxxxxxx> wrote:
> +static int queries_match(struct ddebug_query *q1, struct ddebug_query *q2)
> +{
> +       if (!q1->module ^ !q2->module ||
> +               !q1->filename ^ !q2->filename ||
> +               !q1->function ^ !q2->function ||
> +               !q1->format ^ !q2->format)
> +               return 0;  /* a match-spec set/unset state differs */
> +
> +       if (q1->last_lineno != q2->last_lineno ||
> +               q1->first_lineno != q2->first_lineno)
> +               return 0;
> +
> +       if ((q1->module && strcmp(q1->module, q2->module)) ||
> +               (q1->filename && strcmp(q1->filename, q2->filename)) ||
> +               (q1->function && strcmp(q1->function, q2->function)) ||
> +               (q1->format && strcmp(q1->format, q2->format)))
> +               return 0;
> +       return 1;
> +}

Is there a reason why the return type of this function is "int" and
not "bool" ? Also, in the Linux kernel you can use the symbolic
constants "true" and "false" instead of "1" and "0".

Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/