Re: [PATCH] media: mediatek: vcodec: use = { } instead of memset()

From: Qianfeng Rong
Date: Sat Aug 30 2025 - 04:25:34 EST



在 2025/8/30 2:49, Nicolas Dufresne 写道:
Hi,


Le dimanche 03 août 2025 à 21:55 +0800, Qianfeng Rong a écrit :
Based on testing and recommendations by David Lechner et al. [1][2],
using = { } to initialize a structure or array is the preferred way
to do this in the kernel.

This patch converts memset() to = { }, thereby:
- Eliminating the risk of sizeof() mismatches.
- Simplifying the code.
Last month, Irui Wang sent an actual fix [0] for uninitialized data in this
driver. Your patch seems to be related, yet the previous fix is not covered and
this is not marked as a V2. Since this refactoring collide with an actual fix
that I'm waiting for a V2, I'd rather not take it and wait.

Any chances you can respin this with a second patches covering Irui's fix ?


Thanks for taking the time to explain!

If there are conflicts, please ignore my patch for now, as it might
not address the actual issue. After Irui's fix is merged, I can
update my patch if necessary.


Best regards,
Qianfeng