2020-01-13 17:23:29

by Cengiz Can

[permalink] [raw]
Subject: [PATCH] media: davinci: remove self assignment in vpfe

There's a self assignment which has no effect.

Removed self assignment.

Signed-off-by: Cengiz Can <[email protected]>
---
drivers/media/platform/davinci/vpfe_capture.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/media/platform/davinci/vpfe_capture.c b/drivers/media/platform/davinci/vpfe_capture.c
index 916ed743d716..089648665cdf 100644
--- a/drivers/media/platform/davinci/vpfe_capture.c
+++ b/drivers/media/platform/davinci/vpfe_capture.c
@@ -879,7 +879,6 @@ static int vpfe_enum_fmt_vid_cap(struct file *file, void *priv,
/* Fill in the information about format */
pix_fmt = vpfe_lookup_pix_format(pix);
if (pix_fmt) {
- fmt->pixelformat = fmt->pixelformat;
return 0;
}
return -EINVAL;
--
2.24.1


2020-01-14 14:27:33

by Lad, Prabhakar

[permalink] [raw]
Subject: Re: [PATCH] media: davinci: remove self assignment in vpfe

Hi Cengiz,

Thank you for the patch.

On Mon, Jan 13, 2020 at 5:21 PM Cengiz Can <[email protected]> wrote:
>
> There's a self assignment which has no effect.
>
> Removed self assignment.
>
> Signed-off-by: Cengiz Can <[email protected]>
> ---
> drivers/media/platform/davinci/vpfe_capture.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/media/platform/davinci/vpfe_capture.c b/drivers/media/platform/davinci/vpfe_capture.c
> index 916ed743d716..089648665cdf 100644
> --- a/drivers/media/platform/davinci/vpfe_capture.c
> +++ b/drivers/media/platform/davinci/vpfe_capture.c
> @@ -879,7 +879,6 @@ static int vpfe_enum_fmt_vid_cap(struct file *file, void *priv,
> /* Fill in the information about format */
> pix_fmt = vpfe_lookup_pix_format(pix);
> if (pix_fmt) {
> - fmt->pixelformat = fmt->pixelformat;
good catch, but the correct fix is to assign pix_fmt->pixelformat to
fmt->pixelformat.

Cheers,
--Prabhakar Lad

> return 0;
> }
> return -EINVAL;
> --
> 2.24.1
>

2020-01-16 15:15:06

by Cengiz Can

[permalink] [raw]
Subject: [PATCH v2] media: davinci: fix incorrect pix_fmt assignment

There's a mistakenly written self assignment in
`static int vpfe_enum_fmt_vid_cap(..)`.

Fixed it according to Prabhakar Lad's feedback.

Signed-off-by: Cengiz Can <[email protected]>
---
drivers/media/platform/davinci/vpfe_capture.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/davinci/vpfe_capture.c b/drivers/media/platform/davinci/vpfe_capture.c
index 916ed743d716..357f7ade5218 100644
--- a/drivers/media/platform/davinci/vpfe_capture.c
+++ b/drivers/media/platform/davinci/vpfe_capture.c
@@ -879,7 +879,7 @@ static int vpfe_enum_fmt_vid_cap(struct file *file, void *priv,
/* Fill in the information about format */
pix_fmt = vpfe_lookup_pix_format(pix);
if (pix_fmt) {
- fmt->pixelformat = fmt->pixelformat;
+ fmt->pixelformat = pix_fmt->pixelformat;
return 0;
}
return -EINVAL;
--
2.25.0