Re: [PATCH 58/65] media: zoran: Remove access to __fh

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02/08/2025 11:23, Jacopo Mondi wrote:
> The __fh parameter is assigned to an unsued variable. Remove it
> and remove the unused struct zoran_fh type.
> 
> Signed-off-by: Jacopo Mondi <jacopo.mondi@xxxxxxxxxxxxxxxx>
> ---
>  drivers/media/pci/zoran/zoran.h        | 6 ------
>  drivers/media/pci/zoran/zoran_driver.c | 3 +--
>  2 files changed, 1 insertion(+), 8 deletions(-)
> 
> diff --git a/drivers/media/pci/zoran/zoran.h b/drivers/media/pci/zoran/zoran.h
> index 1cd990468d3de9db8b14b72483972041c57bfee2..d05e222b392156bf1b3b4c83c6591db642c3c377 100644
> --- a/drivers/media/pci/zoran/zoran.h
> +++ b/drivers/media/pci/zoran/zoran.h
> @@ -154,12 +154,6 @@ struct zoran_jpg_settings {
>  
>  struct zoran;
>  
> -/* zoran_fh contains per-open() settings */
> -struct zoran_fh {
> -	struct v4l2_fh fh;
> -	struct zoran *zr;
> -};
> -
>  struct card_info {
>  	enum card_type type;
>  	char name[32];
> diff --git a/drivers/media/pci/zoran/zoran_driver.c b/drivers/media/pci/zoran/zoran_driver.c
> index f42f596d3e6295e31e3b33cd83c5f7243911bd30..ec7fc1da4cc02f5a344cb49bb9a783c41c758195 100644
> --- a/drivers/media/pci/zoran/zoran_driver.c
> +++ b/drivers/media/pci/zoran/zoran_driver.c
> @@ -511,12 +511,11 @@ static int zoran_s_fmt_vid_cap(struct file *file, void *__fh,

This driver uses __fh as the name for the second argument of the ioctl
callbacks. Can you take this opportunity to rename it to either 'fh' or 'priv'?

Generally it's not a good idea to prefix variables with __ for no good reason.

Grepping for __fh also shows two other drivers:

drivers/media/platform/chips-media/coda/coda-common.c:#define fh_to_ctx(__fh)   container_of(__fh, struct coda_ctx, fh)
drivers/media/platform/samsung/s5p-mfc/s5p_mfc_common.h:#define fh_to_ctx(__fh) container_of(__fh, struct s5p_mfc_ctx, fh)

I think it is a good idea to rename __fh to fh there as well.

Regards,

	Hans

>  			       struct v4l2_format *fmt)
>  {
>  	struct zoran *zr = video_drvdata(file);
> -	struct zoran_fh *fh = __fh;
>  	int i;
>  	int res = 0;
>  
>  	if (fmt->fmt.pix.pixelformat == V4L2_PIX_FMT_MJPEG)
> -		return zoran_s_fmt_vid_out(file, fh, fmt);
> +		return zoran_s_fmt_vid_out(file, __fh, fmt);
>  
>  	for (i = 0; i < NUM_FORMATS; i++)
>  		if (fmt->fmt.pix.pixelformat == zoran_formats[i].fourcc)
> 





[Index of Archives]     [Linux SoC Development]     [Linux Rockchip Development]     [Linux for Synopsys ARC Processors]    
  • [Linux on Unisoc (RDA Micro) SoCs]     [Linux Actions SoC]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Linux SCSI]     [Yosemite News]

  •   Powered by Linux