27 Oct, 2010

40 commits

  • Update Documentation/sysrq.txt magic sysrq keys:

    - 'g' is for kgdb (not arch-specific);
    - add 2 new uses for 'v', remove the Voyager info;
    - add 'y' info (SPARC-64 specific);

    Signed-off-by: Randy Dunlap
    Cc: Jason Wessel
    Cc: "David S. Miller"
    Cc: "James E.J. Bottomley"
    Cc: David Airlie
    Acked-by: Alexander Shishkin
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • * 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6:
    PM / Runtime: fix recursive locking warning of lockdep from rpm_resume()

    Linus Torvalds
     
  • * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (53 commits)
    ACPI: install ACPI table handler before any dynamic tables being loaded
    ACPI / PM: Blacklist another machine that needs acpi_sleep=nonvs
    ACPI: Page based coalescing of I/O remappings optimization
    ACPI: Convert simple locking to RCU based locking
    ACPI: Pre-map 'system event' related register blocks
    ACPI: Add interfaces for ioremapping/iounmapping ACPI registers
    ACPI: Maintain a list of ACPI memory mapped I/O remappings
    ACPI: Fix ioremap size for MMIO reads and writes
    ACPI / Battery: Return -ENODEV for unknown values in get_property()
    ACPI / PM: Fix reference counting of power resources
    Subject: [PATCH] ACPICA: Fix Scope() op in module level code
    ACPI battery: support percentage battery remaining capacity
    ACPI: Make Embedded Controller command timeout delay configurable
    ACPI dock: move some functions to .init.text
    ACPI: thermal: remove unused limit code
    ACPI: static sleep_states[] and acpi_gts_bfs_check
    ACPI: remove dead code
    ACPI: delete dedicated MAINTAINERS entries for ACPI EC and BATTERY drivers
    ACPI: Only processor needs CPU_IDLE
    ACPICA: Update version to 20101013
    ...

    Linus Torvalds
     
  • * 'idle-release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-idle-2.6:
    intel_idle: do not use the LAPIC timer for ATOM C2
    intel_idle: add initial Sandy Bridge support
    acpi_idle: delete bogus data from cpuidle_state.power_usage
    intel_idle: delete bogus data from cpuidle_state.power_usage
    intel_idle: simplify test for leave_mm()

    Linus Torvalds
     
  • * 'sfi-release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-sfi-2.6:
    SFI: remove the v0.7 related definitions from sfi.h

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
    arch/tile: convert a BUG_ON to BUILD_BUG_ON
    arch/tile: make ptrace() work properly for TILE-Gx COMPAT mode
    arch/tile: support new info op generated by compiler
    arch/tile: minor whitespace/naming changes for string support files
    arch/tile: enable single-step support for TILE-Gx
    arch/tile: parameterize system PLs to support KVM port
    arch/tile: add Tilera's header as an open-source header
    arch/tile: Bomb C99 comments to C89 comments in tile's
    arch/tile: prevent corrupt top frame from causing backtracer runaway
    arch/tile: various top-level Makefile cleanups
    arch/tile: change lower bound on syscall error return to -4095
    arch/tile: properly export __mb_incoherent for modules
    arch/tile: provide a definition of MAP_STACK
    kmemleak: add TILE to the list of supported architectures.
    char: hvc: check for error case
    arch/tile: Add a warning if we try to allocate too much vmalloc memory.
    arch/tile: update some comments to clarify register usage.
    arch/tile: use better "punctuation" for VMSPLIT_3_5G and friends
    arch/tile: Use
    tile: replace some BUG_ON checks with BUILD_BUG_ON checks

    Linus Torvalds
     
  • * 'nfs-for-2.6.37' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6:
    NFS: rename nfs.upcall -> nfs.idmap
    NFS: Fix a compile issue in nfs_root

    Linus Torvalds
     
  • * akpm-incoming-1: (176 commits)
    scripts/checkpatch.pl: add check for declaration of pci_device_id
    scripts/checkpatch.pl: add warnings for static char that could be static const char
    checkpatch: version 0.31
    checkpatch: statement/block context analyser should look at sanitised lines
    checkpatch: handle EXPORT_SYMBOL for DEVICE_ATTR and similar
    checkpatch: clean up structure definition macro handline
    checkpatch: update copyright dates
    checkpatch: Add additional attribute #defines
    checkpatch: check for incorrect permissions
    checkpatch: ensure kconfig help checks only apply when we are adding help
    checkpatch: simplify and consolidate "missing space after" checks
    checkpatch: add check for space after struct, union, and enum
    checkpatch: returning errno typically should be negative
    checkpatch: handle casts better fixing false categorisation of : as binary
    checkpatch: ensure we do not collapse bracketed sections into constants
    checkpatch: suggest cleanpatch and cleanfile when appropriate
    checkpatch: types may sit on a line on their own
    checkpatch: fix regressions in "fix handling of leading spaces"
    div64_u64(): improve precision on 32bit platforms
    lib/parser: cleanup match_number()
    ...

    Linus Torvalds
     
  • Signed-off-by: Joe Perches
    Cc: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Add warnings for possible missing const uses of
    static char foo[] = "bar"
    that could be
    static const char foo[] = "bar"
    and
    static const char *foo[] = {"bar", "baz"}
    that could be
    static const char * const foo[] = {"bar", "baz"}

    Signed-off-by: Joe Perches
    Cc: Mike Frysinger
    Cc: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Signed-off-by: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Whitcroft
     
  • When tracking context to find a block or statement we need to use the
    sanitised lines, else perentheses '(' & ')' and braces '{' & '}' can throw
    the scanner out. Also fix up a couple of error outputs which include
    those sanitised lines incorrectly.

    Signed-off-by: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Whitcroft
     
  • Handly definitions similar to below. The definition macro spits out a
    symbol with a prefix. Add matching of any identifier prefix:

    DEVICE_ATTR(link_power_management_policy, S_IRUGO | S_IWUSR,
    ata_scsi_lpm_show, ata_scsi_lpm_put);
    EXPORT_SYMBOL_GPL(dev_attr_link_power_management_policy);

    Signed-off-by: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Whitcroft
     
  • Handle definitions such as the following correctly, it is not
    a complex statement:

    #define PREALLOC(NAME, START, END, FLAGS) { \
    .name = (NAME), \
    .start = (START), \
    .end = (END), \
    .flags = (FLAGS) \
    },

    Signed-off-by: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Whitcroft
     
  • Signed-off-by: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Whitcroft
     
  • On Wed, 2010-08-11 at 12:35 -0400, Dave Jones wrote:
    > I just got this from a patch I merged..
    >
    > ERROR: need consistent spacing around '*' (ctx:WxV)
    > #121: FILE: arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c:113:
    > +static struct pcc_cpu __percpu *pcc_cpu_info;
    > ^
    > which doesn't seem right.

    Perhaps these need to be added to checkpatch.

    [apw@canonical.com: added tests]
    Signed-off-by: Joe Perches
    Signed-off-by: Andy Whitcroft
    Cc: Dave Jones
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Throw an error when a source file has been given execute permissions using
    the mode change line present in git diffs. Also alow the filename
    matching to use the "diff" line in addition to the "+++" line, since the
    mode change lines appear before any "+++" lines.

    [apw@canonical.com: simplified filename logic slightly, added tests]
    Cc: Andy Whitcroft
    Acked-by: Linus Walleij
    Signed-off-by: Rabin Vincent
    Signed-off-by: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rabin Vincent
     
  • When checking the length of the help we need to be sure we are seeing the
    whole story before erroring. Firstly we only want to check when adding
    the help in the first place. Second we need to be sure that we are seeing
    the end of the entry, nominally when there is no context below or that
    context shows the start of the next entry.

    Signed-off-by: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Whitcroft
     
  • Commonise the code for missing spaces after struct, union, and enum such
    that they share the same code. Ensure we cover all the common cases in
    each case. Check against the sanitised line to ensure we do not report on
    comments and strings.

    Signed-off-by: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Whitcroft
     
  • Add spacing checks for struct, union, and enum definitions. Check the
    spacing after type and before the equals (=) and open brace ({).

    Based on a patch by Joe Perches.

    Cc: Joe Perches
    Signed-off-by: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Whitcroft
     
  • Add a (strict mode only) test to check for non-negative returns of what
    appear to be errno values as the majority case these should indeed be
    negative.

    Suggested-by: Andrew Morton
    Signed-off-by: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Whitcroft
     
  • The following incantation is triggering categorisation of its colon (:) as
    a binary form, which it is not:

    return foo ? (s8)bar : baz;

    Handle casts differently from types in the categoriser, allowing us to
    better track (s8)bar as a value and not a declaration.

    Reported-by: Jean Delvare
    Signed-off-by: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Whitcroft
     
  • When determining if a return () sequence is a function style bracketing we
    simplify the expression one bracket at a time replacing each with a
    constant. However this can trigger a false merge with expressions as
    below:

    return (foo)0;

    Prevent this false merging.

    Reported-by: Hitoshi Mitake
    Signed-off-by: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Whitcroft
     
  • When we hit types of whitespace which may be fixed by scripts/cleanpatch
    and scripts/cleanfile suggest their use in our report.

    Suggested-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Whitcroft
     
  • When the following form is used we have a type which fully fills a line.
    This means that a type may end at the end of line as well as at the
    following identifier.

    int **
    foo;

    Reported-by: Daniel Walker
    Signed-off-by: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Whitcroft
     
  • The patch "checkpatch: fix handling of leading spaces" added checks for
    leading spaces on lines, but this introduces regressions. Firstly it does
    not correctly detect when we are in a comment. Secondly it does not allow
    for preprocessor command spacing. Finally it does not allow for label
    indentation which is required to be less than one tab. Fix these up:

    Signed-off-by: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Whitcroft
     
  • The current implementation of div64_u64 for 32bit systems returns an
    approximately correct result when the divisor exceeds 32bits. Since doing
    64bit division using 32bit hardware is a long since solved problem we just
    use one of the existing proven methods.

    Additionally, add a div64_s64 function to correctly handle doing signed
    64bit division.

    Addresses https://bugzilla.redhat.com/show_bug.cgi?id=616105

    Signed-off-by: Brian Behlendorf
    Signed-off-by: Oleg Nesterov
    Cc: Ben Woodard
    Cc: Jeremy Fitzhardinge
    Cc: Mark Grondona
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Brian Behlendorf
     
  • Use new variable 'len' to make code more readable.

    Signed-off-by: Namhyung Kim
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Namhyung Kim
     
  • this_cpu_ptr() avoids an array lookup and can use the percpu offset of the
    local cpu directly.

    Signed-off-by: Christoph Lameter
    Cc: Eric Dumazet
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     
  • Improve 'lib_sort()' test and check that:
    o 'cmp()' is called only for elements which were present in the original list,
    i.e., the 'a' and 'b' parameters are valid
    o the resulted (sorted) list consists onlly of the original elements
    o intdoruce "poison" fields to make sure data around 'struc list_head' field
    are not corrupted.

    Signed-off-by: Artem Bityutskiy
    Cc: Don Mullis
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Artem Bityutskiy
     
  • This patch unifies 'list_sort_test()' messages a bit and makes sure all of
    them start with the "list_sort_test:" prefix to make it obvious for users
    where the messages come from.

    Signed-off-by: Artem Bityutskiy
    Cc: Don Mullis
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Artem Bityutskiy
     
  • The 'lib_sort()' test does not free memory if it fails, and it makes the
    kernel panic if it cannot allocate memory. This patch fixes the problem.

    This patch also changes several small things:
    o use 'list_add()' helper instead of adding manually
    o introduce temporary 'el1' variable to avoid ugly and unreadalbe
    "if" statement
    o make 'head' to be stack variable instead of 'kmalloc()'ed, which
    simplifies code a bit

    Overall, this patch is of clean-up type.

    Signed-off-by: Artem Bityutskiy
    Cc: Don Mullis
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Artem Bityutskiy
     
  • Instead of using own pseudo-random generator, use generic linux
    'random32()' function. Presumably, this should improve test coverage.

    At the same time, do the following changes:
    o Use shorter macro name for test list length
    o Do not use strange 'l_h' name for 'struct list_head' element,
    use 'list', because it is traditional name and thus, makes the
    code more obvious and readable.

    Signed-off-by: Artem Bityutskiy
    Cc: Don Mullis
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Artem Bityutskiy
     
  • I do not see any reason to use KERN_WARN for normal messages and
    KERN_EMERG for error messages in the lib_sort testing routine. Let's use
    more reasonable KERN_NORM and KERN_ERR levels.

    Signed-off-by: Artem Bityutskiy
    Cc: Don Mullis
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Artem Bityutskiy
     
  • While hunting a non-existing bug in 'list_sort()', I've improved the
    'list_sort_test()' function which tests the 'list_sort()' library call.
    Although at the end I found a bug in my code, but not in 'list_sort()', I
    think my clean-ups and improvements are worth merging because they make
    the test function better.

    This patch:

    Make the self-tests selectable via Kconfig rather than by manual enabling
    of DEBUG_LIST_SORT.

    Signed-off-by: Artem Bityutskiy
    Cc: Don Mullis
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Artem Bityutskiy
     
  • All percpu counters are linked to a global list on initialization and
    removed from it on destruction. The list is walked during CPU up/down.
    If a percpu counter is freed without being properly destroyed, the system
    will oops only on the next CPU up/down making it pretty nasty to track
    down. This patch adds debugobj support for percpu counters so that such
    problems can be found easily.

    As percpu counters don't make sense on stack and can't be statically
    initialized, debugobj support is pretty simple. It's initialized and
    activated on counter initialization, and deactivatd and destroyed on
    counter destruction. With this patch applied, the bug fixed by commit
    602586a83b719df0fbd94196a1359ed35aeb2df3 (shmem: put_super must
    percpu_counter_destroy) triggers the following warning on tmpfs unmount
    and the system won't oops on the next cpu up/down operation.

    ------------[ cut here ]------------
    WARNING: at lib/debugobjects.c:259 debug_print_object+0x5c/0x70()
    Hardware name: Bochs
    ODEBUG: free active (active state 0) object type: percpu_counter
    Modules linked in:
    Pid: 3999, comm: umount Not tainted 2.6.36-rc2-work+ #5
    Call Trace:
    [] warn_slowpath_common+0x7f/0xc0
    [] warn_slowpath_fmt+0x46/0x50
    [] debug_print_object+0x5c/0x70
    [] debug_check_no_obj_freed+0x125/0x210
    [] kfree+0xb3/0x2f0
    [] shmem_put_super+0x1d/0x30
    [] generic_shutdown_super+0x56/0xe0
    [] kill_anon_super+0x16/0x60
    [] kill_litter_super+0x27/0x30
    [] deactivate_locked_super+0x45/0x60
    [] deactivate_super+0x4a/0x70
    [] mntput_no_expire+0x86/0xe0
    [] sys_umount+0x6f/0x360
    [] system_call_fastpath+0x16/0x1b
    ---[ end trace cce2a341ba3611a7 ]---

    Signed-off-by: Tejun Heo
    Acked-by: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tejun Heo
     
  • Despite the idr_pre_get() kernel-doc, there are some cases where you can
    call idr_pre_get() from within locked regions. Add a description for such
    cases.

    See also: http://lkml.org/lkml/2010/9/16/462

    [akpm@linux-foundation.org: cleanups, grammatical fixes]
    Signed-off-by: Naohiro Aota
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Naohiro Aota
     
  • Signed-off-by: Andy Shevchenko
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • Add missing git as a prefix for git repositories in the few places it
    wasn't already used.

    Convert a space delimiter to a tab.

    Signed-off-by: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Removed by commit 0d58cef664e01f ("V4L/DVB: Remove obsolete zc0301 v4l
    driver").

    Signed-off-by: Joe Perches
    Acked-by: Amerigo Wang
    Cc: Mauro Carvalho Chehab
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches