mirror of
https://github.com/torvalds/linux.git
synced 2026-05-05 23:05:25 -04:00
media: nvidia: tegra-vde: Replace file->private_data access
Accessing file->private_data manually to retrieve the v4l2_fh pointer is error-prone, as the field is a void * and will happily cast implicitly to any pointer type. The tegra-vde driver accesses file->private_data in the tegra_open() function, right after setting the field to &ctx->fh. Replace the accesses with usage of &ctx->fh. No functional change is intended, this only paves the way to remove direct accesses to file->private_data and make V4L2 drivers safer. Other accesses to the field will be addressed separately. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
committed by
Hans Verkuil
parent
8003313d38
commit
72517d9f76
@@ -836,10 +836,10 @@ static int tegra_open(struct file *file)
|
||||
v4l2_fh_add(&ctx->fh);
|
||||
|
||||
tegra_reset_coded_fmt(ctx);
|
||||
tegra_try_coded_fmt(file, file->private_data, &ctx->coded_fmt);
|
||||
tegra_try_coded_fmt(file, &ctx->fh, &ctx->coded_fmt);
|
||||
|
||||
tegra_reset_decoded_fmt(ctx);
|
||||
tegra_try_decoded_fmt(file, file->private_data, &ctx->decoded_fmt);
|
||||
tegra_try_decoded_fmt(file, &ctx->fh, &ctx->decoded_fmt);
|
||||
|
||||
return 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user