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

index 615c71fb4668ab81a74a915c57f51a9c29858806..4887314339cbfa9071db9a898e985fae2495a9c8 100644 (file)
@@ -316,11 +316,8 @@ int cx23885_i2c_register(struct cx23885_i2c *bus)
 
        dprintk(1, "%s(bus = %d)\n", __func__, bus->nr);
 
-       memcpy(&bus->i2c_adap, &cx23885_i2c_adap_template,
-              sizeof(bus->i2c_adap));
-       memcpy(&bus->i2c_client, &cx23885_i2c_client_template,
-              sizeof(bus->i2c_client));
-
+       bus->i2c_adap = cx23885_i2c_adap_template;
+       bus->i2c_client = cx23885_i2c_client_template;
        bus->i2c_adap.dev.parent = &dev->pci->dev;
 
        strlcpy(bus->i2c_adap.name, bus->dev->name,