Re: [PATCH 15/23] ivtv: Replace memcpy with struct assignment

2012-10-23 Thread Ezequiel Garcia
Hey Andy, On Tue, Oct 23, 2012 at 7:08 PM, Andy Walls wrote: > On Tue, 2012-10-23 at 16:57 -0300, Ezequiel Garcia wrote: >> This kind of memcpy() is error-prone. Its replacement with a struct >> assignment is prefered because it's type-safe and much easier to read. > > This one is a code maintena

Re: [PATCH 15/23] ivtv: Replace memcpy with struct assignment

2012-10-23 Thread Andy Walls
On Tue, 2012-10-23 at 16:57 -0300, Ezequiel Garcia wrote: > This kind of memcpy() is error-prone. Its replacement with a struct > assignment is prefered because it's type-safe and much easier to read. This one is a code maintenance win. :) See my comments at the end for the difference in assemble

[PATCH 15/23] ivtv: Replace memcpy with struct assignment

2012-10-23 Thread Ezequiel Garcia
This kind of memcpy() is error-prone. Its replacement with a struct assignment is prefered because it's type-safe and much easier to read. Found by coccinelle. Hand patched and reviewed. Tested by compilation only. A simplified version of the semantic match that finds this problem is as follows: