A style question: repeated return value check

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-kernel@...>
Cc: Frederic Weisbecker <fweisbec@...>, <mingo@...>, <rostedt@...>
Date: Monday, September 29, 2008 - 3:14 pm

On Mon, 29 Sep 2008 20:18:34 +0200
Frederic Weisbecker <fweisbec@gmail.com> wrote:

[...]

Off-thread style question: Would it be better or worse to write the
above as

	ret = trace_seq_printf(s, "%16s-%-5d ", comm, field->pid);
	ret = ret && trace_seq_printf(s, "[%03d] ", iter->cpu);
	ret = ret && trace_seq_printf(s, "%5lu.%06lu: ", secs, usec_rem);
	if (!ret)
		return TRACE_TYPE_PARTIAL_LINE;

which would do exactly the same, but is more compact.
Good or bad style?

Well, it could be rolled into a single trace_seq_printf() call, too.

-- 
Pekka Paalanen
http://www.iki.fi/pq/
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH V2 -tip 1/4] Tracing/ftrace: Change the type of the p..., Frederic Weisbecker, (Mon Sep 29, 2:18 pm)
A style question: repeated return value check, Pekka Paalanen, (Mon Sep 29, 3:14 pm)
Re: A style question: repeated return value check, Ingo Molnar, (Tue Sep 30, 4:33 am)
Re: A style question: repeated return value check, Frédéric Weisbecker, (Tue Sep 30, 4:48 am)
Re: A style question: repeated return value check, Frédéric Weisbecker, (Tue Sep 30, 4:50 am)