08 Oct, 2012

1 commit

  • The function mcs_probe() return 0 for success and negative value
    for most of its internal tests failures. There is one exception
    that is error case going to error2:. For this error case, the
    function abort its success execution path, but returns non negative
    value, making it difficult for a caller function to notice the error.

    This patch fixes the error case that do not return negative value.

    A simplified version of the semantic match that finds this problem is
    as follows: (http://coccinelle.lip6.fr/)

    //
    (
    if@p1 (\(ret < 0\|ret != 0\))
    { ... return ret; }
    |
    ret@p1 = 0
    )
    ... when != ret = e1
    when != &ret
    *if(...)
    {
    ... when != ret = e2
    when forall
    return ret;
    }
    //

    Signed-off-by: Peter Senna Tschudin
    Signed-off-by: David S. Miller

    Peter Senna Tschudin
     

19 Nov, 2011

1 commit

  • This converts the drivers in drivers/net/* to use the
    module_usb_driver() macro which makes the code smaller and a bit
    simpler.

    Added bonus is that it removes some unneeded kernel log messages about
    drivers loading and/or unloading.

    Cc: Wolfgang Grandegger
    Cc: Samuel Ortiz
    Cc: Oliver Neukum
    Cc: Peter Korsgaard
    Cc: Petko Manolov
    Cc: Steve Glendinning
    Cc: Christian Lamparter
    Cc: "John W. Linville"
    Cc: Dan Williams
    Cc: Jussi Kivilinna
    Cc: Ivo van Doorn
    Cc: Gertjan van Wingerde
    Cc: Helmut Schaa
    Cc: Herton Ronaldo Krzesinski
    Cc: Hin-Tak Leung
    Cc: Larry Finger
    Cc: Chaoming Li
    Cc: Lucas De Marchi
    Cc: "David S. Miller"
    Cc: Roel Kluin
    Cc: Paul Gortmaker
    Cc: Jiri Pirko
    Cc: Pavel Roskin
    Cc: Yoann DI-RUZZA
    Cc: George
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

31 Mar, 2011

1 commit


12 Dec, 2010

1 commit

  • flush_scheduled_work() is on its way out. This patch contains simple
    conversions to replace flush_scheduled_work() usage with direct
    cancels and flushes.

    Directly cancel the used works on driver detach and flush them in
    other cases.

    The conversions are mostly straight forward and the only dangers are,

    * Forgetting to cancel/flush one or more used works.

    * Cancelling when a work should be flushed (ie. the work must be
    executed once scheduled whether the driver is detaching or not).

    I've gone over the changes multiple times but it would be much
    appreciated if you can review with the above points in mind.

    Signed-off-by: Tejun Heo
    Cc: "David S. Miller"
    Cc: Jay Cliburn
    Cc: Michael Chan
    Cc: Divy Le Ray
    Cc: e1000-devel@lists.sourceforge.net
    Cc: Vasanthy Kolluri
    Cc: Samuel Ortiz
    Cc: Lennert Buytenhek
    Cc: Andrew Gallatin
    Cc: Francois Romieu
    Cc: Ramkrishna Vepa
    Cc: Matt Carlson
    Cc: David Brownell
    Cc: Shreyas Bhatewara
    Cc: netdev@vger.kernel.org

    Tejun Heo
     

17 Aug, 2010

1 commit

  • Indent the branch of an if.

    The semantic match that finds this problem is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @r disable braces4@
    position p1,p2;
    statement S1,S2;
    @@

    (
    if (...) { ... }
    |
    if (...) S1@p1 S2@p2
    )

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

    if (p1[0].column == p2[0].column):
    cocci.print_main("branch",p1)
    cocci.print_secs("after",p2)
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: David S. Miller

    Julia Lawall
     

14 May, 2010

1 commit

  • This patch removes from drivers/net/ all the unnecessary
    return; statements that precede the last closing brace of
    void functions.

    It does not remove the returns that are immediately
    preceded by a label as gcc doesn't like that.

    It also does not remove null void functions with return.

    Done via:
    $ grep -rP --include=*.[ch] -l "return;\n}" net/ | \
    xargs perl -i -e 'local $/ ; while (<>) { s/\n[ \t\n]+return;\n}/\n}/g; print; }'

    with some cleanups by hand.

    Compile tested x86 allmodconfig only.

    Signed-off-by: Joe Perches
    Signed-off-by: David S. Miller

    Joe Perches
     

27 Sep, 2009

1 commit

  • * remove asm/atomic.h inclusion from kref.h -- not needed, linux/types.h
    is enough for atomic_t
    * remove linux/kref.h inclusion from files which do not need it.

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

01 Sep, 2009

1 commit


13 Jun, 2009

1 commit

  • Fix up IRDA drivers that return an errno value to qdisc_restart(), causing
    qdisc_restart() to print a warning an requeue/retransmit the skb.

    - donauboe: intention appears to be to have the skb retransmitted without
    error message
    - irda-usb: intention is to drop silently according to comment
    - kingsub-sir: skb is freed: use after free
    - ks959-sir: skb is freed: use after free
    - ksdazzle-sir: skb is freed: use after free
    - mcs7880: skb is freed: use after free

    All but donauboe compile tested.

    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     

22 Mar, 2009

1 commit


13 Feb, 2009

1 commit

  • If no prior break occurs, cnt reaches 101 after the loop, so we are still able
    to change speed when cnt has become 100.

    Signed-off-by: Roel Kluin
    Signed-off-by: David S. Miller

    Roel Kluin
     

07 Jan, 2009

1 commit

  • Convert IRDA drivers to use already existing net_device_stats structure
    in network device. This is a pre-cursor to conversion to net_device
    ops. Compile tested only.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Stephen Hemminger
     

04 Nov, 2008

1 commit


29 Apr, 2008

1 commit


17 Dec, 2007

1 commit


11 Oct, 2007

3 commits


26 Apr, 2007

4 commits


22 Nov, 2006

1 commit


05 Oct, 2006

1 commit

  • Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
    of passing regs around manually through all ~1800 interrupt handlers in the
    Linux kernel.

    The regs pointer is used in few places, but it potentially costs both stack
    space and code to pass it around. On the FRV arch, removing the regs parameter
    from all the genirq function results in a 20% speed up of the IRQ exit path
    (ie: from leaving timer_interrupt() to leaving do_IRQ()).

    Where appropriate, an arch may override the generic storage facility and do
    something different with the variable. On FRV, for instance, the address is
    maintained in GR28 at all times inside the kernel as part of general exception
    handling.

    Having looked over the code, it appears that the parameter may be handed down
    through up to twenty or so layers of functions. Consider a USB character
    device attached to a USB hub, attached to a USB controller that posts its
    interrupts through a cascaded auxiliary interrupt controller. A character
    device driver may want to pass regs to the sysrq handler through the input
    layer which adds another few layers of parameter passing.

    I've build this code with allyesconfig for x86_64 and i386. I've runtested the
    main part of the code on FRV and i386, though I can't test most of the drivers.
    I've also done partial conversion for powerpc and MIPS - these at least compile
    with minimal configurations.

    This will affect all archs. Mostly the changes should be relatively easy.
    Take do_IRQ(), store the regs pointer at the beginning, saving the old one:

    struct pt_regs *old_regs = set_irq_regs(regs);

    And put the old one back at the end:

    set_irq_regs(old_regs);

    Don't pass regs through to generic_handle_irq() or __do_IRQ().

    In timer_interrupt(), this sort of change will be necessary:

    - update_process_times(user_mode(regs));
    - profile_tick(CPU_PROFILING, regs);
    + update_process_times(user_mode(get_irq_regs()));
    + profile_tick(CPU_PROFILING);

    I'd like to move update_process_times()'s use of get_irq_regs() into itself,
    except that i386, alone of the archs, uses something other than user_mode().

    Some notes on the interrupt handling in the drivers:

    (*) input_dev() is now gone entirely. The regs pointer is no longer stored in
    the input_dev struct.

    (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does
    something different depending on whether it's been supplied with a regs
    pointer or not.

    (*) Various IRQ handler function pointers have been moved to type
    irq_handler_t.

    Signed-Off-By: David Howells
    (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)

    David Howells
     

15 Aug, 2006

1 commit


30 Jun, 2006

1 commit


18 Jun, 2006

1 commit