Re: [PATCH 2/7] Initial implementation of the trec driver and include files

From: Johannes Weiner
Date: Wed Mar 21 2007 - 14:18:53 EST


Hi,

On Wed, Mar 21, 2007 at 09:49:12AM -0700, Wink Saville wrote:
> >>Please don't use camel-case - in general.
> >>
> Would p_next, p_cur and p_end be OK?

I think it's generally disliked. Quoting Documentation/CodingStyle:

``Encoding the type of a function into the name (so-called Hungarian
notation) is brain damaged - the compiler knows the types anyway and can
check those, and it only confuses the programmer. No wonder MicroSoft
makes buggy programs.''

> >>--- /dev/null
> >>+++ b/include/linux/trec.h
> >>@@ -0,0 +1,34 @@
> >>+/*
> >>+#define TREC0() trec_write(TREC_PC_ADDR, TREC_PID,
> >>0, 0)
> >>
> [...]
> >>+
> >>+#define ZREC0() do { } while (0)
> >>
> >Why not seperate them by an #ifndef? So you don't have to replace TREC?
> >with ZREC? but rather change one #define knob.
>
> The reason is to allow the user easily change individual TREC's from
> active to inactive by just
> changing a single character. Eventually I envision adding runtime
> support for changing if a
> particular set of TREC's are active or not, but this was simple.

You can implement a sysctl-setting to enable/disable the whole system
(which then would be runtime changeable).

=Hannes
-
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/