Skip to content

Commit

Permalink
[media] cx231xx: Replace struct memcpy with struct assignment
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ezequiel García authored and Mauro Carvalho Chehab committed Jul 30, 2012
1 parent 630081e commit 23ba641
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/media/video/cx231xx/cx231xx-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 23ba641

Please sign in to comment.