Skip to content
Snippets Groups Projects
  1. Mar 01, 2010
  2. Feb 28, 2010
  3. Feb 27, 2010
  4. Feb 26, 2010
  5. Feb 24, 2010
  6. Feb 23, 2010
  7. Feb 22, 2010
  8. Feb 05, 2010
  9. Feb 02, 2010
  10. Jan 25, 2010
  11. Jan 22, 2010
  12. Jan 12, 2010
  13. Jan 11, 2010
    • Julia Lawall's avatar
      drivers/block/drbd/drbd_receiver.c: correct NULL test · 23978161
      Julia Lawall authored
      Test the just-allocated value for NULL rather than some other value.
      
      The semantic patch that makes this change is as follows:
      (http://coccinelle.lip6.fr/
      
      )
      
      // <smpl>
      @@
      expression x,y;
      statement S;
      @@
      
      x = \(kmalloc\|kcalloc\|kzalloc\)(...);
      (
      if ((x) == NULL) S
      |
      if (
      -   y
      +   x
             == NULL)
       S
      )
      // </smpl>
      
      Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
      Cc: Lars Ellenberg <drbd-dev@lists.linbit.com>
      Cc: Philipp Reisner <philipp.reisner@linbit.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      23978161
    • Márton Németh's avatar
      block: make virtio device id constant · 47483e25
      Márton Németh authored
      The id_table field of the struct virtio_driver is constant in <linux/virtio.h>
      so it is worth to make id_table 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: default avatarMárton Németh <nm127@freemail.hu>
      Cc: Julia Lawall <julia@diku.dk>
      Cc: cocci@diku.dk
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      47483e25
    • Márton Németh's avatar
      block: make xenbus device id constant · ec9c42ec
      Márton Németh authored
      The ids field of the struct xenbus_device_id is constant in <linux/xen/xenbus.h>
      so it is worth to make blkfront_ids 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: default avatarMárton Németh <nm127@freemail.hu>
      Cc: Julia Lawall <julia@diku.dk>
      Cc: cocci@diku.dk
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      ec9c42ec
    • Márton Németh's avatar
      block: make Open Firmware device id constant · 5cccfd9b
      Márton Németh authored
      The match_table field of the struct of_device_id is constant in <linux/of_platform.h>
      so it is worth to make ace_of_match 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: default avatarMárton Németh <nm127@freemail.hu>
      Cc: Julia Lawall <julia@diku.dk>
      Cc: cocci@diku.dk
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      5cccfd9b
    • Márton Németh's avatar
      block: make USB device id constant · 577cdf0c
      Márton Németh authored
      The id_table field of the struct usb_device_id is constant in <linux/usb.h>
      so it is worth to make ub_usb_ids 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: default avatarMárton Németh <nm127@freemail.hu>
      Cc: Julia Lawall <julia@diku.dk>
      Cc: cocci@diku.dk
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      577cdf0c
    • Márton Németh's avatar
      block: make PCI device id constant · 3d447ec0
      Márton Németh authored
      The id_table field of the struct pci_driver is constant in <linux/pci.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: default avatarMárton Németh <nm127@freemail.hu>
      Cc: Julia Lawall <julia@diku.dk>
      Cc: cocci@diku.dk
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      3d447ec0
  14. Jan 07, 2010
  15. Jan 04, 2010
  16. Dec 31, 2009
  17. Dec 29, 2009
  18. Dec 22, 2009
Loading