Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 44952
b: refs/heads/master
c: fb76655
h: refs/heads/master
v: v3
  • Loading branch information
Len Brown committed Dec 16, 2006
1 parent 4d28cb8 commit eae8145
Show file tree
Hide file tree
Showing 3,694 changed files with 126,153 additions and 62,866 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: 8ea86e0ba7c9d16ae0f35cb0c4165194fa573f7a
refs/heads/master: fb7665544dd60e016494cd5531f5b65ddae22ddc
8 changes: 8 additions & 0 deletions trunk/CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -1808,6 +1808,14 @@ 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
20 changes: 20 additions & 0 deletions trunk/Documentation/ABI/testing/debugfs-pktcdvd
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
What: /debug/pktcdvd/pktcdvd[0-7]
Date: Oct. 2006
KernelVersion: 2.6.19
Contact: Thomas Maier <balagi@justmail.de>
Description:

debugfs interface
-----------------

The pktcdvd module (packet writing driver) creates
these files in debugfs:

/debug/pktcdvd/pktcdvd[0-7]/
info (0444) Lots of human readable driver
statistics and infos. Multiple lines!

Example:
-------

cat /debug/pktcdvd/pktcdvd0/info
72 changes: 72 additions & 0 deletions trunk/Documentation/ABI/testing/sysfs-class-pktcdvd
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
What: /sys/class/pktcdvd/
Date: Oct. 2006
KernelVersion: 2.6.19
Contact: Thomas Maier <balagi@justmail.de>
Description:

sysfs interface
---------------

The pktcdvd module (packet writing driver) creates
these files in the sysfs:
(<devid> is in format major:minor )

/sys/class/pktcdvd/
add (0200) Write a block device id (major:minor)
to create a new pktcdvd device and map
it to the block device.

remove (0200) Write the pktcdvd device id (major:minor)
to it to remove the pktcdvd device.

device_map (0444) Shows the device mapping in format:
pktcdvd[0-7] <pktdevid> <blkdevid>

/sys/class/pktcdvd/pktcdvd[0-7]/
dev (0444) Device id
uevent (0200) To send an uevent.

/sys/class/pktcdvd/pktcdvd[0-7]/stat/
packets_started (0444) Number of started packets.
packets_finished (0444) Number of finished packets.

kb_written (0444) kBytes written.
kb_read (0444) kBytes read.
kb_read_gather (0444) kBytes read to fill write packets.

reset (0200) Write any value to it to reset
pktcdvd device statistic values, like
bytes read/written.

/sys/class/pktcdvd/pktcdvd[0-7]/write_queue/
size (0444) Contains the size of the bio write
queue.

congestion_off (0644) If bio write queue size is below
this mark, accept new bio requests
from the block layer.

congestion_on (0644) If bio write queue size is higher
as this mark, do no longer accept
bio write requests from the block
layer and wait till the pktcdvd
device has processed enough bio's
so that bio write queue size is
below congestion off mark.
A value of <= 0 disables congestion
control.


Example:
--------
To use the pktcdvd sysfs interface directly, you can do:

# create a new pktcdvd device mapped to /dev/hdc
echo "22:0" >/sys/class/pktcdvd/add
cat /sys/class/pktcdvd/device_map
# assuming device pktcdvd0 was created, look at stat's
cat /sys/class/pktcdvd/pktcdvd0/stat/kb_written
# print the device id of the mapped block device
fgrep pktcdvd0 /sys/class/pktcdvd/device_map
# remove device, using pktcdvd0 device id 253:0
echo "253:0" >/sys/class/pktcdvd/remove
126 changes: 121 additions & 5 deletions trunk/Documentation/CodingStyle
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,37 @@ 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 @@ -69,7 +94,7 @@ void fun(int a, int b, int c)
next_statement;
}

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

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 @@ -81,6 +106,20 @@ 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 @@ -121,6 +160,49 @@ 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 @@ -152,7 +234,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 next chapter.
See chapter 6 (Functions).


Chapter 5: Typedefs
Expand Down Expand Up @@ -258,6 +340,20 @@ 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 @@ -306,16 +402,36 @@ 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 5 for a while. You can make
you should probably go back to chapter 6 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 kerneldoc format.
When commenting the kernel API functions, please use the kernel-doc 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 @@ -591,4 +707,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 30 April 2006.
Last updated on 2006-December-06.
12 changes: 6 additions & 6 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 kmem_cache_t, except that they use the dma-coherent allocator
much like a struct kmem_cache, 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 kmem_cache_t name); dev and size
The "name" is for diagnostics (like a struct kmem_cache 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(dma_addr_t dma_handle)
dma_is_consistent(struct device *dev, dma_addr_t dma_handle)

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

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(void *vaddr, size_t size,
dma_cache_sync(struct device *dev, void *vaddr, size_t size,
enum dma_data_direction direction)

Do a partial sync of memory that was allocated by
Expand Down
10 changes: 7 additions & 3 deletions trunk/Documentation/DocBook/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,13 @@ quiet_cmd_fig2png = FIG2PNG $@
###
# Help targets as used by the top-level makefile
dochelp:
@echo ' Linux kernel internal documentation in different formats:'
@echo ' xmldocs (XML DocBook), psdocs (Postscript), pdfdocs (PDF)'
@echo ' htmldocs (HTML), mandocs (man pages, use installmandocs to install)'
@echo ' Linux kernel internal documentation in different formats:'
@echo ' htmldocs - HTML'
@echo ' installmandocs - install man pages generated by mandocs'
@echo ' mandocs - man pages'
@echo ' pdfdocs - PDF'
@echo ' psdocs - Postscript'
@echo ' xmldocs - XML DocBook'

###
# Temporary files left by various tools
Expand Down
Loading

0 comments on commit eae8145

Please sign in to comment.