linux/drivers/mtd/ubi
Ezequiel Garcia d856c13c11 UBI: 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>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-12-03 13:54:14 +02:00
..
attach.c UBI: do not allocate the memory unnecessarily 2012-10-26 16:29:46 +03:00
build.c UBI: replace memcpy with struct assignment 2012-12-03 13:54:14 +02:00
cdev.c UBI: print less 2012-09-04 09:39:02 +03:00
debug.c UBI: use pr_ helper instead of printk 2012-09-04 09:39:02 +03:00
debug.h UBI: print less 2012-09-04 09:39:02 +03:00
eba.c UBI: Wire-up ->fm_sem 2012-10-03 12:29:37 +03:00
fastmap.c UBI: use list_move_tail instead of list_del/list_add_tail 2012-10-26 16:04:21 +03:00
gluebi.c UBI: gluebi: rename misleading variables 2012-11-30 13:54:41 +02:00
io.c UBI: print less 2012-09-04 09:39:02 +03:00
kapi.c UBI: modify ubi_wl_flush function to clear work queue for a lnum 2012-05-21 11:34:41 +03:00
Kconfig UBI: Wire-up fastmap 2012-10-03 16:39:37 +03:00
Makefile UBI: Wire-up fastmap 2012-10-03 16:39:37 +03:00
misc.c UBI: comply with coding style 2012-09-04 09:39:01 +03:00
ubi-media.h UBI: Add fastmap on-flash data structures 2012-10-03 12:29:37 +03:00
ubi.h UBI: Add fastmap stuff to attach.c 2012-10-03 12:29:38 +03:00
upd.c UBI: replace memcpy with struct assignment 2012-12-03 13:54:14 +02:00
vmt.c UBI: replace memcpy with struct assignment 2012-12-03 13:54:14 +02:00
vtbl.c The main change is the way we reserve eraseblocks for bad blocks 2012-10-02 20:49:15 -07:00
wl.c UBI: remove spurious comment 2012-11-30 13:54:41 +02:00