diff options
author | Ezequiel Garcia <elezegarcia@gmail.com> | 2012-10-23 14:57:26 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-12-27 16:03:46 -0500 |
commit | c84401c200423e4855bc990d8460cc0c3a2bb664 (patch) | |
tree | a7acdf25a93b1bdd39bb52bbf25be5e9d5fdcdb9 /drivers/media/radio/wl128x | |
parent | 2b9b325d73dc092e1b888c381b98dde57d394194 (diff) |
[media] wl128x: 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: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/radio/wl128x')
-rw-r--r-- | drivers/media/radio/wl128x/fmdrv_common.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/media/radio/wl128x/fmdrv_common.c b/drivers/media/radio/wl128x/fmdrv_common.c index 602ef7ac8c24..a002234ed5de 100644 --- a/drivers/media/radio/wl128x/fmdrv_common.c +++ b/drivers/media/radio/wl128x/fmdrv_common.c | |||
@@ -1563,8 +1563,7 @@ int fmc_prepare(struct fmdev *fmdev) | |||
1563 | fmdev->irq_info.mask = FM_MAL_EVENT; | 1563 | fmdev->irq_info.mask = FM_MAL_EVENT; |
1564 | 1564 | ||
1565 | /* Region info */ | 1565 | /* Region info */ |
1566 | memcpy(&fmdev->rx.region, ®ion_configs[default_radio_region], | 1566 | fmdev->rx.region = region_configs[default_radio_region]; |
1567 | sizeof(struct region_info)); | ||
1568 | 1567 | ||
1569 | fmdev->rx.mute_mode = FM_MUTE_OFF; | 1568 | fmdev->rx.mute_mode = FM_MUTE_OFF; |
1570 | fmdev->rx.rf_depend_mute = FM_RX_RF_DEPENDENT_MUTE_OFF; | 1569 | fmdev->rx.rf_depend_mute = FM_RX_RF_DEPENDENT_MUTE_OFF; |