Re: [PATCH] Coccicheck: Remove memcpy to struct assignment test

From: Peter Senna Tschudin
Date: Wed Mar 19 2014 - 09:40:01 EST


On Wed, Mar 19, 2014 at 1:02 PM, Bernd Petrovitsch
<bernd@xxxxxxxxxxxxxxxxxxx> wrote:
> On Die, 2014-03-18 at 22:11 +0100, Peter Senna Tschudin wrote:
>> The Coccinelle script scripts/coccinelle/misc/memcpy-assign.cocci look
>> for opportunities to replace a call to memcpy by a struct assignment.
>> This patch removes memcpy-assign.cocci as it is not clear that this
>> convention has an impact on the generated code.
>
> Using struct assignment keeps the type check and is just for this reason
> always preferable over memcpy().
What about the assignment hiding that a potentially large memcpy is
happening instead of just a pointer assignment?

>
> Kind regards,
> Bernd
> --
> Bernd Petrovitsch Email : bernd@xxxxxxxxxxxxxxxxxxx
> LUGA : http://www.luga.at
>



--
Peter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/