diff options
author | Ezequiel GarcĂa <elezegarcia@gmail.com> | 2012-06-27 11:52:53 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-07-30 18:54:15 -0400 |
commit | 23ba641a08a5cf1194cfba8480ecfab8b6623110 (patch) | |
tree | ba20a19a02c26bc665a3fa3491e10c51974ed4b6 /drivers/media | |
parent | 630081e99072f94788011badd6d12707fa3ab410 (diff) |
[media] cx231xx: Replace struct memcpy with struct assignment
Copying structs by assignment is type safe.
Plus, is shorter and easier to read.
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/cx231xx/cx231xx-i2c.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/media/video/cx231xx/cx231xx-i2c.c b/drivers/media/video/cx231xx/cx231xx-i2c.c index 7c0ed1bc49c..781feed406f 100644 --- a/drivers/media/video/cx231xx/cx231xx-i2c.c +++ b/drivers/media/video/cx231xx/cx231xx-i2c.c | |||
@@ -499,10 +499,8 @@ int cx231xx_i2c_register(struct cx231xx_i2c *bus) | |||
499 | 499 | ||
500 | BUG_ON(!dev->cx231xx_send_usb_command); | 500 | BUG_ON(!dev->cx231xx_send_usb_command); |
501 | 501 | ||
502 | memcpy(&bus->i2c_adap, &cx231xx_adap_template, sizeof(bus->i2c_adap)); | 502 | bus->i2c_adap = cx231xx_adap_template; |
503 | memcpy(&bus->i2c_client, &cx231xx_client_template, | 503 | bus->i2c_client = cx231xx_client_template; |
504 | sizeof(bus->i2c_client)); | ||
505 | |||
506 | bus->i2c_adap.dev.parent = &dev->udev->dev; | 504 | bus->i2c_adap.dev.parent = &dev->udev->dev; |
507 | 505 | ||
508 | strlcpy(bus->i2c_adap.name, bus->dev->name, sizeof(bus->i2c_adap.name)); | 506 | strlcpy(bus->i2c_adap.name, bus->dev->name, sizeof(bus->i2c_adap.name)); |