Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 44570
b: refs/heads/master
c: 44853a8
h: refs/heads/master
v: v3
  • Loading branch information
Andrew Victor authored and Russell King committed Dec 8, 2006
1 parent 0d40683 commit 219563b
Show file tree
Hide file tree
Showing 5,080 changed files with 111,948 additions and 220,672 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8eefb2b7ad6195f4324629f35be0b9443cd8ee96
refs/heads/master: 44853a81ed3b1c4b3cee19622e2fc5687158c46f
11 changes: 0 additions & 11 deletions trunk/CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -1808,14 +1808,6 @@ S: Kruislaan 419
S: 1098 VA Amsterdam
S: The Netherlands

N: Jiri Kosina
E: jikos@jikos.cz
E: jkosina@suse.cz
D: Generic HID layer - original code split, fixes
D: Various ACPI fixes, keeping correct battery state through suspend
D: various lockdep annotations, autofs and other random bugfixes
S: Prague, Czech Republic

N: Gene Kozin
E: 74604.152@compuserve.com
W: http://www.sangoma.com
Expand Down Expand Up @@ -2606,9 +2598,6 @@ S: Ucitelska 1576
S: Prague 8
S: 182 00 Czech Republic

N: Rick Payne
D: RFC2385 Support for TCP

N: Barak A. Pearlmutter
E: bap@cs.unm.edu
W: http://www.cs.unm.edu/~bap/
Expand Down
2 changes: 2 additions & 0 deletions trunk/Documentation/00-INDEX
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ firmware_class/
- request_firmware() hotplug interface info.
floppy.txt
- notes and driver options for the floppy disk driver.
ftape.txt
- notes about the floppy tape device driver.
hayes-esp.txt
- info on using the Hayes ESP serial driver.
highuid.txt
Expand Down
20 changes: 0 additions & 20 deletions trunk/Documentation/ABI/testing/debugfs-pktcdvd

This file was deleted.

72 changes: 0 additions & 72 deletions trunk/Documentation/ABI/testing/sysfs-class-pktcdvd

This file was deleted.

2 changes: 1 addition & 1 deletion trunk/Documentation/Changes
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ udev
----
udev is a userspace application for populating /dev dynamically with
only entries for devices actually present. udev replaces the basic
functionality of devfs, while allowing persistent device naming for
functionality of devfs, while allowing persistant device naming for
devices.

FUSE
Expand Down
126 changes: 5 additions & 121 deletions trunk/Documentation/CodingStyle
Original file line number Diff line number Diff line change
Expand Up @@ -35,37 +35,12 @@ In short, 8-char indents make things easier to read, and have the added
benefit of warning you when you're nesting your functions too deep.
Heed that warning.

The preferred way to ease multiple indentation levels in a switch statement is
to align the "switch" and its subordinate "case" labels in the same column
instead of "double-indenting" the "case" labels. E.g.:

switch (suffix) {
case 'G':
case 'g':
mem <<= 30;
break;
case 'M':
case 'm':
mem <<= 20;
break;
case 'K':
case 'k':
mem <<= 10;
/* fall through */
default:
break;
}


Don't put multiple statements on a single line unless you have
something to hide:

if (condition) do_this;
do_something_everytime;

Don't put multiple assignments on a single line either. Kernel coding style
is super simple. Avoid tricky expressions.

Outside of comments, documentation and except in Kconfig, spaces are never
used for indentation, and the above example is deliberately broken.

Expand Down Expand Up @@ -94,7 +69,7 @@ void fun(int a, int b, int c)
next_statement;
}

Chapter 3: Placing Braces and Spaces
Chapter 3: Placing Braces

The other issue that always comes up in C styling is the placement of
braces. Unlike the indent size, there are few technical reasons to
Expand All @@ -106,20 +81,6 @@ brace last on the line, and put the closing brace first, thusly:
we do y
}

This applies to all non-function statement blocks (if, switch, for,
while, do). E.g.:

switch (action) {
case KOBJ_ADD:
return "add";
case KOBJ_REMOVE:
return "remove";
case KOBJ_CHANGE:
return "change";
default:
return NULL;
}

However, there is one special case, namely functions: they have the
opening brace at the beginning of the next line, thus:

Expand Down Expand Up @@ -160,49 +121,6 @@ supply of new-lines on your screen is not a renewable resource (think
25-line terminal screens here), you have more empty lines to put
comments on.

3.1: Spaces

Linux kernel style for use of spaces depends (mostly) on
function-versus-keyword usage. Use a space after (most) keywords. The
notable exceptions are sizeof, typeof, alignof, and __attribute__, which look
somewhat like functions (and are usually used with parentheses in Linux,
although they are not required in the language, as in: "sizeof info" after
"struct fileinfo info;" is declared).

So use a space after these keywords:
if, switch, case, for, do, while
but not with sizeof, typeof, alignof, or __attribute__. E.g.,
s = sizeof(struct file);

Do not add spaces around (inside) parenthesized expressions. This example is
*bad*:

s = sizeof( struct file );

When declaring pointer data or a function that returns a pointer type, the
preferred use of '*' is adjacent to the data name or function name and not
adjacent to the type name. Examples:

char *linux_banner;
unsigned long long memparse(char *ptr, char **retptr);
char *match_strdup(substring_t *s);

Use one space around (on each side of) most binary and ternary operators,
such as any of these:

= + - < > * / % | & ^ <= >= == != ? :

but no space after unary operators:
& * + - ~ ! sizeof typeof alignof __attribute__ defined

no space before the postfix increment & decrement unary operators:
++ --

no space after the prefix increment & decrement unary operators:
++ --

and no space around the '.' and "->" structure member operators.


Chapter 4: Naming

Expand Down Expand Up @@ -234,7 +152,7 @@ variable that is used to hold a temporary value.

If you are afraid to mix up your local variable names, you have another
problem, which is called the function-growth-hormone-imbalance syndrome.
See chapter 6 (Functions).
See next chapter.


Chapter 5: Typedefs
Expand Down Expand Up @@ -340,20 +258,6 @@ generally easily keep track of about 7 different things, anything more
and it gets confused. You know you're brilliant, but maybe you'd like
to understand what you did 2 weeks from now.

In source files, separate functions with one blank line. If the function is
exported, the EXPORT* macro for it should follow immediately after the closing
function brace line. E.g.:

int system_is_up(void)
{
return system_state == SYSTEM_RUNNING;
}
EXPORT_SYMBOL(system_is_up);

In function prototypes, include parameter names with their data types.
Although this is not required by the C language, it is preferred in Linux
because it is a simple way to add valuable information for the reader.


Chapter 7: Centralized exiting of functions

Expand Down Expand Up @@ -402,36 +306,16 @@ time to explain badly written code.
Generally, you want your comments to tell WHAT your code does, not HOW.
Also, try to avoid putting comments inside a function body: if the
function is so complex that you need to separately comment parts of it,
you should probably go back to chapter 6 for a while. You can make
you should probably go back to chapter 5 for a while. You can make
small comments to note or warn about something particularly clever (or
ugly), but try to avoid excess. Instead, put the comments at the head
of the function, telling people what it does, and possibly WHY it does
it.

When commenting the kernel API functions, please use the kernel-doc format.
When commenting the kernel API functions, please use the kerneldoc format.
See the files Documentation/kernel-doc-nano-HOWTO.txt and scripts/kernel-doc
for details.

Linux style for comments is the C89 "/* ... */" style.
Don't use C99-style "// ..." comments.

The preferred style for long (multi-line) comments is:

/*
* This is the preferred style for multi-line
* comments in the Linux kernel source code.
* Please use it consistently.
*
* Description: A column of asterisks on the left side,
* with beginning and ending almost-blank lines.
*/

It's also important to comment data, whether they are basic types or derived
types. To this end, use just one data declaration per line (no commas for
multiple data declarations). This leaves you room for a small comment on each
item, explaining its use.


Chapter 9: You've made a mess of it

That's OK, we all do. You've probably been told by your long-time Unix
Expand Down Expand Up @@ -707,4 +591,4 @@ Kernel CodingStyle, by greg@kroah.com at OLS 2002:
http://www.kroah.com/linux/talks/ols_2002_kernel_codingstyle_talk/html/

--
Last updated on 2006-December-06.
Last updated on 30 April 2006.
14 changes: 7 additions & 7 deletions trunk/Documentation/DMA-API.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ To get this part of the dma_ API, you must #include <linux/dmapool.h>
Many drivers need lots of small dma-coherent memory regions for DMA
descriptors or I/O buffers. Rather than allocating in units of a page
or more using dma_alloc_coherent(), you can use DMA pools. These work
much like a struct kmem_cache, except that they use the dma-coherent allocator
much like a kmem_cache_t, except that they use the dma-coherent allocator
not __get_free_pages(). Also, they understand common hardware constraints
for alignment, like queue heads needing to be aligned on N byte boundaries.

Expand All @@ -94,7 +94,7 @@ The pool create() routines initialize a pool of dma-coherent buffers
for use with a given device. It must be called in a context which
can sleep.

The "name" is for diagnostics (like a struct kmem_cache name); dev and size
The "name" is for diagnostics (like a kmem_cache_t name); dev and size
are like what you'd pass to dma_alloc_coherent(). The device's hardware
alignment requirement for this type of data is "align" (which is expressed
in bytes, and must be a power of two). If your device has no boundary
Expand Down Expand Up @@ -431,10 +431,10 @@ be identical to those passed in (and returned by
dma_alloc_noncoherent()).

int
dma_is_consistent(struct device *dev, dma_addr_t dma_handle)
dma_is_consistent(dma_addr_t dma_handle)

returns true if the device dev is performing consistent DMA on the memory
area pointed to by the dma_handle.
returns true if the memory pointed to by the dma_handle is actually
consistent.

int
dma_get_cache_alignment(void)
Expand All @@ -459,7 +459,7 @@ anything like this. You must also be extra careful about accessing
memory you intend to sync partially.

void
dma_cache_sync(struct device *dev, void *vaddr, size_t size,
dma_cache_sync(void *vaddr, size_t size,
enum dma_data_direction direction)

Do a partial sync of memory that was allocated by
Expand Down Expand Up @@ -489,7 +489,7 @@ size is the size of the area (must be multiples of PAGE_SIZE).
flags can be or'd together and are

DMA_MEMORY_MAP - request that the memory returned from
dma_alloc_coherent() be directly writable.
dma_alloc_coherent() be directly writeable.

DMA_MEMORY_IO - request that the memory returned from
dma_alloc_coherent() be addressable using read/write/memcpy_toio etc.
Expand Down
2 changes: 1 addition & 1 deletion trunk/Documentation/DMA-ISA-LPC.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ lock.

Once the DMA transfer is finished (or timed out) you should disable
the channel again. You should also check get_dma_residue() to make
sure that all data has been transferred.
sure that all data has been transfered.

Example:

Expand Down
Loading

0 comments on commit 219563b

Please sign in to comment.