02 Dec, 2014
1 commit
-
I added a paragraph on choosing label names, and updated the example
code to use a better label name. I also cleaned up the example code to
more modern style by moving the allocation out of the initializer and
changing the NULL check.Perhaps the most common type of error handling bug in the kernel is "one
err bugs". CodingStyle already says that we should "avoid nesting" by
using error labels and one err style error handling tends to have
multiple indent levels, so this was already bad style. But I've added a
new paragraph explaining how to avoid one err bugs by using multiple
error labels which is, hopefully, more clear.Signed-off-by: Dan Carpenter
Acked-by: Julia Lawall
[jc: added GFP_KERNEL to kmalloc() call]
Signed-off-by: Jonathan Corbet
04 Nov, 2014
1 commit
-
Document several common practices and conventions regarding conditional
compilation, most notably the preference for ifdefs in headers rather
than .c files.Signed-off-by: Josh Triplett
Acked-by: Geert Uytterhoeven
Signed-off-by: Jonathan Corbet
26 Aug, 2014
1 commit
-
There was a minor typo in the CodingStyle document where the word 'section'
had been spelled as 'secton'.Signed-off-by: Raymond L. Rivera
Signed-off-by: Jiri Kosina
05 Jun, 2014
1 commit
-
The pr_debug() and related debug print macros all differ from the normal
pr_XXX() macros, in that the normal ones print unconditionally, while
the debug macros are compiled out unless DEBUG is defined or
CONFIG_DYNAMIC_DEBUG is set. This isn't obvious, and the only way to
find this out is either to review the actual printk.h code or to read
CodingStyle, and the message there doesn't highlight the fact.Change Documentation/CodingStyle to clearly indicate that pr_debug() and
related debug printing macros behave differently than all other pr_XXX()
macros, and attempt to clarify when and where the different debug
printing methods might be used.Add short comment to printk.h above the pr_XXX() macros indicating that
while these macros print unconditionally, pr_debug() does not.Signed-off-by: Dan Streetman
Cc: Joe Perches
Cc: Fabian Frederick
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
04 Jul, 2013
1 commit
-
A surprising number of newbies interpret this section to mean that only
one return statement is allowed per function. Part of the problem is that
the "one return statement per function" rule is an actual style guideline
that people are used to from other projects.Signed-off-by: Dan Carpenter
Cc: Eduardo Valentin
Cc: Rob Landley
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
12 Jan, 2013
1 commit
-
The CONFIG_EXPERIMENTAL config item has not carried much meaning for a
while now and is almost always enabled by default. As agreed during the
Linux kernel summit, remove it from any "depends on" lines in Kconfigs.CC: Rob Landley
CC: Jiri Kosina
CC: Masanari Iida
CC: Jason Wessel
CC: Richard L Maliszewski
CC: Gang Wei
CC: Shane Wang
CC: Harry Wei
Signed-off-by: Kees Cook
Acked-by: Jason Wessel
06 Oct, 2012
1 commit
-
The block comment style in net/ and drivers/net is non-standard.
Document it.Signed-off-by: Joe Perches
Cc: "Allan, Bruce W"
Cc: Andy Whitcroft
Cc: David Miller
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
01 Jun, 2012
1 commit
-
Add the new kmalloc_array() to the list of general-purpose memory
allocators in chapter 14.Signed-off-by: Xi Wang
Acked-by: Jesper Juhl
Acked-by: Pekka Enberg
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
31 Mar, 2012
1 commit
-
Signed-off-by: Josh Triplett
Signed-off-by: Randy Dunlap
Signed-off-by: Linus Torvalds
05 Nov, 2011
1 commit
-
After commit 38829dc9d7b4 ("Documentation/CodingStyle: flesh out if-else
examples") highlight that if _only_one_ branch of a conditional
statement is a single statement, then braces are to be used on both
branches.Signed-off-by: Antonio Ospite
Signed-off-by: Randy Dunlap
Signed-off-by: Linus Torvalds
07 Aug, 2011
1 commit
-
Patch reviewers now recommend not splitting long user-visible strings,
such as printk messages, even if they exceed 80 columns. This avoids
breaking grep. However, that recommendation did not actually appear
anywhere in Documentation/CodingStyle.See, for example, the thread at
http://news.gmane.org/find-root.php?message_id=%3c1312215262.11635.15.camel%40Joe%2dLaptop%3eSigned-off-by: Josh Triplett
Signed-off-by: Linus Torvalds
07 Jul, 2011
1 commit
-
The list of available general purpose memory allocators in
Documentation/CodingStyle chapter 14 is incomplete. This patch adds
the missing vzalloc() to the list.Signed-off-by: Jesper Juhl
Signed-off-by: Randy Dunlap
Signed-off-by: Linus Torvalds
23 Mar, 2011
1 commit
-
There is a missing case for "Chapter 3: Placing Braces and Spaces". We
often know we should not use braces where a single statement. The first
case is:if (condition)
action();Another case is:
if (condition)
do_this();
else
do_that();However, I can not find a description of the second case.
Signed-off-by: Harry Wei
Cc: Randy Dunlap
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
17 Mar, 2011
1 commit
-
pr_info() and pr_debug() are in linux/printk.h, not linux/kernel.h.
Last updated is unnecessary, we have git for that.Signed-off-by: Roland Kammerer
Signed-off-by: Randy Dunlap
Acked-by: Harry Wei
Signed-off-by: Linus Torvalds
13 Jun, 2009
1 commit
-
Signed-off-by: Martin Olsson
Signed-off-by: Jiri Kosina
30 Jan, 2009
2 commits
-
I don't think emacs understands tilde expansion, so use
"expand-file-name" to do that.Signed-off-by: Dan Carpenter
Signed-off-by: Randy Dunlap
Signed-off-by: Linus Torvalds -
With the previous Emacs tips example the kernel style was made available
for files in the kernel-tree only. This patch updates the tip to add a
separate cc-mode indent style ("linux-tabs-only"). This makes it easy to
switch between different indent styles and also makes the kernel style
easily available for any filetype mode (c++, awk, ...) that is managed
by the Emacs cc-mode.Signed-off-by: Teemu Likonen
Signed-off-by: Randy Dunlap
Signed-off-by: Linus Torvalds
26 Jul, 2008
1 commit
-
Describe a setup that integrates better with Emacs' cc-mode and also fixes
up the alignment of continuation lines to really only use tabs.Signed-off-by: Johannes Weiner
Cc: Jonathan Corbet
Cc: Randy Dunlap
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
17 Oct, 2007
1 commit
-
I would suggest this change to make CodingStyle properly reflect the style
used by the kernel, rather than the current wording which is wishful
thinking and misleading, and comes from the same school of thought that
gets off on prescriptive grammar, latin and comp.std.cSigned-off-by: Alan Cox
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
19 Jul, 2007
1 commit
-
Update CodingStyle to talk about "-DDEBUG" message conventions and the
new "-DVERBOSE_DEBUG" convention.Signed-off-by: David Brownell
Signed-off-by: Andrew Morton
Signed-off-by: Greg Kroah-Hartman
17 Jul, 2007
2 commits
-
I recently received a patch including a file that had a vim modeline,
and I realized that nothing specifically proscribed that practice.Signed-off-by: Josh Triplett
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Signed-off-by: Josh Triplett
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
24 May, 2007
1 commit
-
Fix the obvious errors in the explanation of Kconfig files.
Signed-off-by: Robert P. J. Day
Signed-off-by: Randy Dunlap
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
09 May, 2007
2 commits
-
commit 226a6b84aaaf1fac7a5d41cf4e7387fd9ba895d5 renumbered Chapter 11 in
Documentation/CodingStyle to Chapter 12, but it didn't update the reference
to that chapter further down in the file. This patch corrects the chapter
reference.Signed-off-by: Jesper Juhl
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Signed-off-by: Oliver Neukum
Cc: Tilman Schmidt
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
23 Dec, 2006
1 commit
-
Add a new section to the CodingStyle file, encouraging people not to
re-invent available kernel macros such as ARRAY_SIZE(), FIELD_SIZEOF(),
min() and max(), among others.Signed-off-by: Robert P. J. Day
Acked-by: Randy Dunlap
Acked-by: Jan Engelhardt
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
11 Dec, 2006
1 commit
-
Add some kernel coding style comments, mostly pulled from emails
by Andrew Morton, Jesper Juhl, and Randy Dunlap.- add paragraph on switch/case indentation (with fixes)
- add paragraph on multiple-assignments
- add more on Braces
- add section on Spaces; add typeof, alignof, & __attribute__ with sizeof;
add more on postfix/prefix increment/decrement operators
- add paragraph on function breaks in source files; add info on
function prototype parameter names
- add paragraph on EXPORT_SYMBOL placement
- add section on /*-comment style, long-comment style, and data
declarations and comments
- correct some chapter number references that were missed when
chapters were renumberedSigned-off-by: Randy Dunlap
Acked-by: Jesper Juhl
Acked-by: Jan Engelhardt
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
30 Sep, 2006
1 commit
-
This patch (as776) adds a new chapter to Documentation/CodingStyle,
explaining the circumstances under which a function should return 0 for
failure and non-zero for success as opposed to a negative error code for
failure and 0 for success.Signed-off-by: Alan Stern
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
23 Jun, 2006
1 commit
-
Add a chapter on typedefs, copied from an email from Linus to lkml on Feb.
3, 2006. (Subject: Re: [RFC][PATCH 1/5] Virtualization/containers:
startup)Signed-off-by: Randy Dunlap
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
11 Jan, 2006
1 commit
-
Signed-off-by: Jesper Juhl
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
09 Jan, 2006
2 commits
-
Adds a bit of text to Documentation/Codingstyle to state that inlining
everything "just because" is a bad ideaSigned-off-by: Arjan van de Ven
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
18 Sep, 2005
1 commit
-
This patch adds a new chapter on memory allocation to
Documentation/CodingStyle.Signed-off-by: Pekka Enberg
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
11 Sep, 2005
1 commit
-
Signed-off-by: Pekka Enberg
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
17 Apr, 2005
1 commit
-
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.Let it rip!