1. 27 10月, 2010 1 次提交
  2. 02 9月, 2010 1 次提交
    • J
      ASoC: pl022_ds.c: Add of_node_put to avoid memory leak · 880b8ffd
      Julia Lawall 提交于
      Add a call to of_node_put in the error handling code following a call to
      of_parse_phandle.
      
      This patch also moves the existing call to of_node_put tothe end of the
      error handling code, to make it possible to jump to of_node_put without
      doing the other cleanup operations.  These appear to be disjoint
      operations, so the ordering doesn't matter.
      
      The semantic match that finds this problem is as follows:
      (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @r exists@
      local idexpression x;
      expression E,E1,E2;
      statement S;
      @@
      
      *x =
      (of_find_node_by_path
      |of_find_node_by_name
      |of_find_node_by_phandle
      |of_get_parent
      |of_get_next_parent
      |of_get_next_child
      |of_find_compatible_node
      |of_match_node
      |of_find_node_by_type
      |of_find_node_with_property
      |of_find_matching_node
      |of_parse_phandle
      )(...);
      ...
      if (x == NULL) S
      <... when != x = E
      *if (...) {
        ... when != of_node_put(x)
            when != if (...) { ... of_node_put(x); ... }
      (
        return <+...x...+>;
      |
      *  return ...;
      )
      }
      ...>
      (
      E2 = x;
      |
      of_node_put(x);
      )
      // </smpl>
      Signed-off-by: NJulia Lawall <julia@diku.dk>
      Acked-by: NTimur Tabi <timur@freescale.com>
      Acked-by: NLiam Girdwood <lrg@slimlogic.uo.uk>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      880b8ffd
  3. 21 8月, 2010 1 次提交
  4. 20 8月, 2010 2 次提交
  5. 19 8月, 2010 1 次提交
  6. 12 8月, 2010 5 次提交
  7. 07 8月, 2010 1 次提交
  8. 06 8月, 2010 1 次提交
  9. 17 6月, 2010 1 次提交
  10. 16 6月, 2010 1 次提交
    • G
      powerpc/5200: Fix build error in sound code. · f487537c
      Grant Likely 提交于
      Compiling in the MPC5200 sound drivers results in the following build error:
      
      sound/soc/fsl/mpc5200_psc_ac97.o: In function `to_psc_dma_stream':
      mpc5200_psc_ac97.c:(.text+0x0): multiple definition of `to_psc_dma_stream'
      sound/soc/fsl/mpc5200_dma.o:mpc5200_dma.c:(.text+0x0): first defined here
      sound/soc/fsl/efika-audio-fabric.o: In function `to_psc_dma_stream':
      efika-audio-fabric.c:(.text+0x0): multiple definition of `to_psc_dma_stream'
      sound/soc/fsl/mpc5200_dma.o:mpc5200_dma.c:(.text+0x0): first defined here
      make[3]: *** [sound/soc/fsl/built-in.o] Error 1
      make[2]: *** [sound/soc/fsl] Error 2
      make[1]: *** [sound/soc] Error 2
      make: *** [sound] Error 2
      
      This patch fixes it by declaring the inline function in the header file to
      also be a static.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Jon Smirl <jonsmirl@gmail.com>
      Tested-by: NJohn Hilmar Linkhorst <John.Linkhorst@rwth-aachen.de>
      Acked-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      f487537c
  11. 13 6月, 2010 1 次提交
  12. 22 5月, 2010 1 次提交
    • G
      of: Remove duplicate fields from of_platform_driver · 4018294b
      Grant Likely 提交于
      .name, .match_table and .owner are duplicated in both of_platform_driver
      and device_driver.  This patch is a removes the extra copies from struct
      of_platform_driver and converts all users to the device_driver members.
      
      This patch is a pretty mechanical change.  The usage model doesn't change
      and if any drivers have been missed, or if anything has been fixed up
      incorrectly, then it will fail with a compile time error, and the fixup
      will be trivial.  This patch looks big and scary because it touches so
      many files, but it should be pretty safe.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Acked-by: NSean MacLennan <smaclennan@pikatech.com>
      4018294b
  13. 19 5月, 2010 1 次提交
  14. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit 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: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  15. 09 2月, 2010 1 次提交
  16. 10 11月, 2009 1 次提交
  17. 07 11月, 2009 5 次提交
  18. 12 9月, 2009 1 次提交
    • J
      ASoC: Clean up error handling in MPC5200 DMA setup · 33d7f778
      Julia Lawall 提交于
      Error handling code following a kzalloc should free the allocated data.
      Error handling code following an ioremap should iounmap the allocated data.
      
      The semantic match that finds the first problem is as follows:
      (http://www.emn.fr/x-info/coccinelle/)
      
      // <smpl>
      @r exists@
      local idexpression x;
      statement S;
      expression E;
      identifier f,f1,l;
      position p1,p2;
      expression *ptr != NULL;
      @@
      
      x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
      ...
      if (x == NULL) S
      <... when != x
           when != if (...) { <+...x...+> }
      (
      x->f1 = E
      |
       (x->f1 == NULL || ...)
      |
       f(...,x->f1,...)
      )
      ...>
      (
       return \(0\|<+...x...+>\|ptr\);
      |
       return@p2 ...;
      )
      
      @script:python@
      p1 << r.p1;
      p2 << r.p2;
      @@
      
      print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line)
      // </smpl>
      Signed-off-by: NJulia Lawall <julia@diku.dk>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      33d7f778
  19. 07 8月, 2009 1 次提交
  20. 06 8月, 2009 1 次提交
  21. 22 7月, 2009 1 次提交
  22. 03 7月, 2009 2 次提交
  23. 30 6月, 2009 2 次提交
  24. 28 5月, 2009 1 次提交
  25. 27 5月, 2009 5 次提交