[PATCH v2 8/9] media: core: export v4l2_compat_translate_cmd()

Ricardo Ribalda posted 9 patches 8 months, 1 week ago
There is a newer version of this series
[PATCH v2 8/9] media: core: export v4l2_compat_translate_cmd()
Posted by Ricardo Ribalda 8 months, 1 week ago
v4l2_compat_translate_cmd() can be useful for drivers to convert between
the VIDIOC_*32 and VIDIOC_ defines.

The VIDIOC_*32 defines are not accessible by the drivers, they live in
v4l2-compat-ioctl32.c.

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
index 8c07400bd280dea5d2e66e2759658c423bcd3866..ced4892b42597d605887b7c6a14373e3922f7bc6 100644
--- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
+++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
@@ -929,6 +929,7 @@ unsigned int v4l2_compat_translate_cmd(unsigned int cmd)
 	}
 	return cmd;
 }
+EXPORT_SYMBOL_GPL(v4l2_compat_translate_cmd);
 
 int v4l2_compat_get_user(void __user *arg, void *parg, unsigned int cmd)
 {

-- 
2.49.0.1266.g31b7d2e469-goog
Re: [PATCH v2 8/9] media: core: export v4l2_compat_translate_cmd()
Posted by hans@jjverkuil.nl 7 months, 2 weeks ago
On 02/06/2025 15:06, Ricardo Ribalda wrote:
> v4l2_compat_translate_cmd() can be useful for drivers to convert between
> the VIDIOC_*32 and VIDIOC_ defines.
> 
> The VIDIOC_*32 defines are not accessible by the drivers, they live in
> v4l2-compat-ioctl32.c.
> 
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> ---
>  drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> index 8c07400bd280dea5d2e66e2759658c423bcd3866..ced4892b42597d605887b7c6a14373e3922f7bc6 100644
> --- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> +++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> @@ -929,6 +929,7 @@ unsigned int v4l2_compat_translate_cmd(unsigned int cmd)
>  	}
>  	return cmd;
>  }
> +EXPORT_SYMBOL_GPL(v4l2_compat_translate_cmd);

If you want to export a function, then export video_translate_cmd().

That also deals with 32-bit time compatibility.

It should be renamed to v4l2_translate_cmd at the same time to avoid using the
'video_' prefix.

Regards,

	Hans

>  
>  int v4l2_compat_get_user(void __user *arg, void *parg, unsigned int cmd)
>  {
>
Re: [PATCH v2 8/9] media: core: export v4l2_compat_translate_cmd()
Posted by Hans de Goede 7 months, 2 weeks ago
Hi All,

On 2-Jun-25 3:06 PM, Ricardo Ribalda wrote:
> v4l2_compat_translate_cmd() can be useful for drivers to convert between
> the VIDIOC_*32 and VIDIOC_ defines.
> 
> The VIDIOC_*32 defines are not accessible by the drivers, they live in
> v4l2-compat-ioctl32.c.
> 
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>

Hans Verkuil with newer versions of patches 1-4 now merged
through other patch-series patches 5-9 are now ready for
merging.

This will require merging this core patch through the UVC
tree, may I please have your ack for this?

Regards,

Hans



> ---
>  drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> index 8c07400bd280dea5d2e66e2759658c423bcd3866..ced4892b42597d605887b7c6a14373e3922f7bc6 100644
> --- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> +++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> @@ -929,6 +929,7 @@ unsigned int v4l2_compat_translate_cmd(unsigned int cmd)
>  	}
>  	return cmd;
>  }
> +EXPORT_SYMBOL_GPL(v4l2_compat_translate_cmd);
>  
>  int v4l2_compat_get_user(void __user *arg, void *parg, unsigned int cmd)
>  {
>
Re: [PATCH v2 8/9] media: core: export v4l2_compat_translate_cmd()
Posted by Hans de Goede 7 months, 4 weeks ago
Hi Ricardo,

On 2-Jun-25 15:06, Ricardo Ribalda wrote:
> v4l2_compat_translate_cmd() can be useful for drivers to convert between
> the VIDIOC_*32 and VIDIOC_ defines.
> 
> The VIDIOC_*32 defines are not accessible by the drivers, they live in
> v4l2-compat-ioctl32.c.
> 
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede <hansg@kernel.org>

Regards,

Hans




> ---
>  drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> index 8c07400bd280dea5d2e66e2759658c423bcd3866..ced4892b42597d605887b7c6a14373e3922f7bc6 100644
> --- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> +++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> @@ -929,6 +929,7 @@ unsigned int v4l2_compat_translate_cmd(unsigned int cmd)
>  	}
>  	return cmd;
>  }
> +EXPORT_SYMBOL_GPL(v4l2_compat_translate_cmd);
>  
>  int v4l2_compat_get_user(void __user *arg, void *parg, unsigned int cmd)
>  {
>