Re: [PATCH] ftrace: type cast verifier

From: Ingo Molnar
Date: Wed Oct 01 2008 - 13:47:53 EST



* Ingo Molnar <mingo@xxxxxxx> wrote:

> could you rename it to trace_type() - that way the initialization could
> be written in a more compact way as:
>
> > + struct trace_mmiotrace_map *field = trace_type(field, entry);

ah, it cannot be done that way, as 'field' has to be known to the
compiler.

so your patch is fine as-is, the extra line is an acceptable cost, as we
get:

- the type filter (trying to cast an object outside of the narrow list
of trace entry types will cause a failed build - i.e. most of the
practical dangers of C type casting are avoided!)

- the runtime entry type checker

Ingo
--
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/