07 Jan, 2009

40 commits

  • Call kprobe_target indirectly. This prevents gcc to unroll a noinline
    function in caller function.

    I ported patches which had been discussed on
    http://sources.redhat.com/bugzilla/show_bug.cgi?id=3542

    Signed-off-by: Masami Hiramatsu
    Acked-by: Ananth N Mavinakayanahalli
    Cc: Jim Keniston
    Cc: David Miller
    Cc: Anil S Keshavamurthy
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masami Hiramatsu
     
  • When someone called register_*probe() from kernel-core code(not from
    module) and that probes a kernel module, users can remove the probed
    module because kprobe doesn't increment reference counter of the module.
    (on the other hand, if the kernel-module calls register_*probe, kprobe
    increments refcount of the probed module.)

    Currently, we have no register_*probe() calling from kernel-core(except
    smoke-test, but the smoke-test doesn't probe module), so there is no real
    bugs. But the logic is wrong(or not fair) and it can causes a problem
    when someone might want to probe module from kernel.

    After this patch is applied, even if someone put register_*probe() call in
    the kernel-core code, it increments the reference counter of the probed
    module, and it prevents user to remove the module until stopping probing
    it.

    Signed-off-by: Masami Hiramatsu
    Cc: Lai Jiangshan
    Cc: Ananth N Mavinakayanahalli
    Cc: Hiroshi Shimamoto
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masami Hiramatsu
     
  • In each case, if the NULL test is necessary, then the dereference should be
    moved below the NULL test.

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

    //
    @@
    type T;
    expression E;
    identifier i,fld;
    statement S;
    @@

    - T i = E->fld;
    + T i;
    ... when != E
    when != i
    if (E == NULL) S
    + i = E->fld;
    //

    Signed-off-by: Julia Lawall
    Acked-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Julia Lawall
     
  • Change the spi_s3c2410 driver to use the generic gpio calls that are now
    available.

    Signed-off-by: Ben Dooks
    Signed-off-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ben Dooks
     
  • This solves several issues:
    * It fixes the wrong idle clock polarity issue in a cleaner and less
    expensive way.
    * It handles the AT32AP7000 errata "SPI Chip Select 0 BITS field
    overrides other Chip Selects". Other chips, e.g. AT91SAM9261, have
    similar issues.

    Currently, the AT91RM9200 code path is left alone. But it might be
    interesting to try the same technique on RM9200 using a different CSR
    register.

    [dbrownell@users.sourceforge.net: restore debug message for activation]
    Signed-off-by: Haavard Skinnemoen
    Signed-off-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Haavard Skinnemoen
     
  • Currently, we have a flag called "new_1" which is basically equivalent
    to cpu_is_at91rm9200(). The latter is also called directly a few places.

    Clean up this mess by introducing a atmel_spi_v2() function for
    determining the controller version, and move all version dependent code
    over to use it. This allows us to remove the new_1 flag.

    Signed-off-by: Haavard Skinnemoen
    Signed-off-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Haavard Skinnemoen
     
  • Generalize the old at91rm9200 "bootstrap" bitbanging SPI master driver as
    "spi_gpio", so it works with arbitrary GPIOs and can be configured through
    platform_data. Such SPI masters support:

    - any number of bus instances (bus_num is the platform_device.id)
    - any number of chipselects (one GPIO per spi_device)
    - all four SPI_MODE values, and SPI_CS_HIGH
    - i/o word sizes from 1 to 32 bits;
    - devices configured as with any other spi_master controller

    When configured using platform_data, this provides relatively low clock
    rates. On platforms that support inlined GPIO calls, significantly
    improved transfer speeds are also possible with a semi-custom driver.
    (It's still painful when accessing flash memory, but less so.)

    Sanity checked by using this version to replace both native controllers on
    a board with six different SPI slaves, relying on three different
    SPI_MODE_* values and both SPI_CS_HIGH settings for correct operation.

    [akpm@linux-foundation.org: cleanups]
    Signed-off-by: David Brownell
    Acked-by: Magnus Damm
    Tested-by: Magnus Damm
    Cc: Torgil Svensson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     
  • Add missing kernel-doc notation:

    drivers/firmware/dmi_scan.c:475: No description found for parameter 'str'
    drivers/firmware/dmi_scan.c:592: No description found for parameter 'f'
    drivers/firmware/dmi_scan.c:592: No description found for parameter 'str'

    Signed-off-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • There are no argument named @flag in ncp_getopt(), remove it.

    Signed-off-by: Qinghuang Feng
    Cc: Randy Dunlap
    Cc: Petr Vandrovec
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Qinghuang Feng
     
  • The following is what it looks like before patching.
    It is not much readable.

    user@ubuntu:/proc/sys/fs/binfmt_misc$ cat status
    enableduser@ubuntu:/proc/sys/fs/binfmt_misc$

    Signed-off-by: Qinghuang Feng
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Qinghuang Feng
     
  • linux_binfmt uses list_head, so list.h is needed.

    [akpm@linux-foundation.org: fix `make headerscheck']
    Signed-off-by: Hiroshi Shimamoto
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hiroshi Shimamoto
     
  • Signed-off-by: Harvey Harrison
    Cc: "Darrick J. Wong"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Harvey Harrison
     
  • Add temperature sensor support for MacBook Air 2.

    Signed-off-by: Henrik Rydberg
    Cc: Nicolas Boichat
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Henrik Rydberg
     
  • of_node_put is needed before discarding a value received from
    of_find_node_by_name, eg in error handling code or when the device node is
    no longer used.

    The semantic match that catches the bug is as follows:
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @r exists@
    local idexpression struct device_node *n;
    position p1, p2;
    struct device_node *n1;
    statement S;
    identifier f;
    expression E;
    expression *ptr != NULL;
    @@

    n@p1 = of_find_node_by_name(...)
    ...
    if (!n) S
    ... when != of_node_put(n)
    when != n1 = f(n,...)
    when != E = n
    when any
    when strict
    (
    return \(0\|\|ptr\);
    |
    return@p2 ...;
    |
    of_node_put(n);
    |
    n1 = f(n,...)
    |
    E = n
    )

    @script:python@
    p1 << r.p1;
    p2 << r.p2;
    @@

    print "* file: %s of_find_node_by_name %s return %s" % (p1[0].file,p1[0].line,p2[0].line)
    //

    Signed-off-by: Nicolas Palix
    Signed-off-by: Julia Lawall
    Acked-by: Stephen Rothwell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nicolas Palix
     
  • It turns out that the adt7470's automatic fan control algorithm only works
    when the temperature sensors get updated. This in turn happens only when
    someone tells the chip to read its temperature sensors. Regrettably, this
    means that we have to drive the chip periodically.

    Signed-off-by: Darrick J. Wong
    Cc: Jean Delvare
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Darrick J. Wong
     
  • The adt7470 driver currently assumes that 1s is the proper time to wait to
    read all temperature sensors. However, the correct time is 200ms *
    number_of_sensors. This patch sets the default time to provide for 10
    sensors and then lowers it based on the number of sensor inputs that have
    nozero values.

    Signed-off-by: Darrick J. Wong
    Cc: Jean Delvare
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Darrick J. Wong
     
  • In the small window that it takes to read the temperature sensors, the pwm
    outputs momentarily drop to 0. This causes a noticeable hiccup in fan
    speed, which is slightly annoying. The solution is to manually program
    the pwm output with whatever the automatic value is and then shift the
    fans to manual control while reading temperatures. Once that is done, put
    the fans back to whatever mode of control was there before.

    Signed-off-by: Darrick J. Wong
    Cc: Jean Delvare
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Darrick J. Wong
     
  • Modify some hwmon drivers to use DIV_ROUND_CLOSEST instead of bloating
    source with (naughty) macros.

    Signed-off-by: Darrick J. Wong
    Cc: Jean Delvare
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Darrick J. Wong
     
  • Signed-off-by: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Whitcroft
     
  • Clean up checkpatch using perlcritic.

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

    Andy Whitcroft
     
  • In the general use case struct file_operations should be a const object.
    Check for and warn where it is not. As suggested by Steven and Ingo.

    Acked-by: Steven Rostedt
    Cc: Ingo Molnar
    Signed-off-by: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Whitcroft
     
  • When checking for assignments within if conditionals we check the whole of
    the condition, but the match is performed using a line constrained regular
    expression. This means we can miss split conditionals or those on the
    second line. Allow the check to span lines.

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

    Andy Whitcroft
     
  • Ensure we do not report identifiers containing the word static as static
    declarations. For example this should not be reported as an unecessary
    assignement of 0:

    long nr_static = 0;

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

    Andy Whitcroft
     
  • When picking up a complete statement or block for analysis we cannot
    simply track open/close/etc parenthesis we must take into account
    preprocessor section boundaries.

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

    Andy Whitcroft
     
  • We are miscategorising a continuation fragment following an operator
    which may lead to us thinking that there is a space after it when there is
    not. Fix this up.

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

    Andy Whitcroft
     
  • Loosen spacing checks to correctly detect this valid use of a typedef:

    typedef struct rcu_data *(*get_data_func)(int);

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

    Andy Whitcroft
     
  • Seems like every other release we have someone who updates vmlinux.lds.h
    and adds C-visible symbols without VMLINUX_SYMBOL() around them. So start
    checking the file and reject assignments which have plain symbols on
    either side.

    [apw@canonical.com: soften the check, add tests]
    Signed-off-by: Mike Frysinger
    Signed-off-by: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     
  • It seems to be a common idiom to include braces on conditionals in all
    contexts including return. Allow this exception to the return is not a
    function checks. Reported by Kay Sievers.

    Cc: Kay Sievers
    Signed-off-by: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Whitcroft
     
  • Some people work internally with -p0-patches which has the danger that one
    forgets to convert them to -p1 before mainlining. Bitten myself and seen
    p0-patches in mailing lists occasionally, this patch adds a warning to
    checkpatch.pl in case a patch is -p0. If you really want, you can fool
    this check to generate false positives, this is why it just spits a
    warning. Making the check 100% proof is trickier than it looks, so let's
    start with a version which catches the cases of real use.

    [apw@canonical.com: update message language, handle null prefix, add tests]
    Signed-off-by: Wolfram Sang
    Signed-off-by: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

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

    Andy Whitcroft
     
  • Update my email address to my new work address. Also, as per our recent
    email conversation remove Randy and Joel from the maintainers list.
    Finally add LKML so that emails are recorded somewhere.

    Signed-off-by: Andy Whitcroft
    Cc: Randy Dunlap
    Cc: Joel Schopp
    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
     
  • Disallow spaces within multiple pointer stars (*) in both casts and
    definitions. Both of these would now be reported:

    (char * *)
    char * *foo;

    Also now consistently detects and reports the attributes within these
    structures making the error report itself clearer.

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

    Andy Whitcroft
     
  • When we are detecting whether a comment is open when we start a hunk we
    check for the first comment edge in the hunk and assume its inverse.
    However if the hunk contains something like below, then we will assume
    that a comment was open. Update this heuristic to see if the comment edge
    is obviously within double quotes and ignore it if so:

    foo(" */);

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

    Andy Whitcroft
     
  • Detect the colons (:) which make up secondary bitfield declarations and
    apply binary colon checks. For example the following is common idiom:

    int foo:1,
    bar:1;

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

    Andy Whitcroft
     
  • Add __weak as an official attribute. This tends to be used in a location
    where the automated attribute detector misses it.

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

    Andy Whitcroft
     
  • Ensure we do not trigger the complex macros checks on structure member
    assignment, for example:

    #define foo .bar = 10

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

    Andy Whitcroft
     
  • Some people use double star '**' as a comment continuation, and start
    comments with complete lines of stars. Widen the implied comment
    detection to pick these up.

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

    Andy Whitcroft
     
  • When detecting implied comments from leading stars we may incorrectly
    think we have detected an edge one way or the other when we have not if we
    drop off the end of the last hunk. Fix this up.

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

    Andy Whitcroft
     
  • in_atomic() is not for driver use so report any such use as an ERROR.
    Also in_atomic() is often used to determine if we may sleep, but it is not
    reliable in this use model therefore strongly discourage its use.

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

    Andy Whitcroft