1. 09 2月, 2009 1 次提交
    • J
      drivers/atm: introduce missing kfree · bc111d57
      Julia Lawall 提交于
      Error handling code following a kmalloc should free the allocated data.
      
      The semantic match that finds the problem is as follows:
      (http://www.emn.fr/x-info/coccinelle/)
      
      // <smpl>
      @r exists@
      local idexpression x;
      statement S;
      expression E;
      identifier f,l;
      position p1,p2;
      expression *ptr != NULL;
      @@
      
      (
      if ((x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...)) == NULL) S
      |
      x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
      ...
      if (x == NULL) S
      )
      <... when != x
           when != if (...) { <+...x...+> }
      x->f = E
      ...>
      (
       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: NDavid S. Miller <davem@davemloft.net>
      bc111d57
  2. 09 1月, 2009 1 次提交
  3. 26 12月, 2008 1 次提交
  4. 30 11月, 2008 1 次提交
  5. 23 9月, 2008 1 次提交
    • J
      drivers/atm: Use DIV_ROUND_UP · 6a19309d
      Julia Lawall 提交于
      The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /
      (d)) but is perhaps more readable.
      
      In the case of the file drivers/atm/eni.c, I am a little bit suspicious of
      the -1 at the end of the affected expression.  Please check that that is
      what is wanted.
      
      An extract of the semantic patch that makes this change is as follows:
      (http://www.emn.fr/x-info/coccinelle/)
      
      // <smpl>
      @haskernel@
      @@
      
      #include <linux/kernel.h>
      
      @depends on haskernel@
      expression n,d;
      @@
      
      (
      - (n + d - 1) / d
      + DIV_ROUND_UP(n,d)
      |
      - (n + (d - 1)) / d
      + DIV_ROUND_UP(n,d)
      )
      
      @depends on haskernel@
      expression n,d;
      @@
      
      - DIV_ROUND_UP((n),d)
      + DIV_ROUND_UP(n,d)
      
      @depends on haskernel@
      expression n,d;
      @@
      
      - DIV_ROUND_UP(n,(d))
      + DIV_ROUND_UP(n,d)
      // </smpl>
      Signed-off-by: NJulia Lawall <julia@diku.dk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6a19309d
  6. 22 9月, 2008 1 次提交
  7. 31 8月, 2008 1 次提交
  8. 29 8月, 2008 4 次提交
  9. 24 8月, 2008 1 次提交
  10. 31 7月, 2008 1 次提交
  11. 24 7月, 2008 1 次提交
  12. 10 7月, 2008 1 次提交
  13. 18 6月, 2008 5 次提交
  14. 17 6月, 2008 5 次提交
  15. 11 6月, 2008 1 次提交
  16. 21 5月, 2008 1 次提交
  17. 15 5月, 2008 1 次提交
  18. 29 4月, 2008 2 次提交
  19. 20 4月, 2008 2 次提交
  20. 14 4月, 2008 1 次提交
    • D
      [ATM] drivers/atm/horizon.c: stop inlining largish static functions · 2cf83afe
      Denys Vlasenko 提交于
      drivers/atm/horizon.c has unusually large number
      of static inline functions - 36.
      
      I looked through them. Most of them seems to be small enough,
      but a few are big, others are using udelay or busy loop,
      and as such are better not be inlined.
      
      This patch removes "inline" from these static functions
      (regardless of number of callsites - gcc nowadays auto-inlines
      statics with one callsite).
      
      Size difference for 32bit x86:
         text    data     bss     dec     hex filename
         8201     180       6    8387    20c3 linux-2.6-ALLYES/drivers/atm/horizon.o
         7840     180       6    8026    1f5a linux-2.6.inline-ALLYES/drivers/atm/horizon.o
      Signed-off-by: NDenys Vlasenko <vda.linux@googlemail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2cf83afe
  21. 04 4月, 2008 1 次提交
  22. 02 4月, 2008 1 次提交
  23. 01 4月, 2008 2 次提交
  24. 29 3月, 2008 1 次提交
  25. 17 3月, 2008 1 次提交
  26. 06 3月, 2008 1 次提交