Skip to content

Commit

Permalink
[media] cx23885: 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 ddebe8c commit 630081e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/media/video/cx23885/cx23885-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 630081e

Please sign in to comment.