Re: [PATCH -rt]Updates-from-Jon-Masters-for-hwlat_detector.c.patch

From: John Kacur
Date: Tue Nov 03 2009 - 08:50:37 EST




On Tue, 3 Nov 2009, Thomas Gleixner wrote:

> On Mon, 2 Nov 2009, John Kacur wrote:
> > Updated patch just adds the error checking from Jon Masters then,
> > patched against -rt.
>
> Can you please inline patches ?
>
> @@ -607,7 +607,11 @@ static ssize_t debug_enable_fwrite(stru
> if (!enabled)
> goto unlock;
> enabled = 0;
> - stop_kthread();
> + err = stop_kthread();
> + if (0 != err) {
>
> Eeew !

Yeah, I saw that too and thought it a bit ugly. However, my goal was only
to make sure that the latest version of Jon's hwlat patch got into -rt, so
I didn't think it was my place to "fix" his style.

Note - even the much hated checkpatch program doesn't balk at that.
However that is hardly an authority.

If you read the introduction to "Expert C Programming - Deep C Secrets",
they mention that some programmers write
if (3==i)
instead of
if (i==3)

because if you mistakenly only type one '=', then the compiler can
complain about it, instead of silently assigning 3 to i.

I can only guess that is the sort of idea / habit that Jon got that style
from.

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