25 Mar, 2010

3 commits

  • Fix a fatal error in scripts/kernel-doc when a function signature uses
    __init_or_module (just ignore that string):

    Error(drivers/base/platform.c:568): cannot understand prototype: 'struct platform_device * __init_or_module platform_create_bundle(struct platform_driver *driver, int (*probe)(struct platform_device *), struct resource *res, unsigned int n_res, const void *data, size_t size) '

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

    Randy Dunlap
     
  • Commit 22dd5b0cba50a197aaa3bd2790a29ee2e8e4e372 (fix perlcritic warnings)
    broke the ability to handle STDIN because the three argument version of
    open() cannot handle standard IO-streams (which is mentioned in
    PerlBestPractices, too).

    Signed-off-by: Wolfram Sang
    Cc: Stephen Hemminger
    Acked-by: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Wolfram Sang
     
  • scripts/kernel-doc erroneously says:

    Warning(include/linux/skbuff.h:410): Excess struct/union/enum/typedef member 'cb' description in 'sk_buff'

    on this line in struct sk_buff:
    char cb[48] __aligned(8);

    due to treating the last field as the struct member name, so teach
    kernel-doc to ignore __aligned(x) in structs.

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

    Randy Dunlap
     

13 Mar, 2010

2 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (56 commits)
    doc: fix typo in comment explaining rb_tree usage
    Remove fs/ntfs/ChangeLog
    doc: fix console doc typo
    doc: cpuset: Update the cpuset flag file
    Fix of spelling in arch/sparc/kernel/leon_kernel.c no longer needed
    Remove drivers/parport/ChangeLog
    Remove drivers/char/ChangeLog
    doc: typo - Table 1-2 should refer to "status", not "statm"
    tree-wide: fix typos "ass?o[sc]iac?te" -> "associate" in comments
    No need to patch AMD-provided drivers/gpu/drm/radeon/atombios.h
    devres/irq: Fix devm_irq_match comment
    Remove reference to kthread_create_on_cpu
    tree-wide: Assorted spelling fixes
    tree-wide: fix 'lenght' typo in comments and code
    drm/kms: fix spelling in error message
    doc: capitalization and other minor fixes in pnp doc
    devres: typo fix s/dev/devm/
    Remove redundant trailing semicolons from macros
    fix typo "definetly" -> "definitely" in comment
    tree-wide: s/widht/width/g typo in comments
    ...

    Fix trivial conflict in Documentation/laptops/00-INDEX

    Linus Torvalds
     
  • scripts/kernel-doc mishandles a function that has a multi-line function
    short description and no function parameters. The observed problem was
    from drivers/scsi/scsi_netlink.c:

    /**
    * scsi_netlink_init - Called by SCSI subsystem to intialize
    * the SCSI transport netlink interface
    *
    **/

    kernel-doc treated the " * " line as a Description: section with only a
    newline character in the Description contents. This caused
    output_highlight() to complain: "output_highlight got called with no
    args?", plus produce a perl call stack backtrace.

    The fix is just to ignore Description sections if they only contain "\n".

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

    Randy Dunlap
     

08 Mar, 2010

1 commit


07 Mar, 2010

15 commits

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

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

    Alberto Panizzo
     
  • Based on Arjan's suggestion, extend the list of ops structures that should
    be const.

    Signed-off-by: Emese Revfy
    Cc: Andy Whitcroft
    Cc: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Emese Revfy
     
  • Here is a small code snippet, which will be complained about by
    checkpatch.pl:

    #define __STRUCT_KFIFO_COMMON(recsize, ptrtype) \
    union { \
    struct { \
    unsigned int in; \
    unsigned int out; \
    }; \
    char rectype[recsize]; \
    ptrtype *ptr; \
    const ptrtype *ptr_const; \
    };

    This construct is legal and safe, so checkpatch.pl should accept this. It
    should be also true for struct defined in a macro.

    Add the `struct' and `union' keywords to the exceptions list of the
    checkpatch.pl script, to prevent error message "Macros with multiple
    statements should be enclosed in a do - while loop". Otherwise it is not
    possible to build a struct or union with a macro.

    Signed-off-by: Stefani Seibold
    Cc: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stefani Seibold
     
  • checkpatch falsely complained about '__initconst' because it thought the
    'const' needed a space before. Fix this by changing the list of
    attributes:

    - add '__initconst'
    - force plain 'init' to contain a word-boundary at the end

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

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

    Joe Perches
     
  • In case if the statement and the conditional are in one line, the line
    appears in the report doubly.

    And items of this check have no blank line before the next item.

    This patch fixes these trivial problems, to improve readability of the
    report.

    [sample.c]
    > if (cond1
    > && cond2
    > && cond3) func_foo();
    >
    > if (cond4) func_bar();

    Before:
    > ERROR: trailing statements should be on next line
    > #1: FILE: sample.c:1:
    > +if (cond1
    > [...]
    > + && cond3) func_foo();
    > ERROR: trailing statements should be on next line
    > #5: FILE: sample.c:5:
    > +if (cond4) func_bar();
    > +if (cond4) func_bar();
    > total: 2 errors, 0 warnings, 5 lines checked

    After:
    > ERROR: trailing statements should be on next line
    > #1: FILE: sample.c:1:
    > +if (cond1
    > [...]
    > + && cond3) func_foo();
    >
    > ERROR: trailing statements should be on next line
    > #5: FILE: sample.c:5:
    > +if (cond4) func_bar();
    >
    > total: 2 errors, 0 warnings, 5 lines checked

    Signed-off-by: Hidetoshi Seto
    Cc: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hidetoshi Seto
     
  • sizeof(&foo) is frequently an error. Warn on its use.

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

    Joe Perches
     
  • If MAINTAINERS section entries are misformatted, it was possible to have
    an infinite loop.

    Correct the defect by always moving the index to the end of section + 1

    Also, exit check for exclude as soon as possible.

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

    Joe Perches
     
  • Picky mail systems won't accept email addresses where recipient has period
    in name; ie. David S. Miller will not work.

    Signed-off-by: Stephen Hemminger
    Acked-by: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Hemminger
     
  • perlcritic is a standard checker for Perl Best Practices. This patch
    fixes most of the warnings in the get_maintainer script. If kernel
    programmers are going to have checkpatch they should write clean scripts
    as well...

    Bareword file handle opened at line 176, column 1. See pages 202,204 of PBP. (Severity: 5)
    Two-argument "open" used at line 176, column 1. See page 207 of PBP. (Severity: 5)
    Bareword file handle opened at line 207, column 5. See pages 202,204 of PBP. (Severity: 5)
    Two-argument "open" used at line 207, column 5. See page 207 of PBP. (Severity: 5)
    Bareword file handle opened at line 246, column 6. See pages 202,204 of PBP. (Severity: 5)
    Two-argument "open" used at line 246, column 6. See page 207 of PBP. (Severity: 5)
    Bareword file handle opened at line 258, column 2. See pages 202,204 of PBP. (Severity: 5)
    Two-argument "open" used at line 258, column 2. See page 207 of PBP. (Severity: 5)
    Expression form of "eval" at line 983, column 17. See page 161 of PBP. (Severity: 5)
    Expression form of "eval" at line 985, column 17. See page 161 of PBP. (Severity: 5)
    Subroutine prototypes used at line 1186, column 1. See page 194 of PBP. (Severity: 5)
    Subroutine prototypes used at line 1206, column 1. See page 194 of PBP. (Severity: 5)

    Signed-off-by: Stephen Hemminger
    Acked-by: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Hemminger
     
  • Doesn't need or accept '-' as a trailing option to read stdin. Doesn't
    print usage() after bad options. Adds --usage as command line equivalent
    of --help

    Suggested-by: Borislav Petkov
    Signed-off-by: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Signed-off-by: Joe Perches
    Cc: Stefan Richter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Print the complete contents of the matched subsystems
    in pattern match depth order.

    Sample output:

    $ ./scripts/get_maintainer.pl --sections -f drivers/net/usb/smsc95xx.c
    USB SMSC95XX ETHERNET DRIVER
    M:Steve Glendinning
    L:netdev@vger.kernel.org
    S:Supported
    F:drivers/net/usb/smsc95xx.*
    USB SUBSYSTEM
    M:Greg Kroah-Hartman
    L:linux-usb@vger.kernel.org
    W:http://www.linux-usb.org
    T:quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
    S:Supported
    F:Documentation/usb/
    F:drivers/net/usb/
    F:drivers/usb/
    F:include/linux/usb.h
    F:include/linux/usb/
    NETWORKING DRIVERS
    L:netdev@vger.kernel.org
    W:http://www.linuxfoundation.org/en/Net
    T:git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git
    S:Odd Fixes
    F:drivers/net/
    F:include/linux/if_*
    F:include/linux/*device.h
    THE REST
    M:Linus Torvalds
    L:linux-kernel@vger.kernel.org
    Q:http://patchwork.kernel.org/project/LKML/list/
    T:git git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
    S:Buried alive in reporters
    F:*
    F:*/

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

    Joe Perches
     
  • Add an imperfect option to search a source file for email addresses.

    New option: --file-emails or --fe

    email addresses in files are freeform text and are nearly impossible to
    parse. Still, might as well try to do a somewhat acceptable job of
    finding them. This code should find all addresses that are in the form
    addr@domain.tld

    The code assumes that up to 3 alphabetic words along with dashes, commas,
    and periods that preceed the email address are a name.

    If 3 words are found for the name, and one of the first two words are a
    single letter and period, or just a single letter then the 3 words are use
    as name otherwise the last 2 words are used.

    Some variants that are shown correctly:
    John Smith
    Random J. Developer
    Random J. Developer (rjd@tld.com)
    J. Random Developer rjd@tld.com

    Variants that are shown nominally correctly:
    Written by First Last (funny-addr@somecompany.com)
    is shown as:
    First Last

    Variants that are shown incorrectly:
    Some Really Long Name
    MontaVista Software, Inc.
    are returned as:
    Long Name
    "Software, Inc"

    --roles and --rolestats show "(in file)" for matches.

    For instance:

    Without -file-emails:

    $ ./scripts/get_maintainer.pl -f -nogit -roles net/core/netpoll.c
    David S. Miller (maintainer:NETWORKING [GENERAL])
    linux-kernel@vger.kernel.org (open list)

    With -fe:

    $ ./scripts/get_maintainer.pl -f -fe -nogit -roles net/core/netpoll.c
    David S. Miller (maintainer:NETWORKING [GENERAL])
    Matt Mackall (in file)
    Ingo Molnar (in file)
    linux-kernel@vger.kernel.org (open list)
    netdev@vger.kernel.org (open list:NETWORKING [GENERAL])

    The number of email addresses in the file in not limited. Neither is the
    number of returned email addresses.

    Signed-off-by: Joe Perches
    Cc: Matt Mackall
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     

01 Mar, 2010

1 commit

  • …el/git/tip/linux-2.6-tip

    * 'tracing-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (28 commits)
    ftrace: Add function names to dangling } in function graph tracer
    tracing: Simplify memory recycle of trace_define_field
    tracing: Remove unnecessary variable in print_graph_return
    tracing: Fix typo of info text in trace_kprobe.c
    tracing: Fix typo in prof_sysexit_enable()
    tracing: Remove CONFIG_TRACE_POWER from kernel config
    tracing: Fix ftrace_event_call alignment for use with gcc 4.5
    ftrace: Remove memory barriers from NMI code when not needed
    tracing/kprobes: Add short documentation for HAVE_REGS_AND_STACK_ACCESS_API
    s390: Add pt_regs register and stack access API
    tracing/kprobes: Make Kconfig dependencies generic
    tracing: Unify arch_syscall_addr() implementations
    tracing: Add notrace to TRACE_EVENT implementation functions
    ftrace: Allow to remove a single function from function graph filter
    tracing: Add correct/incorrect to sort keys for branch annotation output
    tracing: Simplify test for function_graph tracing start point
    tracing: Drop the tr check from the graph tracing path
    tracing: Add stack dump to trace_printk if stacktrace option is set
    tracing: Use appropriate perl constructs in recordmcount.pl
    tracing: optimize recordmcount.pl for offsets-handling
    ...

    Linus Torvalds
     

27 Feb, 2010

2 commits

  • I also found the -filelist option, but apparently the implementation
    is broken, and it was broken from the very first git commit.
    For the -filelist option I suggest the removal (I wasn't able to find
    any users of it, moreover it's not even listed in the
    usage() output, so presumably nobody knows about it).

    Signed-off-by: Ilya Dryomov
    Signed-off-by: Randy Dunlap
    Signed-off-by: Linus Torvalds

    Ilya Dryomov
     
  • The problem is that $. keeps track of the current record number (which
    is line number by default). But if you pass it multiple files, it does
    not wrap at the end of file, and therefore contains the *total* number
    of processed lines.
    I suppose we can fix line numbering by introducing a simple assignment
    $. = 1
    before processing every new file.

    Signed-off-by: Ilya Dryomov
    Signed-off-by: Randy Dunlap
    Signed-off-by: Linus Torvalds

    Ilya Dryomov
     

26 Feb, 2010

3 commits


09 Feb, 2010

1 commit

  • In particular, several occurances of funny versions of 'success',
    'unknown', 'therefore', 'acknowledge', 'argument', 'achieve', 'address',
    'beginning', 'desirable', 'separate' and 'necessary' are fixed.

    Signed-off-by: Daniel Mack
    Cc: Joe Perches
    Cc: Junio C Hamano
    Signed-off-by: Jiri Kosina

    Daniel Mack
     

04 Feb, 2010

1 commit


03 Feb, 2010

4 commits

  • Doing the following:

    make LSMOD=file localmodconfig

    Will make the streamline-config code use the given file instead of
    lsmod. If the file is an executable, it will execute it, otherwise
    it will read it as text.

    make LSMOD=/my/local/path/lsmod localmodconfig

    The above will execute the lsmod in /my/local/path instead of the
    lsmods that may be located elsewhere.

    make LSMOD=embedded_board_lsmod localmodconfig

    The above will read the "embedded_board_lsmod" as a text file. This
    is useful if you are doing a cross compile and need to run the
    config against modules that exist on an embedded device.

    Note, if the LSMOD= file does is not a path, it will add the
    path to the object directory. That is, the above example will look
    for "embedded_board_lsmod" in the directory that the binary will
    be built in (the O=dir directory).

    Signed-off-by: Steven Rostedt

    On branch config/linus

    Steven Rostedt
     
  • When I use markup_oops.pl parse a x8664 oops, I got:

    objdump: --start-address: bad number: NaN
    No matching code found
    This is because:
    main::(./m.pl:228): open(FILE, "objdump -dS --adjust-vma=$vmaoffset --start-address=$decodestart --stop-address=$decodestop $filename |") || die "Cannot start objdump";
    DB p $decodestart
    NaN

    This NaN is from:
    main::(./m.pl:176): my $decodestart = Math::BigInt->from_hex("0x$target") - Math::BigInt->from_hex("0x$func_offset");
    DB p $func_offset
    0x175

    There is already a "0x" in $func_offset, another 0x makes it a NaN.

    The $func_offset is from line:

    if ($line =~ /RIP: 0010:\[\\] \[\\] ([a-zA-Z0-9\_]+)\+(0x[0-9a-f]+)\/0x[a-f0-9]/) {
    $function = $1;
    $func_offset = $2;
    }

    I make a patch to change "(0x[0-9a-f]+)\/0x[a-f0-9]/)" to "0x([0-9a-f]+)\/0x[a-f0-9]/)".

    Signed-off-by: Hui Zhu
    Cc: Arjan van de Ven
    Cc: Michal Marek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hui Zhu
     
  • When git has been set to always use color in .gitconfig then I get the
    warning message

    Bad divisor in main::vcs_assign: 0

    This is caused by vcs_file_signoffs not matching any commits due to the
    pattern not understand the colour codes. Fix this by telling git log to
    never use colour.

    Signed-off-by: Richard Kennedy
    Acked-by: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Kennedy
     
  • Distributions now have lsmod in /bin instead of /sbin. But to handle
    both cases, we look for it in /sbin /bin /usr/bin and /usr/sbin.
    If lsmod is not found in any of those paths, it defaults to use
    just lsmod and hopes that it lies in the path of the user.

    Tested-by: Xavier Chantry
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     

18 Jan, 2010

1 commit

  • The sym_is() compares a symbol in an attempt to automatically skip symbol
    prefixes. It does this first by searching the real symbol with the normal
    unprefixed symbol. But then it uses the length of the original symbol to
    check the end of the substring instead of the length of the symbol it is
    looking for. On non-prefixed arches, this is effectively the same thing,
    so there is no problem. On prefixed-arches, since this is exceeds by just
    one byte, a crash is rare and it is usually a NUL byte anyways. But every
    once in a blue moon, you get the right page alignment and it segfaults.

    For example, on the Blackfin arch, sym_is() will be called with the real
    symbol "___mod_usb_device_table" as "symbol" when looking for the normal
    symbol "__mod_usb_device_table" as "name". The substring will thus return
    one byte into "symbol" and store it into "match". But then "match" will
    be indexed with the length of "symbol" instead of "name" and so we will
    exceed the storage. i.e. the code ends up doing:
    char foo[] = "abc"; return foo[strlen(foo)+1] == '\0';

    Signed-off-by: Mike Frysinger
    Signed-off-by: Rusty Russell
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     

17 Jan, 2010

2 commits

  • …nel/git/tip/linux-2.6-tip

    * 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    tracing/filters: Add comment for match callbacks
    tracing/filters: Fix MATCH_FULL filter matching for PTR_STRING
    tracing/filters: Fix MATCH_MIDDLE_ONLY filter matching
    lib: Introduce strnstr()
    tracing/filters: Fix MATCH_END_ONLY filter matching
    tracing/filters: Fix MATCH_FRONT_ONLY filter matching
    ftrace: Fix MATCH_END_ONLY function filter
    tracing/x86: Derive arch from bits argument in recordmcount.pl
    ring-buffer: Add rb_list_head() wrapper around new reader page next field
    ring-buffer: Wrap a list.next reference with rb_list_head()

    Linus Torvalds
     
  • When I try to use markup_oops.pl in x86, I always get:

    cat 1 | perl markup_oops.pl ./vmlinux
    objdump: --start-address: bad number: NaN
    No matching code found

    This is because in line:
    if ($line =~ /EIP is at ([a-zA-Z0-9\_]+)\+0x([0-9a-f]+)\/[a-f0-9]/) {
    $function = $1;
    $func_offset = $2;
    }

    $func_offset will get a number like "0x2"

    But in follow code:

    my $decodestart = Math::BigInt->from_hex("0x$target") -
    Math::BigInt->from_hex("0x$func_offset");

    It add other ox to ox2. Then this value will be set to NaN.

    So I made a small patch to fix it.

    Signed-off-by: Hui Zhu
    Acked-by: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hui Zhu
     

13 Jan, 2010

2 commits

  • In an x86 build with CONFIG_KERNEL_LZMA enabled and dash as sh,
    arch/x86/boot/compressed/vmlinux.bin.lzma ends with
    '\xf0\x7d\x39\x00' (16 bytes) instead of the 4 bytes intended and
    the resulting vmlinuz fails to boot. This improves on the
    previous behavior, in which the file contained the characters
    '-ne ' as well, but not by much.

    Previous commits replaced "echo -ne" first with "/bin/echo -ne",
    then "printf" in the hope of improving portability, but none of
    these commands is guaranteed to support hexadecimal escapes on
    POSIX systems. So use the shell to convert from hexadecimal to
    octal.

    With this change, an LZMA-compressed kernel built with dash as sh
    boots correctly again.

    Reported-by: Sebastian Dalfuß
    Reported-by: Oliver Hartkopp
    Reported-by: Michael Guntsche
    Signed-off-by: Jonathan Nieder
    Cc: Michael Tokarev
    Cc: Alek Du
    Cc: Andrew Morton
    Signed-off-by: Michal Marek

    Jonathan Nieder
     
  • Maybe this will stop people emailing me about it.

    Signed-off-by: Dave Jones
    Signed-off-by: Linus Torvalds

    Dave Jones
     

12 Jan, 2010

2 commits

  • Let the arch argument be overruled by bits. Otherwise, building of
    external modules against a i386 target on a x86-64 host (and likely vice
    versa as well) fails unless ARCH=i386 is explicitly passed to make.

    Signed-off-by: Jan Kiszka
    LKML-Reference:
    Signed-off-by: Steven Rostedt

    Jan Kiszka
     
  • The following command doesn't generate any output.
    `./scripts/get_maintainer.pl --no-git -f drivers/net/wireless/wl12xx/wl1271_acx.c`

    An excluded "X:" pattern match in any section would cause a file not to
    match any other section.

    Signed-off-by: Joe Perches
    Reported-by: Dan Carpenter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches