pandora-kernel.git
15 years agobinfmt_som.c: add MODULE_LICENSE
Adrian Bunk [Thu, 16 Oct 2008 05:02:37 +0000 (22:02 -0700)]
binfmt_som.c: add MODULE_LICENSE

Add the missing MODULE_LICENSE("GPL").

Reported-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Matthew Wilcox <matthew@wil.cx>
Cc: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: version: 0.24
Andy Whitcroft [Thu, 16 Oct 2008 05:02:36 +0000 (22:02 -0700)]
checkpatch: version: 0.24

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: allow for comments either side of a brace on case
Andy Whitcroft [Thu, 16 Oct 2008 05:02:36 +0000 (22:02 -0700)]
checkpatch: allow for comments either side of a brace on case

When specifying case we may have comments and/or braces at the end without
actually having a 'statement'.  Allow for these to occur in any order.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: suspect indent handle macro continuation
Andy Whitcroft [Thu, 16 Oct 2008 05:02:35 +0000 (22:02 -0700)]
checkpatch: suspect indent handle macro continuation

When ignoring a macro in the middle of a conditional, we need to ignore
the macro start and any continuation lines.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: trailing statements ensure we report the end of the line
Andy Whitcroft [Thu, 16 Oct 2008 05:02:34 +0000 (22:02 -0700)]
checkpatch: trailing statements ensure we report the end of the line

When reporting some complex trailing statements we report only the
starting line of the error, that tends to imply the shown line is in error
and confuse the reader.  As we do know where the actual error is report
that line too with an appropriate gap marker where applicable.

    #ERROR: trailing statements should be on next line
    #1: FILE: Z202.c:1:
    +       for (pbh = page_buffers(bh->b_page); pbh != bh;
    +               pbh = pbh->b_this_page, key++);
    #ERROR: trailing statements should be on next line
    #4: FILE: Z202.c:4:
    +       for (pbh = page_buffers(bh->b_page);
    [...]
    +               pbh = pbh->b_this_page, key++);

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: DEFINE_ macros are real definitions for exports
Andy Whitcroft [Thu, 16 Oct 2008 05:02:34 +0000 (22:02 -0700)]
checkpatch: DEFINE_ macros are real definitions for exports

When we want to confirm an export is directly after its definition we need
to allow for DEFINE_ style macros.  Add these to the execeptions.
Refactor the exceptions.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: complex macros checks miss square brackets
Andy Whitcroft [Thu, 16 Oct 2008 05:02:33 +0000 (22:02 -0700)]
checkpatch: complex macros checks miss square brackets

We are missing 'simple' values which include square brackets.  Refactor to
ensure we handle nesting correctly and detect these simple forms.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: suspect code indent must stop at #else/#elif
Andy Whitcroft [Thu, 16 Oct 2008 05:02:32 +0000 (22:02 -0700)]
checkpatch: suspect code indent must stop at #else/#elif

When we hit and #else or #elif we know we are meeting an alternative piece
of code.  All bets are off on indent if we did not see the open of the
control so stop checking.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: pull out known acceptable typedefs
Andy Whitcroft [Thu, 16 Oct 2008 05:02:32 +0000 (22:02 -0700)]
checkpatch: pull out known acceptable typedefs

Within the type checker we have a number of common kernel types which must
be implemented as typedefs.  Pull those out so that we can use the same
expressions to trigger exclusions.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: accept any sized le/be type
Andy Whitcroft [Thu, 16 Oct 2008 05:02:31 +0000 (22:02 -0700)]
checkpatch: accept any sized le/be type

We are likely going to have 24 bit types.  Expand the type matcher to
match any size.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: macros which define structure members are not complex
Andy Whitcroft [Thu, 16 Oct 2008 05:02:31 +0000 (22:02 -0700)]
checkpatch: macros which define structure members are not complex

We often see macros which define structure members, these are not complex
and necessarily do not have braces or brackets.  For example:

    #define _PLIST_HEAD_INIT(head)                      \
        .prio_list = LIST_HEAD_INIT((head).prio_list),  \
        .node_list = LIST_HEAD_INIT((head).node_list)

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: handle do without braces if we have enough context
Andy Whitcroft [Thu, 16 Oct 2008 05:02:30 +0000 (22:02 -0700)]
checkpatch: handle do without braces if we have enough context

If we have sufficient context detect and handle do without braces ({).
Else these incorrectly trigger a trailing statements error for the
associated while.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: labels are not possible types
Andy Whitcroft [Thu, 16 Oct 2008 05:02:30 +0000 (22:02 -0700)]
checkpatch: labels are not possible types

A label is not a candidate for a possible type.  Exclude them.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: do is not a possible type
Andy Whitcroft [Thu, 16 Oct 2008 05:02:29 +0000 (22:02 -0700)]
checkpatch: do is not a possible type

A do without braces '{' may trigger a false possible type 'do' and then
this may be interpreted as an external definition of foo():

do
foo();
while (bar);

Add do to the type exclusions.  Fix up tests so we can check for them.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: version: 0.23
Andy Whitcroft [Thu, 16 Oct 2008 05:02:28 +0000 (22:02 -0700)]
checkpatch: version: 0.23

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: ensure we only apply checks to the lines within hunks
Andy Whitcroft [Thu, 16 Oct 2008 05:02:28 +0000 (22:02 -0700)]
checkpatch: ensure we only apply checks to the lines within hunks

We should only apply source checks to lines within hunks.  Checks which
are anchored in the context may falsly trigger in the commentory.  Ensure
they only match within valid hunk lines.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: suspect indent count condition lines correctly
Andy Whitcroft [Thu, 16 Oct 2008 05:02:27 +0000 (22:02 -0700)]
checkpatch: suspect indent count condition lines correctly

Correct calculation of the number of lines of condition where we have
suspect indent.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: check line endings in text format files
Andy Whitcroft [Thu, 16 Oct 2008 05:02:27 +0000 (22:02 -0700)]
checkpatch: check line endings in text format files

Firmware may be included in the kernel as .ihex files.  These are
inherantly text, but not source.  The line ending checks are applicable to
these kinds of file, allow just these checks to apply to all files.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: handle comment/quote nesting correctly
Andy Whitcroft [Thu, 16 Oct 2008 05:02:26 +0000 (22:02 -0700)]
checkpatch: handle comment/quote nesting correctly

Ensure that a close comment cannot incorrectly trigger in the middle of a
string.  Reported by Jaswinder Singh.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Cc: Jaswinder Singh <jaswinder@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: suppress errors triggered by short patch
Andy Whitcroft [Thu, 16 Oct 2008 05:02:25 +0000 (22:02 -0700)]
checkpatch: suppress errors triggered by short patch

When the last hunk of a patch is short it will trigger errors from
checkpatch:

    Use of uninitialized value in pattern match (m//)
    at /usr/local/bin/checkpatch.pl line 394.
    Use of uninitialized value in concatenation (.) or string
    at /usr/local/bin/checkpatch.pl line 397.
    Use of uninitialized value in pattern match (m//)

Avoid touching beyond the last line.  Reported by Julien Brunel.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Cc: Julien Brunel <brunel@diku.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: case/default checks should only check changed lines
Andy Whitcroft [Thu, 16 Oct 2008 05:02:25 +0000 (22:02 -0700)]
checkpatch: case/default checks should only check changed lines

We should only be checking changes lines for the trailing statement check
on case/default statements.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: version: 0.22
Andy Whitcroft [Thu, 16 Oct 2008 05:02:24 +0000 (22:02 -0700)]
checkpatch: version: 0.22

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: perform indent checks on perl
Andy Whitcroft [Thu, 16 Oct 2008 05:02:24 +0000 (22:02 -0700)]
checkpatch: perform indent checks on perl

So that we eat our own dog food ensure the indent checks apply to perl
too.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: report the correct lines for single statement blocks
Andy Whitcroft [Thu, 16 Oct 2008 05:02:23 +0000 (22:02 -0700)]
checkpatch: report the correct lines for single statement blocks

Report the correct lines for single statement blocks.  Currently we are
reporting the right number of lines, but not skipping the negative lines.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: %Lx tests should hand %% as a literal
Andy Whitcroft [Thu, 16 Oct 2008 05:02:23 +0000 (22:02 -0700)]
checkpatch: %Lx tests should hand %% as a literal

Ensure that we handle literal %'s correctly when adjacent to a %Lx.

%Lx bad
%%Lx good
%%%Lx bad

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: suspect indent -- skip over preprocessor, label and blank lines
Andy Whitcroft [Thu, 16 Oct 2008 05:02:22 +0000 (22:02 -0700)]
checkpatch: suspect indent -- skip over preprocessor, label and blank lines

We should skip over and check the lines which follow preprocessor
statements, labels, and blank lines.  These all have legitimate reasons to
be indented differently.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: report the real first line of all suspect indents
Andy Whitcroft [Thu, 16 Oct 2008 05:02:21 +0000 (22:02 -0700)]
checkpatch: report the real first line of all suspect indents

We are currently only reporting syspect indents if the conditional is
modified but the indent missmatch could be generated by the body changing,
make sure we catch both.  Also only report the first line of the body, and
more importantly make sure we report the raw copy of the line.  Finally
report the indent levels to make it easier to understand what is wrong.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: report any absolute references to kernel source files
Andy Whitcroft [Thu, 16 Oct 2008 05:02:21 +0000 (22:02 -0700)]
checkpatch: report any absolute references to kernel source files

Absolute references to kernel source files are generally only useful
locally to the originator of the patch.  Check for any such references and
report them.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: reduce warnings for #include of asm/foo.h to check from arch/bar.c
Andy Whitcroft [Thu, 16 Oct 2008 05:02:20 +0000 (22:02 -0700)]
checkpatch: reduce warnings for #include of asm/foo.h to check from arch/bar.c

It is much more likely that an architecture file will want to directly
include asm header files.  Reduce this WARNING to a CHECK when the
referencing file is in the arch directory.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: include/asm checks should be anchored
Andy Whitcroft [Thu, 16 Oct 2008 05:02:20 +0000 (22:02 -0700)]
checkpatch: include/asm checks should be anchored

It is possible to have other include/asm paths within the tree which are
not subject to the do not edit checks.  Ignore those.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: fix up comment checks search to scan the entire block
Andy Whitcroft [Thu, 16 Oct 2008 05:02:19 +0000 (22:02 -0700)]
checkpatch: fix up comment checks search to scan the entire block

We are not counting the lines in the block correctly which causes the
comment scan to stop prematurly and thus miss comments which end at the
end of the block.  Fix this up.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: complex macros -- fix up extension handling
Andy Whitcroft [Thu, 16 Oct 2008 05:02:18 +0000 (22:02 -0700)]
checkpatch: complex macros -- fix up extension handling

Only pull in new extension lines where the current contents ends with a \.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: ____cacheline_aligned et al are modifiers
Andy Whitcroft [Thu, 16 Oct 2008 05:02:18 +0000 (22:02 -0700)]
checkpatch: ____cacheline_aligned et al are modifiers

Add the cacheline alignment modifiers to the attribute lists.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: add tests for the attribute matcher
Andy Whitcroft [Thu, 16 Oct 2008 05:02:17 +0000 (22:02 -0700)]
checkpatch: add tests for the attribute matcher

Add support for direct testing of the attribute matcher, add basic tests
for it.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: switch indent allow plain return
Andy Whitcroft [Thu, 16 Oct 2008 05:02:17 +0000 (22:02 -0700)]
checkpatch: switch indent allow plain return

It is a common and sane idiom to allow a single return on the end of a
case statement:

switch (...) {
case foo: return bar;
}

Add an exception for this.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: conditional indent -- labels have different indent rules
Andy Whitcroft [Thu, 16 Oct 2008 05:02:16 +0000 (22:02 -0700)]
checkpatch: conditional indent -- labels have different indent rules

Labels have different indent rules and must be ignored when checking the
conditional indent levels.  Also correct identify labels in single
statement conditionals.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: values: double ampersand may be unary
Andy Whitcroft [Thu, 16 Oct 2008 05:02:16 +0000 (22:02 -0700)]
checkpatch: values: double ampersand may be unary

It is possible to use double ampersand (&&) in unary context where it
means the address of a goto label.  Handle spacing for it.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocheckpatch: square brackets -- exemption for array slices in braces
Andy Whitcroft [Thu, 16 Oct 2008 05:02:15 +0000 (22:02 -0700)]
checkpatch: square brackets -- exemption for array slices in braces

It is wholy reasonable to have square brackets representing array slices
in braces on the same line.  These should be spaced.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosparc64: use iommu_num_pages function in IOMMU code
Joerg Roedel [Thu, 16 Oct 2008 05:02:14 +0000 (22:02 -0700)]
sparc64: use iommu_num_pages function in IOMMU code

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Acked-by: David S. Miller <davem@davemloft.net>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Muli Ben-Yehuda <muli@il.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoalpha: use iommu_num_pages function in IOMMU code
Joerg Roedel [Thu, 16 Oct 2008 05:02:13 +0000 (22:02 -0700)]
alpha: use iommu_num_pages function in IOMMU code

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Muli Ben-Yehuda <muli@il.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agopowerpc: use iommu_num_pages function in IOMMU code
Joerg Roedel [Thu, 16 Oct 2008 05:02:13 +0000 (22:02 -0700)]
powerpc: use iommu_num_pages function in IOMMU code

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Muli Ben-Yehuda <muli@il.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agox86: convert Calgary IOMMU driver to generic iommu_num_pages function
Joerg Roedel [Thu, 16 Oct 2008 05:02:12 +0000 (22:02 -0700)]
x86: convert Calgary IOMMU driver to generic iommu_num_pages function

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Muli Ben-Yehuda <muli@il.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agox86, AMD IOMMU: convert driver to generic iommu_num_pages function
Joerg Roedel [Thu, 16 Oct 2008 05:02:11 +0000 (22:02 -0700)]
x86, AMD IOMMU: convert driver to generic iommu_num_pages function

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Muli Ben-Yehuda <muli@il.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agox86: convert GART driver to generic iommu_num_pages function
Joerg Roedel [Thu, 16 Oct 2008 05:02:11 +0000 (22:02 -0700)]
x86: convert GART driver to generic iommu_num_pages function

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Muli Ben-Yehuda <muli@il.ibm.com>
Cc: Dave Airlie <airlied@linux.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agointroduce generic iommu_num_pages function
Joerg Roedel [Thu, 16 Oct 2008 05:02:10 +0000 (22:02 -0700)]
introduce generic iommu_num_pages function

This patch introduces the generic iommu_num_pages function. It can be used by
a given memory area.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Muli Ben-Yehuda <muli@il.ibm.com>
Cc: Dave Airlie <airlied@linux.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agopowerpc: rename iommu_num_pages function to iommu_nr_pages
Joerg Roedel [Thu, 16 Oct 2008 05:02:09 +0000 (22:02 -0700)]
powerpc: rename iommu_num_pages function to iommu_nr_pages

This is a preparation patch for introducing a generic iommu_num_pages function.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Muli Ben-Yehuda <muli@il.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosparc64: rename iommu_num_pages function to iommu_nr_pages
Joerg Roedel [Thu, 16 Oct 2008 05:02:08 +0000 (22:02 -0700)]
sparc64: rename iommu_num_pages function to iommu_nr_pages

This is a preparation patch for introducing a generic iommu_num_pages function.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Acked-by: David S. Miller <davem@davemloft.net>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Muli Ben-Yehuda <muli@il.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agox86: rename iommu_num_pages function to iommu_nr_pages
Joerg Roedel [Thu, 16 Oct 2008 05:02:07 +0000 (22:02 -0700)]
x86: rename iommu_num_pages function to iommu_nr_pages

This series of patches re-introduces the iommu_num_pages function so that
it can be used by each architecture specific IOMMU implementations.  The
series also changes IOMMU implementations for X86, Alpha, PowerPC and
UltraSparc.  The other implementations are not yet changed because the
modifications required are not obvious and I can't test them on real
hardware.

This patch:

This is a preparation patch for introducing a generic iommu_num_pages function.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Muli Ben-Yehuda <muli@il.ibm.com>
Cc: Dave Airlie <airlied@linux.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocompat: generic compat get/settimeofday
Christoph Hellwig [Thu, 16 Oct 2008 05:02:06 +0000 (22:02 -0700)]
compat: generic compat get/settimeofday

Nothing arch specific in get/settimeofday.  The details of the timeval
conversion varied a little from arch to arch, but all with the same
results.

Also add an extern declaration for sys_tz to linux/time.h because externs
in .c files are fowned upon.  I'll kill the externs in various other files
in a sparate patch.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: David S. Miller <davem@davemloft.net> [ sparc bits ]
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Acked-by: Kyle McMartin <kyle@mcmartin.ca>
Cc: Matthew Wilcox <matthew@wil.cx>
Cc: Grant Grundler <grundler@parisc-linux.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocompat: move cp_compat_stat to common code
Christoph Hellwig [Thu, 16 Oct 2008 05:02:05 +0000 (22:02 -0700)]
compat: move cp_compat_stat to common code

struct stat / compat_stat is the same on all architectures, so
cp_compat_stat should be, too.

Turns out it is, except that various architectures have slightly and some
high2lowuid/high2lowgid or the direct assignment instead of the
SET_UID/SET_GID that expands to the correct one anyway.

This patch replaces the arch-specific cp_compat_stat implementations with
a common one based on the x86-64 one.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: David S. Miller <davem@davemloft.net> [ sparc bits ]
Acked-by: Kyle McMartin <kyle@mcmartin.ca> [ parisc bits ]
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoinclude/linux/clk.h: fix comment
Alex Raimondi [Thu, 16 Oct 2008 05:02:03 +0000 (22:02 -0700)]
include/linux/clk.h: fix comment

clk_get and clk_put may not be used from within interrupt context.  Change
comment to this function.

Signed-off-by: Alex Raimondi <raimondi@miromico.ch>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: john stultz <johnstul@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoAdd kerneldoc documentation for new printk format extensions
Andi Kleen [Thu, 16 Oct 2008 05:02:02 +0000 (22:02 -0700)]
Add kerneldoc documentation for new printk format extensions

Add documentation in kerneldoc for new printk format extensions

This patch documents the new %pS/%pF options in printk in kernel doc.

Hope I didn't miss any other extension.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoSubmittingPatches: add a reference to Andi's OLS paper
Andi Kleen [Thu, 16 Oct 2008 05:02:02 +0000 (22:02 -0700)]
SubmittingPatches: add a reference to Andi's OLS paper

For this year's OLS I wrote a paper on successfull strategies to submit
difficult kernel patches.  Add a reference to it to SubmittingPatches.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoDocument panic_on_unrecovered_nmi sysctl
Bernhard Walle [Thu, 16 Oct 2008 05:02:01 +0000 (22:02 -0700)]
Document panic_on_unrecovered_nmi sysctl

This adds "panic_on_unrecovered_nmi" sysctl to
Documentation/filesystems/proc.txt. The text is mainly taken from
http://readlist.com/lists/vger.kernel.org/linux-kernel/43/217998.html.

Signed-off-by: Bernhard Walle <bwalle@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotaint: fix kernel-doc
Randy Dunlap [Thu, 16 Oct 2008 05:02:00 +0000 (22:02 -0700)]
taint: fix kernel-doc

Move print_tainted() kernel-doc to avoid the following error:

Error(/var/linsrc/mmotm-2008-1002-1617//kernel/panic.c:155): cannot understand prototype: 'struct tnt '

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Andi Kleen <andi@firstfloor.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoRemove Andrew Morton's http://www.zip.com.au/~akpm/
FD Cami [Thu, 16 Oct 2008 05:02:00 +0000 (22:02 -0700)]
Remove Andrew Morton's www.zip.com.au/~akpm/

Remove Andrew Morton's http://www.zip.com.au/~akpm/ urls, update to new
ones when necessary, delete references otherwise.

There are still instances of that living in:
Documentation/zh_CN/HOWTO
Documentation/zh_CN/SubmittingPatches
Documentation/ko_KR/HOWTO
Documentation/ja_JP/SubmittingPatches

Signed-off-by: Francois Cami <francois.cami@free.fr>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoRemove Andrew Morton's old email accounts
Francois Cami [Thu, 16 Oct 2008 05:01:59 +0000 (22:01 -0700)]
Remove Andrew Morton's old email accounts

People can use the real name an an index into MAINTAINERS to find the
current email address.

Signed-off-by: Francois Cami <francois.cami@free.fr>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agodocumentation: explain memory barriers
Randy Dunlap [Thu, 16 Oct 2008 05:01:59 +0000 (22:01 -0700)]
documentation: explain memory barriers

We want all uses of memory barriers to be explained in the source code.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agokernel/kallsyms.c: fix double return
WANG Cong [Thu, 16 Oct 2008 05:01:57 +0000 (22:01 -0700)]
kernel/kallsyms.c: fix double return

Commit 6dd06c9fbe025f542bce4cdb91790c0f91962722 ("module: make
module_address_lookup safe") introduced double returns in the function
kallsyms_lookup(), it's weird.  The second one should be removed.

Signed-off-by: WANG Cong <wangcong@zeuux.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoepoll: drop unnecessary test
Davide Libenzi [Thu, 16 Oct 2008 05:01:56 +0000 (22:01 -0700)]
epoll: drop unnecessary test

Thomas found that there is an unnecessary (always true) test in
ep_send_events().  The callback never inserts into ->rdllink while the
send loop is performed, and also does the ~EP_PRIVATE_BITS test.  Given
we're holding the mutex during this time, the conditions tested inside the
loop are always true.  This patch drops the test done inside the
re-insertion loop.

Signed-off-by: Davide Libenzi <davidel@xmailserver.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoAT91: atmel_pwm only available for certain AT91 processors
Andrew Victor [Thu, 16 Oct 2008 05:01:55 +0000 (22:01 -0700)]
AT91: atmel_pwm only available for certain AT91 processors

Only three of Atmel's AT91 processors (SAM9263, SAM9RL and CAP9) include a
PWM controller.

It should therefore only be possible to enable the misc/atmel_pwm.c driver
on those processors (and not all AT91 processors).

Signed-off-by: Andrew Victor <linux@maxim.org.za>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoFix typo in the FIRMWARE_IN_KERNEL help
Alberto Bertogli [Thu, 16 Oct 2008 05:01:53 +0000 (22:01 -0700)]
Fix typo in the FIRMWARE_IN_KERNEL help

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoexec.c, compat.c: fix count(), compat_count() bounds checking
Jason Baron [Thu, 16 Oct 2008 05:01:52 +0000 (22:01 -0700)]
exec.c, compat.c: fix count(), compat_count() bounds checking

With MAX_ARG_STRINGS set to 0x7FFFFFFF, and being passed to 'count()' and
compat_count(), it would appear that the current max bounds check of
fs/exec.c:394:

if(++i > max)
return -E2BIG;

would never trigger. Since 'i' is of type int, so values would wrap and the
function would continue looping.

Simple fix seems to be chaning ++i to i++ and checking for '>='.

Signed-off-by: Jason Baron <jbaron@redhat.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: "Ollie Wild" <aaw@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agokernel/sys.c: improve code generation
Andrew Morton [Thu, 16 Oct 2008 05:01:51 +0000 (22:01 -0700)]
kernel/sys.c: improve code generation

utsname() is quite expensive to calculate.  Cache it in a local.

          text    data     bss     dec     hex filename
before:  11136     720      16   11872    2e60 kernel/sys.o
after:   11096     720      16   11832    2e38 kernel/sys.o

Acked-by: Vegard Nossum <vegard.nossum@gmail.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: "Serge E. Hallyn" <serue@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoutsname: completely overwrite prior information
Vegard Nossum [Thu, 16 Oct 2008 05:01:51 +0000 (22:01 -0700)]
utsname: completely overwrite prior information

On sethostname() and setdomainname(), previous information may be retained
if it was longer than than the new hostname/domainname.

This can be demonstrated trivially by calling sethostname() first with a
long name, then with a short name, and then calling uname() to retrieve
the full buffer that contains the hostname (and possibly parts of the old
hostname), one just has to look past the terminating zero.

I don't know if we should really care that much (hence the RFC); the only
scenarios I can possibly think of is administrator putting something
sensitive in the hostname (or domain name) by accident, and changing it
back will not undo the mistake entirely, though it's not like we can
recover gracefully from "rm -rf /" either...  The other scenario is
namespaces (CLONE_NEWUTS) where some information may be unintentionally
"inherited" from the previous namespace (a program wants to hide the
original name and does clone + sethostname, but some information is still
left).

I think the patch may be defended on grounds of the principle of least
surprise.  But I am not adamant :-)

(I guess the question now is whether userspace should be able to
write embedded NULs into the buffer or not...)

At least the observation has been made and the patch has been presented.

Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: "Serge E. Hallyn" <serue@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agodontdiff: more updates to be closer to gitignore
Randy Dunlap [Thu, 16 Oct 2008 05:01:48 +0000 (22:01 -0700)]
dontdiff: more updates to be closer to gitignore

defkeymap.c_shipped should be diffed if it is changed.
Reported-by: Mike Galbraith <efault@gmx.de>
COPYING, CREDITS, .mailmap should be diffed if they are changed.
keywords.c_shipped & lex.c_shipped should be diffed when changed.
parse.[ch]_shipped should be diffed when changed.
Reported-by: Sam Ravnborg <sam@ravnborg.org>
vsyscall* updates from a .gitignore patch by "Denis V. Lunev" <den@openvz.org>.

*.so.dbg from a .gitignore patch by Thomas Gleixner <tglx@linutronix.de>.

binoffset from a .gitignore patch by Uwe Kleine-Koenig
<Uwe.Kleine-Koenig@digi.com>.

Module.markers from a .gitignore patch by Matthew Wilcox
<willy@linux.intel.com>.

vmlinux*.lds* should be diffed if changed.
Reported-by: Etienne Lorrain <etienne_lorrain@yahoo.fr>
vmlinux.lds from a .gitignore patch by Daniel Guilak
<daniel@danielguilak.com>.

*.scr should be diffed if changed.

Lots of updates from http://lkml.org/lkml/2008/5/20/32 Reported-by: Bart
Van Assche <bart.vanassche@gmail.com>

Use ncscope.* instead of *cscope* since the latter may catch too many files.

Add *.elf, from a .gitignore patch by Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>.

Make firmware entries match .gitignore entries.

Make some entries less greedy by removing trailing '*'.

Remove "make_times_h" (no such file).
Remove "filelist" (no such file).
Remove "dummy_sym.c" (no such file).
Remove "gen-kdb_cmds.c" (no such file).
Remove "gentbl" (no such file).
Remove "kconfig.tk" (no such file).
Remove "tkparse" (no such file).
Remove "sim710_d.h" (no such file).
Remove "53c8xx_d.h" (no such file).
Add "syscalltab.h" (generated file).

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agodoc: typo in Documentation/filesystems/nfsroot.txt
Shane McDonald [Thu, 16 Oct 2008 05:01:46 +0000 (22:01 -0700)]
doc: typo in Documentation/filesystems/nfsroot.txt

Add a missing word to the explanation of the purpose of the zdisk and
bzdisk make targets.

Signed-off-by: Shane McDonald <mcdonald.shane@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoprofiling: dynamically enable readprofile at runtime
Dave Hansen [Thu, 16 Oct 2008 05:01:46 +0000 (22:01 -0700)]
profiling: dynamically enable readprofile at runtime

Way too often, I have a machine that exhibits some kind of crappy
behavior.  The CPU looks wedged in the kernel or it is spending way too
much system time and I wonder what is responsible.

I try to run readprofile.  But, of course, Ubuntu doesn't enable it by
default.  Dang!

The reason we boot-time enable it is that it takes a big bufffer that we
generally can only bootmem alloc.  But, does it hurt to at least try and
runtime-alloc it?

To use:
echo 2 > /sys/kernel/profile

Then run readprofile like normal.

This should fix the compile issue with allmodconfig.  I've compile-tested
on a bunch more configs now including a few more architectures.

Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agorlimit: permit setting RLIMIT_NOFILE to RLIM_INFINITY
Adam Tkac [Thu, 16 Oct 2008 05:01:45 +0000 (22:01 -0700)]
rlimit: permit setting RLIMIT_NOFILE to RLIM_INFINITY

When a process wants to set the limit of open files to RLIM_INFINITY it
gets EPERM even if it has CAP_SYS_RESOURCE capability.

For example, BIND does:

...
#elif defined(NR_OPEN) && defined(__linux__)
        /*
         * Some Linux kernels don't accept RLIM_INFINIT; the maximum
         * possible value is the NR_OPEN defined in linux/fs.h.
         */
        if (resource == isc_resource_openfiles && rlim_value == RLIM_INFINITY) {
                rl.rlim_cur = rl.rlim_max = NR_OPEN;
                unixresult = setrlimit(unixresource, &rl);
                if (unixresult == 0)
                        return (ISC_R_SUCCESS);
        }
#elif ...

If we allow setting RLIMIT_NOFILE to RLIM_INFINITY we increase portability
- you don't have to check if OS is linux and then use different schema for
limits.

The spec says "Specifying RLIM_INFINITY as any resource limit value on a
successful call to setrlimit() shall inhibit enforcement of that resource
limit." and we're presently not doing that.

Cc: Michael Kerrisk <mtk.manpages@googlemail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosysrq: add enable_mask in sysrq_moom_op
Naohiro Ooiwa [Thu, 16 Oct 2008 05:01:43 +0000 (22:01 -0700)]
sysrq: add enable_mask in sysrq_moom_op

It is written in the Documentation/sysrq.txt that oom-killer is enabled
when we set "64" in /proc/sys/kernel/sysrq:

<Documentation/sysrq.txt>

    Here is the list of possible values in /proc/sys/kernel/sysrq:
         64 - enable signalling of processes (term, kill, oom-kill)
                                                          ^^^^^^^^

but enable_mask is not set in sysrq_moom_op.

Signed-off-by: Naohiro Ooiwa <nooiwa@miraclelinux.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoMake the taint flags reliable
Andi Kleen [Thu, 16 Oct 2008 05:01:41 +0000 (22:01 -0700)]
Make the taint flags reliable

It's somewhat unlikely that it happens, but right now a race window
between interrupts or machine checks or oopses could corrupt the tainted
bitmap because it is modified in a non atomic fashion.

Convert the taint variable to an unsigned long and use only atomic bit
operations on it.

Unfortunately this means the intvec sysctl functions cannot be used on it
anymore.

It turned out the taint sysctl handler could actually be simplified a bit
(since it only increases capabilities) so this patch actually removes
code.

[akpm@linux-foundation.org: remove unneeded include]
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoinitramfs: add option to preserve mtime from initramfs cpio images
Nye Liu [Thu, 16 Oct 2008 05:01:40 +0000 (22:01 -0700)]
initramfs: add option to preserve mtime from initramfs cpio images

When unpacking the cpio into the initramfs, mtimes are not preserved by
default.  This patch adds an INITRAMFS_PRESERVE_MTIME option that allows
mtimes stored in the cpio image to be used when constructing the
initramfs.

For embedded applications that run exclusively out of the initramfs, this
is invaluable:

When building embedded application initramfs images, its nice to know when
the files were actually created during the build process - that makes it
easier to see what files were modified when so we can compare the files
that are being used on the image with the files used during the build
process.  This might help (for example) to determine if the target system
has all the updated files you expect to see w/o having to check MD5s etc.

In our environment, the whole system runs off the initramfs partition, and
seeing the modified times of the shared libraries (for example) helps us
find bugs that may have been introduced by the build system incorrectly
propogating outdated shared libraries into the image.

Similarly, many of the initializion/configuration files in /etc might be
dynamically built by the build system, and knowing when they were modified
helps us sanity check whether the target system has the "latest" files
etc.

Finally, we might use last modified times to determine whether a hot fix
should be applied or not to the running ramfs.

Signed-off-by: Nye Liu <nyet@nyet.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoKconfig: eliminate "def_bool n" constructs
Jan Beulich [Thu, 16 Oct 2008 05:01:38 +0000 (22:01 -0700)]
Kconfig: eliminate "def_bool n" constructs

Using "def_bool n" is pointless, simply using bool here appears more
appropriate.

Further, retaining such options that don't have a prompt and aren't
selected by anything seems also at least questionable.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agowait: kill is_sync_wait()
Tejun Heo [Thu, 16 Oct 2008 05:01:38 +0000 (22:01 -0700)]
wait: kill is_sync_wait()

is_sync_wait() is used to distinguish between sync and async waits.
Basically sync waits are the ones initialized with init_waitqueue_entry()
and async ones with init_waitqueue_func_entry().  The sync/async
distinction is used only in prepare_to_wait[_exclusive]() and its only
function is to skip setting the current task state if the wait is async.
This has a few problems.

* No one uses it.  None of func_entry users use prepare_to_wait()
  functions, so the code path never gets executed.

* The distinction is bogus.  Maybe back when func_entry is used only
  by aio but it's now also used by epoll and in future possibly by 9p
  and poll/select.

* Taking @state as argument and ignoring it silenly depending on how
  @wait is initialized is just a bad error-prone API.

* It prevents func_entry waits from using wait->private for no good
  reason.

This patch kills is_sync_wait() and the associated code paths from
prepare_to_wait[_exclusive]().  As there was no user of these code paths,
this patch doesn't cause any behavior difference.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agovsprintf: use new vsprintf symbolic function pointer format
Bjorn Helgaas [Thu, 16 Oct 2008 05:01:35 +0000 (22:01 -0700)]
vsprintf: use new vsprintf symbolic function pointer format

Use the '%pF' format to get rid of an "#ifdef DEBUG" and make some printks
atomic.

This removes the last in-tree uses of print_fn_descriptor_symbol().  I
marked print_fn_descriptor_symbol() deprecated and scheduled it for
removal next year to give time for out-of-tree modules to be updated.

parisc's print_fn_descriptor_symbol() is currently broken there (it needs
to dereference the function pointer similar to ia64 and power).  This
patch shouldn't make anything worse, but it means we need to fix
dereference_function_descriptor() instead of print_fn_descriptor_symbol()
to get meaningful initcall_debug output.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agofix random typos
Danny ter Haar [Thu, 16 Oct 2008 05:01:34 +0000 (22:01 -0700)]
fix random typos

Signed-off-by: Danny ter Haar <dth@cistron.nl>
Cc: Patrick McHardy <kaber@trash.net>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Avi Kivity <avi@qumranet.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoidentify_ramdisk_image(): correct typo about return value in comment
Geert Uytterhoeven [Thu, 16 Oct 2008 05:01:32 +0000 (22:01 -0700)]
identify_ramdisk_image(): correct typo about return value in comment

identify_ramdisk_image() returns 0 (not -1) if a gzipped ramdisk is found:

if (buf[0] == 037 && ((buf[1] == 0213) || (buf[1] == 0236))) {
printk(KERN_NOTICE
       "RAMDISK: Compressed image found at block %d\n",
       start_block);
nblocks = 0;
^^^^^^^^^^^
goto done;
}

...

done:
sys_lseek(fd, start_block * BLOCK_SIZE, 0);
kfree(buf);
return nblocks;
^^^^^^^^^^^^^^

Hence correct the typo in the comment, which has existed since the
addition of compressed ramdisk support in 1.3.48.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonubus: fix mis-indented statement
Ilpo Järvinen [Thu, 16 Oct 2008 05:01:31 +0000 (22:01 -0700)]
nubus: fix mis-indented statement

It seems this is the right way around because otherwise the len usage in
the outer loop would be pretty pointless.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoFix Documentation/filesystems/ramfs-rootfs-initramfs.txt
frans [Thu, 16 Oct 2008 05:01:30 +0000 (22:01 -0700)]
Fix Documentation/filesystems/ramfs-rootfs-initramfs.txt

First a file hello.c is created, then the file hello2.c is compiled.
Change this to hello.c

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Rob Landley <rob@landley.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoeeepc: depends on RFKILL
Randy Dunlap [Thu, 16 Oct 2008 05:01:29 +0000 (22:01 -0700)]
eeepc: depends on RFKILL

EEEPC_LAPTOP uses RFKILL, so the former should depend on RFKILL.
Build errors happen when EEEPC_LAPTOP=y and RFKILL=m.

eeepc-laptop.c:(.text+0xd5a7b): undefined reference to `rfkill_allocate'
eeepc-laptop.c:(.text+0xd5b04): undefined reference to `rfkill_register'
eeepc-laptop.c:(.text+0xd5b48): undefined reference to `rfkill_allocate'
eeepc-laptop.c:(.text+0xd5bd4): undefined reference to `rfkill_register'
eeepc-laptop.c:(.text+0xd5ece): undefined reference to `rfkill_unregister'
eeepc-laptop.c:(.text+0xd5ef6): undefined reference to `rfkill_unregister'
make[1]: *** [.tmp_vmlinux1] Error 1

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Corentin Chary <corentincj@iksaif.net>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Karol Kozimor <sziwan@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agodrivers/misc: Use DIV_ROUND_UP
Julia Lawall [Thu, 16 Oct 2008 05:01:27 +0000 (22:01 -0700)]
drivers/misc: Use DIV_ROUND_UP

The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /
(d)) but is perhaps more readable.

An extract of the semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@haskernel@
@@

#include <linux/kernel.h>

@depends on haskernel@
expression n,d;
@@

(
- (n + d - 1) / d
+ DIV_ROUND_UP(n,d)
|
- (n + (d - 1)) / d
+ DIV_ROUND_UP(n,d)
)

@depends on haskernel@
expression n,d;
@@

- DIV_ROUND_UP((n),d)
+ DIV_ROUND_UP(n,d)

@depends on haskernel@
expression n,d;
@@

- DIV_ROUND_UP(n,(d))
+ DIV_ROUND_UP(n,d)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoinit.h: remove long-dead __setup_null_param() macro
Robert P. J. Day [Thu, 16 Oct 2008 05:01:27 +0000 (22:01 -0700)]
init.h: remove long-dead __setup_null_param() macro

This macro appears to have been unused for ages, and there are no
invocations of it anywhere in the source tree.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agokernel/dma.c: remove a CVS keyword
Adrian Bunk [Thu, 16 Oct 2008 05:01:26 +0000 (22:01 -0700)]
kernel/dma.c: remove a CVS keyword

Remove a CVS keyword that wasn't updated for a long time from a comment.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoinclude/linux/mount.h: remove CVS keyword
Adrian Bunk [Thu, 16 Oct 2008 05:01:25 +0000 (22:01 -0700)]
include/linux/mount.h: remove CVS keyword

Remove a CVS keyword that wasn't updated for a long time from a comment.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agomisc: replace __FUNCTION__ with __func__
Harvey Harrison [Thu, 16 Oct 2008 05:01:25 +0000 (22:01 -0700)]
misc: replace __FUNCTION__ with __func__

__FUNCTION__ is gcc-specific, use __func__

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoinclude: replace __FUNCTION__ with __func__
Harvey Harrison [Thu, 16 Oct 2008 05:01:24 +0000 (22:01 -0700)]
include: replace __FUNCTION__ with __func__

__FUNCTION__ is gcc-specific, use __func__

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoolpc: olpc_battery.c sparse endian annotations
Harvey Harrison [Thu, 16 Oct 2008 05:01:23 +0000 (22:01 -0700)]
olpc: olpc_battery.c sparse endian annotations

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Acked-by: Andres Salomon <dilinger@queued.net>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agouml: remove the dead TTY_LOG code
Adrian Bunk [Thu, 16 Oct 2008 05:01:22 +0000 (22:01 -0700)]
uml: remove the dead TTY_LOG code

Remove the dead CONFIG_TTY_LOG (no kconfig option).

Reported-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agopm: document use of RTC in pm_trace
Frans Pop [Thu, 16 Oct 2008 05:01:21 +0000 (22:01 -0700)]
pm: document use of RTC in pm_trace

As pm_trace uses the system's hardware clock to save its magic value,
users of that option should be warned that using this debug option will
result in an incorrect system time after resume.

Signed-off-by: Frans Pop <elendil@planet.nl>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agopm: rework disabling of user mode helpers during suspend/hibernation
Rafael J. Wysocki [Thu, 16 Oct 2008 05:01:21 +0000 (22:01 -0700)]
pm: rework disabling of user mode helpers during suspend/hibernation

We currently use a PM notifier to disable user mode helpers before suspend
and hibernation and to re-enable them during resume.  However, this is not
an ideal solution, because if any drivers want to upload firmware into
memory before suspend, they have to use a PM notifier for this purpose and
there is no guarantee that the ordering of PM notifiers will be as
expected (ie.  the notifier that disables user mode helpers has to be run
after the driver's notifier used for uploading the firmware).

For this reason, it seems better to move the disabling and enabling of
user mode helpers to separate functions that will be called by the PM core
as necessary.

[akpm@linux-foundation.org: remove unneeded ifdefs]
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoalpha: notify_cpu_starting() compile fixlet
Alexey Dobriyan [Thu, 16 Oct 2008 05:01:19 +0000 (22:01 -0700)]
alpha: notify_cpu_starting() compile fixlet

arch/alpha/kernel/smp.c:153: error: implicit declaration of function 'notify_cpu_starting'

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoAlpha Miata: remove dead URL
Adrian Bunk [Thu, 16 Oct 2008 05:01:19 +0000 (22:01 -0700)]
Alpha Miata: remove dead URL

Remove a dead URL.

Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoasm-h8300/md.h: remove CVS keyword
Adrian Bunk [Thu, 16 Oct 2008 05:01:18 +0000 (22:01 -0700)]
asm-h8300/md.h: remove CVS keyword

Remove a CVS keyword that wasn't updated for a long time from a comment.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoh8300: GENERIC_BUG support
Yoshinori Sato [Thu, 16 Oct 2008 05:01:17 +0000 (22:01 -0700)]
h8300: GENERIC_BUG support

CONFIG_GENERIC_BUG support.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoh8300: update timer handler - misc update
Yoshinori Sato [Thu, 16 Oct 2008 05:01:17 +0000 (22:01 -0700)]
h8300: update timer handler - misc update

- Update selection
- Update common timer handler
- Add support functions

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoh8300: update timer handler - new files
Yoshinori Sato [Thu, 16 Oct 2008 05:01:16 +0000 (22:01 -0700)]
h8300: update timer handler - new files

New timer handler files.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoh8300: update timer handler - delete files
Yoshinori Sato [Thu, 16 Oct 2008 05:01:16 +0000 (22:01 -0700)]
h8300: update timer handler - delete files

Delete old timer handler.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agouclinux: fix gzip header parsing in binfmt_flat.c
Volodymyr G. Lukiianyk [Thu, 16 Oct 2008 05:01:15 +0000 (22:01 -0700)]
uclinux: fix gzip header parsing in binfmt_flat.c

There are off-by-one errors in decompress_exec() when calculating the length of
optional "original file name" and "comment" fields: the "ret" index is not
incremented when terminating '\0' character is reached. The check of the buffer
overflow (after an "extra-field" length was taken into account) is also fixed.

I've encountered this off-by-one error when tried to reuse
gzip-header-parsing part of the decompress_exec() function.  There was an
"original file name" field in the payload (with miscalculated length) and
zlib_inflate() returned Z_DATA_ERROR.  But after the fix similar to this
one all worked fine.

Signed-off-by: Volodymyr G Lukiianyk <volodymyrgl@gmail.com>
Acked-by: Greg Ungerer <gerg@snapgear.com>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agomm: do_generic_file_read() never gets a NULL 'filp' argument
Krishna Kumar [Thu, 16 Oct 2008 05:01:13 +0000 (22:01 -0700)]
mm: do_generic_file_read() never gets a NULL 'filp' argument

The 'filp' argument to do_generic_file_read() is never NULL.

Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agohugetlb: handle updating of ACCESSED and DIRTY in hugetlb_fault()
David Gibson [Thu, 16 Oct 2008 05:01:11 +0000 (22:01 -0700)]
hugetlb: handle updating of ACCESSED and DIRTY in hugetlb_fault()

The page fault path for normal pages, if the fault is neither a no-page
fault nor a write-protect fault, will update the DIRTY and ACCESSED bits
in the page table appropriately.

The hugepage fault path, however, does not do this, handling only no-page
or write-protect type faults.  It assumes that either the ACCESSED and
DIRTY bits are irrelevant for hugepages (usually true, since they are
never swapped) or that they are handled by the arch code.

This is inconvenient for some software-loaded TLB architectures, where the
_PAGE_ACCESSED (_PAGE_DIRTY) bits need to be set to enable read (write)
access to the page at the TLB miss.  This could be worked around in the
arch TLB miss code, but the TLB miss fast path can be made simple more
easily if the hugetlb_fault() path handles this, as the normal page fault
path does.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Cc: William Lee Irwin III <wli@holomorphy.com>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: Adam Litke <agl@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>