Searched hist:"3618 acab2ccefe292a3b1a1d7295f1368023b71a" (Results 1 – 2 of 2) sorted by relevance
/linux/drivers/media/pci/cx23885/ |
H A D | cx23888-ir.c | diff 3618acab2ccefe292a3b1a1d7295f1368023b71a Tue Oct 23 20:57:20 CEST 2012 Ezequiel Garcia <elezegarcia@gmail.com> [media] cx23885: Replace memcpy with struct assignment
This kind of memcpy() is error-prone. Its replacement with a struct assignment is prefered because it's type-safe and much easier to read. Found by coccinelle. Hand patched and reviewed. Tested by compilation only. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ identifier struct_name; struct struct_name to; struct struct_name from; expression E; @@ -memcpy(&(to), &(from), E); +to = from; // </smpl>
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com> Reviewed-by: Andy Walls <awalls@md.metrocast.net> Signed-off-by: Andy Walls <awalls@md.metrocast.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
|
H A D | cx23885-video.c | diff 3618acab2ccefe292a3b1a1d7295f1368023b71a Tue Oct 23 20:57:20 CEST 2012 Ezequiel Garcia <elezegarcia@gmail.com> [media] cx23885: Replace memcpy with struct assignment
This kind of memcpy() is error-prone. Its replacement with a struct assignment is prefered because it's type-safe and much easier to read. Found by coccinelle. Hand patched and reviewed. Tested by compilation only. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ identifier struct_name; struct struct_name to; struct struct_name from; expression E; @@ -memcpy(&(to), &(from), E); +to = from; // </smpl>
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com> Reviewed-by: Andy Walls <awalls@md.metrocast.net> Signed-off-by: Andy Walls <awalls@md.metrocast.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
|