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



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/



Relevant Pages

  • Re: Independent Study - Assistance?
    ... actual "compiler" course. ... just the textbooks for such courses. ... How to convert a grammar into a recursive descent parser. ... only use a small fraction of the notation in the paper. ...
    (comp.compilers)
  • Re: XML::LibXML UTF-8 toString() -vs- nodeValue()
    ... Wide character in print at -e line 1. ... because now the use encoding comes too late: ... Since compiler wasn't told about encoding ... Unicode strings are downgraded with UTF-8 encoding. ...
    (comp.lang.perl.misc)
  • Re: Why has hungarian notation been abandoned?
    ... > reason for them capitalizing all functions and classes and not using ... > hungarian notation? ... Hungarian notation is from the early days where type information wasn't ... the exception of 'variable: iMyInteger'. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Newbie (Post#1): Help with Array of Objects
    ... I haven't tried it in years (again, I think the notation is ... It used to fail under both Borland, and a compiler for the Mac ... Sorry for the misunderstanding, but I ... > That suggests to me that array brackets are specific to the variable, ...
    (comp.lang.java.help)
  • Re: Non ASCII characters in CFString litteral, HELP !
    ... compiler being free, and doubly happy that it's something as widespread ... OK, so maybe it's not gcc that sucks, but something sure ... The main problem is that there's no guarantee of the encoding of the file. ... You can of course tell Xcode that it should be UTF-8 and write your code ...
    (comp.sys.mac.programmer.help)

Loading