[media] cx231xx: Replace struct memcpy with struct assignment
authorEzequiel García <elezegarcia@gmail.com>
Wed, 27 Jun 2012 15:52:53 +0000 (12:52 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 30 Jul 2012 22:54:15 +0000 (19:54 -0300)
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>
drivers/media/video/cx231xx/cx231xx-i2c.c

index 7c0ed1bc49c24ac4e84f6de977b585f87e162203..781feed406f72747bb510cb8e4f2eed70afadd77 100644 (file)
@@ -499,10 +499,8 @@ int cx231xx_i2c_register(struct cx231xx_i2c *bus)
 
        BUG_ON(!dev->cx231xx_send_usb_command);
 
-       memcpy(&bus->i2c_adap, &cx231xx_adap_template, sizeof(bus->i2c_adap));
-       memcpy(&bus->i2c_client, &cx231xx_client_template,
-              sizeof(bus->i2c_client));
-
+       bus->i2c_adap = cx231xx_adap_template;
+       bus->i2c_client = cx231xx_client_template;
        bus->i2c_adap.dev.parent = &dev->udev->dev;
 
        strlcpy(bus->i2c_adap.name, bus->dev->name, sizeof(bus->i2c_adap.name));