1. 19 4月, 2012 1 次提交
  2. 05 1月, 2012 1 次提交
    • J
      drivers/usb/host/isp1760-if.c: introduce missing kfree · 30a0dee7
      Julia Lawall 提交于
      drvdata needds to be freed before leaving the function in an error case.
      
      A simplified version of the semantic match that finds the problem is as
      follows: (http://coccinelle.lip6.fr)
      
      // <smpl>
      @r exists@
      local idexpression x;
      statement S;
      identifier f1;
      position p1,p2;
      expression *ptr != NULL;
      @@
      
      x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
      ...
      if (x == NULL) S
      <... when != x
           when != if (...) { <+...x...+> }
      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: NGreg Kroah-Hartman <gregkh@suse.de>
      30a0dee7
  3. 22 12月, 2011 1 次提交
    • D
      USB: Fix usb/isp1760 build on sparc · abf058e1
      David Miller 提交于
      This commit:
      
      commit 8f5d6215
      Author: Joachim Foerster <joachim.foerster@missinglinkelectronics.com>
      Date:   Mon Oct 10 18:06:54 2011 +0200
      
          usb/isp1760: Let OF bindings depend on general CONFIG_OF instead of PPC_OF .
      
          To be able to use the driver on other OF-aware architectures, too.
          And add necessary OF related #includes to fix compilation error.
      Signed-off-by: NJoachim Foerster <joachim.foerster@missinglinkelectronics.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      enabled the build on all CONFIG_OF architectures, but it cannot do
      this.
      
      This driver depends upon CONFIG_OF_IRQ but not all CONFIG_OF platforms
      support that infrastructure, in particular Sparc does not so the
      build fails.
      
      Please push a patch like the following to Linus so that this code only
      gets built where it actually should.
      
      --------------------
      usb/isp1760: Add missing CONFIG_OF_IRQ dependency on OF code.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      abf058e1
  4. 10 12月, 2011 1 次提交
  5. 01 11月, 2011 1 次提交
  6. 20 10月, 2011 1 次提交
  7. 19 10月, 2011 1 次提交
  8. 18 9月, 2011 1 次提交
  9. 01 3月, 2011 1 次提交
  10. 06 8月, 2010 1 次提交
  11. 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
  12. 21 5月, 2010 2 次提交
  13. 19 5月, 2010 1 次提交
  14. 03 3月, 2010 1 次提交
    • N
      USB host: make Open Firmware device id constant · c4386ad0
      Németh Márton 提交于
      The match_table field of the struct of_device_id is constant in <linux/of_platform.h>
      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/)
      
      // <smpl>
      @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[] = ...;
      // </smpl>
      Signed-off-by: NNémeth Márton <nm127@freemail.hu>
      Cc: Julia Lawall <julia@diku.dk>
      Cc: cocci@diku.dk
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      c4386ad0
  15. 23 9月, 2009 1 次提交
  16. 13 7月, 2009 1 次提交
  17. 25 3月, 2009 1 次提交
  18. 08 1月, 2009 3 次提交
  19. 14 11月, 2008 1 次提交
    • S
      USB: remove optional bus bindings in isp1760, fixing runtime warning · ff30bf1c
      Sebastian Andrzej Siewior 提交于
      Roland Reported the following:
      | kmem_cache_create: duplicate cache isp1760_qtd
      | Pid: 461, comm: modprobe Tainted: G        W  2.6.28-rc2-git3-default #4
      | Call Trace:
      |  [<c017540e>] kmem_cache_create+0xc9/0x3a3
      |  [<c0159a8d>] free_pages_bulk+0x16c/0x1c9
      |  [<f165c05f>] isp1760_init+0x0/0xb [isp1760]
      |  [<f165c018>] init_kmem_once+0x18/0x5f [isp1760]
      |  [<f165c064>] isp1760_init+0x5/0xb [isp1760]
      |  [<c010113d>] _stext+0x4d/0x148
      |  [<c0142936>] load_module+0x12cd/0x142e
      |  [<c01743c4>] kmem_cache_destroy+0x0/0xd7
      |  [<c0142b1e>] sys_init_module+0x87/0x176
      |  [<c01039eb>] sysenter_do_call+0x12/0x2f
      
      The reason, is that ret is initialized with ENODEV instead of 0 _or_
      the kmem cache is not freed in error case with no bus binding.
      
      The difference between OF+PCI and OF only is
      | 15148     804      32   15984    3e70 isp1760-of-pci.o
      | 13748     676       8   14432    3860 isp1760-of.o
      
      about 1.5 KiB.
      
      Until there is a checkbox where the user *must* select atleast one item,
      and may select multiple entries I don't make it selectable anymore.
      Having a driver which can't be used under any circumstances is broken
      anyway and I've seen distros shipping it that way.
      Reported-by: NRoland Kletzing <devzero@web.de>
      Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>a
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      ff30bf1c
  20. 18 10月, 2008 2 次提交
    • G
      USB: remove err() macro from more usb drivers · 802f389a
      Greg Kroah-Hartman 提交于
      USB should not be having it's own printk macros, so remove err() and
      use the system-wide standard of dev_err() wherever possible.  In the
      few places that will not work out, use a basic printk().
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      802f389a
    • J
      USB: isp1760: Use an IS_ERR test rather than a NULL test · ce5dee50
      Julien Brunel 提交于
      In case of error, the function isp1760_register returns an ERR
      pointer, but never returns a NULL pointer. So after a call to this
      function, a NULL test should be replaced by an IS_ERR test. Moreover,
      we have noticed that:
      (1) the result of isp1760_register is assigned through the function
      pci_set_drvdata without an error test,
      (2) if the call to isp1760_register fails, the current function
      (isp1761_pci_probe) returns 0, and if it succeeds, it returns -ENOMEM,
      which seems odd.
      
      Thus, we suggest to move the test before the call to pci_set_drvdata
      to correct (1), and to turn it into a non IS_ERR test to correct (2).
      
      The semantic match that finds this problem is as follows: 
      (http://www.emn.fr/x-info/coccinelle/)
      
      // <smpl>
      @bad_null_test@
      expression x,E;
      statement S1, S2;
      @@
      x =  isp1760_register(...)
      ... when != x = E
      * if (x == NULL)
      S1 else S2
      // </smpl>
      Signed-off-by: NJulien Brunel <brunel@diku.dk>
      Signed-off-by: NJulia Lawall <julia@diku.dk>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      ce5dee50
  21. 22 7月, 2008 2 次提交
  22. 04 6月, 2008 1 次提交
  23. 15 5月, 2008 1 次提交
  24. 03 5月, 2008 1 次提交