public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [media] bdisp: remove redundant assignment to pix
@ 2017-10-29 13:21 Colin King
  2017-10-29 13:30 ` Julia Lawall
  0 siblings, 1 reply; 3+ messages in thread
From: Colin King @ 2017-10-29 13:21 UTC (permalink / raw)
  To: Fabien Dessenne, Mauro Carvalho Chehab, linux-media
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Pointer pix is being initialized to a value and a little later
being assigned the same value again. Remove the redundant second
duplicate assignment. Cleans up the clang warning:

drivers/media/platform/sti/bdisp/bdisp-v4l2.c:726:26: warning: Value
stored to 'pix' during its initialization is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/media/platform/sti/bdisp/bdisp-v4l2.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
index 939da6da7644..14e99aeae140 100644
--- a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
+++ b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
@@ -731,7 +731,6 @@ static int bdisp_g_fmt(struct file *file, void *fh, struct v4l2_format *f)
 		return PTR_ERR(frame);
 	}
 
-	pix = &f->fmt.pix;
 	pix->width = frame->width;
 	pix->height = frame->height;
 	pix->pixelformat = frame->fmt->pixelformat;
-- 
2.14.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] [media] bdisp: remove redundant assignment to pix
  2017-10-29 13:21 [PATCH] [media] bdisp: remove redundant assignment to pix Colin King
@ 2017-10-29 13:30 ` Julia Lawall
  2017-10-29 13:37   ` Colin Ian King
  0 siblings, 1 reply; 3+ messages in thread
From: Julia Lawall @ 2017-10-29 13:30 UTC (permalink / raw)
  To: Colin King
  Cc: Fabien Dessenne, Mauro Carvalho Chehab, linux-media,
	kernel-janitors, linux-kernel



On Sun, 29 Oct 2017, Colin King wrote:

> From: Colin Ian King <colin.king@canonical.com>
>
> Pointer pix is being initialized to a value and a little later
> being assigned the same value again. Remove the redundant second
> duplicate assignment. Cleans up the clang warning:
>
> drivers/media/platform/sti/bdisp/bdisp-v4l2.c:726:26: warning: Value
> stored to 'pix' during its initialization is never read
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/media/platform/sti/bdisp/bdisp-v4l2.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
> index 939da6da7644..14e99aeae140 100644
> --- a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
> +++ b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
> @@ -731,7 +731,6 @@ static int bdisp_g_fmt(struct file *file, void *fh, struct v4l2_format *f)
>  		return PTR_ERR(frame);
>  	}
>
> -	pix = &f->fmt.pix;

Why not keep this one and drop the first one?  Maybe it would be nice to
keep all the initializations related to pix together?

julia

>  	pix->width = frame->width;
>  	pix->height = frame->height;
>  	pix->pixelformat = frame->fmt->pixelformat;
> --
> 2.14.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] [media] bdisp: remove redundant assignment to pix
  2017-10-29 13:30 ` Julia Lawall
@ 2017-10-29 13:37   ` Colin Ian King
  0 siblings, 0 replies; 3+ messages in thread
From: Colin Ian King @ 2017-10-29 13:37 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Fabien Dessenne, Mauro Carvalho Chehab, linux-media,
	kernel-janitors, linux-kernel

On 29/10/17 13:30, Julia Lawall wrote:
> 
> 
> On Sun, 29 Oct 2017, Colin King wrote:
> 
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> Pointer pix is being initialized to a value and a little later
>> being assigned the same value again. Remove the redundant second
>> duplicate assignment. Cleans up the clang warning:
>>
>> drivers/media/platform/sti/bdisp/bdisp-v4l2.c:726:26: warning: Value
>> stored to 'pix' during its initialization is never read
>>
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>> ---
>>  drivers/media/platform/sti/bdisp/bdisp-v4l2.c | 1 -
>>  1 file changed, 1 deletion(-)
>>
>> diff --git a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
>> index 939da6da7644..14e99aeae140 100644
>> --- a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
>> +++ b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
>> @@ -731,7 +731,6 @@ static int bdisp_g_fmt(struct file *file, void *fh, struct v4l2_format *f)
>>  		return PTR_ERR(frame);
>>  	}
>>
>> -	pix = &f->fmt.pix;
> 
> Why not keep this one and drop the first one?  Maybe it would be nice to
> keep all the initializations related to pix together?

Good point. Will send a V2.

> 
> julia
> 
>>  	pix->width = frame->width;
>>  	pix->height = frame->height;
>>  	pix->pixelformat = frame->fmt->pixelformat;
>> --
>> 2.14.1
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-10-29 13:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-29 13:21 [PATCH] [media] bdisp: remove redundant assignment to pix Colin King
2017-10-29 13:30 ` Julia Lawall
2017-10-29 13:37   ` Colin Ian King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox