15 Mar, 2011

1 commit


22 Jan, 2011

1 commit


11 Dec, 2010

1 commit


02 Dec, 2010

2 commits

  • This patch checks the return code of kmalloc when trying to allocate
    memory for priv->rx_urb in rtl8192_usb_initendpoints(), return -ENOMEM
    when failed.

    Signed-off-by: David Chosrova
    Signed-off-by: Greg Kroah-Hartman

    David Chosrova
     
  • This patch removes all the ENABLE_DOT11D ifdefs.
    It is always defined for driver. DOT11D has to do with regulatory domains.

    What prompted this patch was a warning message in Sparse.

    drivers/staging/rtl8192u/r8192U_core.c:247:1: warning: "eqMacAddr"
    redefined in file included from drivers/staging/rtl8192u/:81:81:
    drivers/staging/rtl8192u/dot11d.h:35:1: warning: this is the location
    of the previous definition

    Now there are no ifdefs around dot11d.h it made no sense to have this
    second definition, so I removed that macro as well. ( Thanks Dan ;-) ).

    Acked-by. Dan Carpenter
    Signed-off-by: David Chosrova
    Signed-off-by: Greg Kroah-Hartman

    David Chosrova
     

17 Nov, 2010

1 commit


10 Nov, 2010

1 commit


08 Oct, 2010

1 commit


06 Oct, 2010

2 commits


06 Sep, 2010

1 commit


05 Sep, 2010

1 commit


01 Sep, 2010

2 commits

  • The 1 element of the array is tested twice. Change the code so that the
    remaining 3 element of the array is tested instead of testing the 1 element
    a second time.

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

    //
    @expression@
    expression E;
    @@

    (
    * E
    || ... || E
    |
    * E
    && ... && E
    )
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Greg Kroah-Hartman

    Julia Lawall
     
  • Obviously the wrong spelling was copied a lot of times.

    A similar patch for the non-staging part of linux
    is committed by Jiri Kosina.

    Cc: devel@driverdev.osuosl.org
    Signed-off-by: Stefan Weil
    Signed-off-by: Greg Kroah-Hartman

    Stefan Weil
     

06 Aug, 2010

1 commit


09 Jul, 2010

2 commits

  • Change sizeof(x) / sizeof(*x) to ARRAY_SIZE(x).

    Signed-off-by: Kulikov Vasiliy
    Signed-off-by: Greg Kroah-Hartman

    Kulikov Vasiliy
     
  • We had a request to enable one of the realtek network drivers in staging in Fedora.
    After a quick lookover, I decided this wasn't such a great idea.

    In doing so though, I noticed we have 6 copies of ieee80211.h there now,
    Two drivers even have two copies of it. (Even worse, cleanups have been pointlessly
    happening to both files). The patch below removes one of them, which is asides
    from whitespace, identical afaics. With a change of filename to the #include,
    it all still compiles for me.

    A better fix would be to remove both, and have them use the core ieee80211 stuff,
    but this is at least a tiny step in the right direction.

    Signed-off-by: Dave Jones
    Signed-off-by: Greg Kroah-Hartman

    Dave Jones
     

30 Jun, 2010

1 commit


19 Jun, 2010

2 commits

  • Fixed most problems pointed out by checkpatch.pl in file r8192U_core.c
    up to line 500

    Signed-off-by: Mike Gilks
    Signed-off-by: Greg Kroah-Hartman

    Mike Gilks
     
  • Select CONFIG_CRYPTO for all rtl81xx wireless drivers

    ... to avoid build problems like:

    ERROR: "crypto_destroy_tfm" [drivers/staging/rtl8187se/r8187se.ko] undefined!
    ERROR: "crypto_alloc_base" [drivers/staging/rtl8187se/r8187se.ko] undefined!
    ERROR: "crypto_destroy_tfm" [drivers/staging/rtl8192u/r8192u_usb.ko] undefined!
    ERROR: "crypto_alloc_base" [drivers/staging/rtl8192u/r8192u_usb.ko] undefined!
    ERROR: "crypto_destroy_tfm" [drivers/staging/rtl8192su/r8192s_usb.ko] undefined!
    ERROR: "crypto_alloc_base" [drivers/staging/rtl8192su/r8192s_usb.ko] undefined!
    ERROR: "crypto_destroy_tfm" [drivers/staging/rtl8192e/r8192e_pci.ko] undefined!
    ERROR: "crypto_alloc_base" [drivers/staging/rtl8192e/r8192e_pci.ko] undefined!

    when drivers are built as modules but CONFIG_CRYPTO=n.

    Signed-off-by: Andreas Herrmann
    Signed-off-by: Greg Kroah-Hartman

    Andreas Herrmann
     

18 May, 2010

1 commit

  • Use kmemdup when some other buffer is immediately copied into the
    allocated region.

    A simplified version of the semantic patch that makes this change is as
    follows: (http://coccinelle.lip6.fr/)

    //
    @@
    expression from,to,size,flag;
    statement S;
    @@

    - to = \(kmalloc\|kzalloc\)(size,flag);
    + to = kmemdup(from,size,flag);
    if (to==NULL || ...) S
    - memcpy(to, from, size);
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Greg Kroah-Hartman

    Julia Lawall
     

15 May, 2010

2 commits

  • Use kcalloc or kzalloc rather than the combination of kmalloc and memset.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    expression x,y,flags;
    statement S;
    type T;
    @@

    x =
    - kmalloc
    + kcalloc
    (
    - y * sizeof(T),
    + y, sizeof(T),
    flags);
    if (x == NULL) S
    -memset(x, 0, y * sizeof(T));

    @@
    expression x,size,flags;
    statement S;
    @@

    -x = kmalloc(size,flags);
    +x = kzalloc(size,flags);
    if (x == NULL) S
    -memset(x, 0, size);
    //

    Signed-off-by: Julia Lawall

    Julia Lawall
     
  • s/seperate/separate

    Signed-off-by: Anand Gadiyar
    Cc: Jiri Kosina
    Signed-off-by: Greg Kroah-Hartman

    Anand Gadiyar
     

12 May, 2010

11 commits


30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

04 Mar, 2010

5 commits

  • The rtl8192* drivers in staging use semaphores, so they need
    to #include .

    (similar to staging-rtl8187se-needs-semaphore.h.patch)

    drivers/staging/rtl8192e/ieee80211/ieee80211.h:2038: error: field 'ips_sem' has incomplete type
    drivers/staging/rtl8192e/ieee80211/ieee80211.h:2249: error: field 'wx_sem' has incomplete type
    drivers/staging/rtl8192e/ieee80211/ieee80211.h:2250: error: field 'scan_sem' has incomplete type
    drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c:442: error: implicit declaration of function 'down'
    drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c:500: error: implicit declaration of function 'up'
    drivers/staging/rtl8192e/ieee80 211/ieee80211_softmac.c:3165: error: implicit declaration of function 'sema_init'

    drivers/staging/rtl8192su/ieee80211/ieee80211.h:1330: error: field 'wx_sem' has incomplete type
    drivers/staging/rtl8192su/ieee80211/ieee80211.h:1331: error: field 'scan_sem' has incomplete type

    drivers/staging/rtl8192u/ieee80211/ieee80211.h:2010: error: field 'wx_sem' has incomplete type
    drivers/staging/rtl8192u/ieee80211/ieee80211.h:2011: error: field 'scan_sem' has incomplete type

    Signed-off-by: Randy Dunlap
    Signed-off-by: Greg Kroah-Hartman

    Randy Dunlap
     
  • CurrentMPDUDensity was designed to itself.

    Signed-off-by: Roel Kluin
    Signed-off-by: Greg Kroah-Hartman

    Roel Kluin
     
  • rtl8192u uses -mhard-float, which doesn't exist on ia64. Since in-kernel
    floating-point isn't allowed, this is implied anyway.

    Signed-off-by: Jeff Mahoney
    Signed-off-by: Greg Kroah-Hartman

    Jeff Mahoney
     
  • The id_table field of the struct usb_device_id is constant in
    so it is worth to make the initialization data also constant.

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

    //
    @r@
    disable decl_init,const_decl_init;
    identifier I1, I2, x;
    @@
    struct I1 {
    ...
    const struct I2 *x;
    ...
    };
    @s@
    identifier r.I1, y;
    identifier r.x, E;
    @@
    struct I1 y = {
    .x = E,
    };
    @c@
    identifier r.I2;
    identifier s.E;
    @@
    const struct I2 E[] = ... ;
    @depends on !c@
    identifier r.I2;
    identifier s.E;
    @@
    + const
    struct I2 E[] = ...;
    //

    Signed-off-by: Németh Márton
    Cc: Julia Lawall
    Cc: cocci@diku.dk
    Signed-off-by: Greg Kroah-Hartman

    Németh Márton
     
  • Without WEXT_PRIV set the driver fails to build due to unknown fields in
    the iw_handler_def struct.
    Those fields are enclosed in WEXT_PRIV conditionals in the prototype
    of iw_handler_def in include/net/iw_handler.h

    Signed-off-by: Peter Huewe
    Acked-by: Simon Horman
    Signed-off-by: Greg Kroah-Hartman

    Peter Huewe