Re: A style question: repeated return value check

From: Frédéric Weisbecker
Date: Tue Sep 30 2008 - 04:48:19 EST


2008/9/30 Ingo Molnar <mingo@xxxxxxx>:
> in this particular case it's marginally worse style i think, even
> considering that it makes the code more compact. The reason is that it
> makes the code a tiny bit less obvious: the flow looks a bit unusual and
> when skimming it i'd have to look once more to understand its purpose.
> With the returns its more verbose but also plain obvious. YMMV.

I think the same. The code flow seems to me more natural as is even if
it looks more
noisy.
IMHO, when one is reading the code, such a compact path forces a break
to figure out
what is going on in these tests.

But I agree with Pekka for the fact that it could be unified in a
single call to trace_seq_printf.
That will produce a small "3 format" easy to understand. Seems good.
--
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/