mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 11:30:53 +07:00
media: v4l2-ctrl: Add a comment on why we zero out compound controls fields
Since it's not necessarily very explicit why we need to zero some fields in std_validate_compound, add a comment before the function to explain why, which should help as a reminder. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:
parent
4b4d62b031
commit
1e42d384aa
@ -1645,6 +1645,10 @@ static void std_log(const struct v4l2_ctrl *ctrl)
|
|||||||
#define zero_padding(s) \
|
#define zero_padding(s) \
|
||||||
memset(&(s).padding, 0, sizeof((s).padding))
|
memset(&(s).padding, 0, sizeof((s).padding))
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Compound controls validation requires setting unused fields/flags to zero
|
||||||
|
* in order to properly detect unchanged controls with std_equal's memcmp.
|
||||||
|
*/
|
||||||
static int std_validate_compound(const struct v4l2_ctrl *ctrl, u32 idx,
|
static int std_validate_compound(const struct v4l2_ctrl *ctrl, u32 idx,
|
||||||
union v4l2_ctrl_ptr ptr)
|
union v4l2_ctrl_ptr ptr)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user