1. 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
  2. 23 9月, 2009 1 次提交
  3. 13 7月, 2009 1 次提交
  4. 25 3月, 2009 1 次提交
  5. 08 1月, 2009 3 次提交
  6. 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
  7. 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
  8. 22 7月, 2008 2 次提交
  9. 04 6月, 2008 1 次提交
  10. 15 5月, 2008 1 次提交
  11. 03 5月, 2008 1 次提交