1. 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
  2. 23 2月, 2010 1 次提交
  3. 13 2月, 2010 1 次提交
  4. 04 12月, 2009 1 次提交
  5. 14 10月, 2009 1 次提交
  6. 23 9月, 2009 1 次提交
    • J
      drivers/net: remove duplicate structure field initialization · 5ee21245
      Julia Lawall 提交于
      The definitions of vnet_ops and ehea_netdev_ops have initializations of a
      local function and eth_change_mtu for their respective ndo_change_mtu
      fields.  This change uses only the local function.
      
      The semantic match that finds this problem is as follows:
      (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @r@
      identifier I, s, fld;
      position p0,p;
      expression E;
      @@
      
      struct I s =@p0 { ... .fld@p = E, ...};
      
      @s@
      identifier I, s, r.fld;
      position r.p0,p;
      expression E;
      @@
      
      struct I s =@p0 { ... .fld@p = E, ...};
      
      @script:python@
      p0 << r.p0;
      fld << r.fld;
      ps << s.p;
      pr << r.p;
      @@
      
      if int(ps[0].line)!=int(pr[0].line) or int(ps[0].column)!=int(pr[0].column):
        cocci.print_main(fld,p0)
      // </smpl>
      Signed-off-by: NJulia Lawall <julia@diku.dk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5ee21245
  7. 05 8月, 2009 1 次提交
  8. 13 7月, 2009 2 次提交
  9. 05 5月, 2009 2 次提交
  10. 15 4月, 2009 1 次提交
  11. 25 3月, 2009 1 次提交
  12. 14 3月, 2009 1 次提交
  13. 20 2月, 2009 1 次提交
  14. 12 2月, 2009 1 次提交
  15. 27 1月, 2009 1 次提交
  16. 22 1月, 2009 4 次提交
  17. 13 1月, 2009 1 次提交
  18. 06 1月, 2009 1 次提交
    • S
      net/ehea: bitops work on unsigned longs · 48e4cc77
      Stephen Rothwell 提交于
      The flags field of struct ehea_port is only used with test_bit(),
      clear_bit() and set_bit() and these interfaces only work on
      "unsigned long"s, so change the field to be an "unsigned long".  Also,
      this field only has two bits defined for it (0 and 1) so will still be
      fine if someone builds this driver for a 32 bit arch (at least as far as
      this flags field is concerned).
      
      Also note that ehea_driver_flags is only used in ehca_main.c, so make it
      static in there.
      Signed-off-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      48e4cc77
  19. 29 12月, 2008 1 次提交
  20. 23 12月, 2008 1 次提交
  21. 04 11月, 2008 1 次提交
  22. 22 10月, 2008 1 次提交
  23. 26 9月, 2008 1 次提交
  24. 25 9月, 2008 1 次提交
  25. 31 7月, 2008 1 次提交
  26. 04 7月, 2008 4 次提交
  27. 12 6月, 2008 1 次提交
    • D
      net: Eliminate flush_scheduled_work() calls while RTNL is held. · 4bb073c0
      David S. Miller 提交于
      If the RTNL is held when we invoke flush_scheduled_work() we could
      deadlock.  One such case is linkwatch, it is a work struct which tries
      to grab the RTNL semaphore.
      
      The most common case are net driver ->stop() methods.  The
      simplest conversion is to instead use cancel_{delayed_}work_sync()
      explicitly on the various work struct the driver uses.
      
      This is an OK transformation because these work structs are doing
      things like resetting the chip, restarting link negotiation, and so
      forth.  And if we're bringing down the device, we're about to turn the
      chip off and reset it anways.  So if we cancel a pending work event,
      that's fine here.
      
      Some drivers were working around this deadlock by using a msleep()
      polling loop of some sort, and those cases are converted to instead
      use cancel_{delayed_}work_sync() as well.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4bb073c0
  28. 11 6月, 2008 1 次提交
  29. 22 5月, 2008 2 次提交
    • J
      25c16fff
    • B
      ehea: Fix use after free on reboot · 7fb1c2ac
      Brian King 提交于
      Fixes the following use after free oops:
      
      ehea: Reboot: freeing all eHEA resources
      Unable to handle kernel paging request for data at address 0x6b6b6b6b6b6b6c5b
      Faulting instruction address: 0xd000000000354488
      cpu 0x0: Vector: 300 (Data Access) at [c00000002ec6f310]
          pc: d000000000354488: .ehea_shutdown_single_port+0x50/0x78 [ehea]
          lr: d00000000035447c: .ehea_shutdown_single_port+0x44/0x78 [ehea]
          sp: c00000002ec6f590
         msr: 8000000000009032
         dar: 6b6b6b6b6b6b6c5b
       dsisr: 40000000
        current = 0xc0000000281412e0
        paca    = 0xc0000000006df300
          pid   = 10930, comm = reboot
      enter ? for help
      [c00000002ec6f590] d00000000035d64c .ehea_remove+0x44/0x124 [ehea] (unreliable)
      [c00000002ec6f630] c000000000319f88 .of_platform_device_remove+0x40/0x58
      [c00000002ec6f6a0] c000000000291018 .__device_release_driver+0xb0/0xf0
      [c00000002ec6f730] c000000000291120 .driver_detach+0xc8/0xfc
      [c00000002ec6f7c0] c00000000028fe24 .bus_remove_driver+0xb4/0x114
      [c00000002ec6f850] c000000000291768 .driver_unregister+0x54/0x74
      [c00000002ec6f8e0] c00000000031a0c8 .of_unregister_driver+0x14/0x28
      [c00000002ec6f950] c000000000023ba0 .ibmebus_unregister_driver+0x10/0x24
      [c00000002ec6f9c0] d000000000354180 .ehea_reboot_notifier+0x30/0x4c [ehea]
      [c00000002ec6fa40] c0000000003c95a8 .notifier_call_chain+0x5c/0xcc
      [c00000002ec6fae0] c000000000082cd4 .__blocking_notifier_call_chain+0x70/0xb0
      [c00000002ec6fb90] c000000000075cf8 .kernel_restart_prepare+0x24/0x58
      [c00000002ec6fc10] c000000000075f0c .kernel_restart+0x20/0x6c
      [c00000002ec6fc90] c000000000078674 .sys_reboot+0x1d4/0x290
      [c00000002ec6fe30] c0000000000086ac syscall_exit+0x0/0x40
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      7fb1c2ac
  30. 13 5月, 2008 1 次提交
  31. 25 4月, 2008 1 次提交