diff options
author | Christophe JAILLET <[email protected]> | 2023-10-07 15:50:02 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <[email protected]> | 2023-11-23 13:33:38 +0100 |
commit | aebe6f055d9f0e82a61ffb7c5c45f6c3af54b76b (patch) | |
tree | 3fba0d06bbde7cb972cd6bd34b1c3e184e66ee1a | |
parent | 26846dda3eca07cbb8dd481421ae52b31ef232d5 (diff) |
media: vde: Use struct_size()
Use struct_size() which is much more common than this offsetof().
Signed-off-by: Christophe JAILLET <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
-rw-r--r-- | drivers/media/platform/nvidia/tegra-vde/v4l2.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/platform/nvidia/tegra-vde/v4l2.c b/drivers/media/platform/nvidia/tegra-vde/v4l2.c index bd8c207d5b54..0f48ce6f243e 100644 --- a/drivers/media/platform/nvidia/tegra-vde/v4l2.c +++ b/drivers/media/platform/nvidia/tegra-vde/v4l2.c @@ -813,7 +813,7 @@ static int tegra_open(struct file *file) struct tegra_ctx *ctx; int err; - ctx = kzalloc(offsetof(struct tegra_ctx, ctrls[ARRAY_SIZE(ctrl_cfgs)]), + ctx = kzalloc(struct_size(ctx, ctrls, ARRAY_SIZE(ctrl_cfgs)), GFP_KERNEL); if (!ctx) return -ENOMEM; |