All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] staging: media: davinci_vpfe: Compress return logic and remove unnecessary lines of function
@ 2016-02-18 22:35 Thaissa Falbo
  2016-02-18 22:35 ` [PATCH 1/2] staging: media: davinci_vpfe: remove ret variable " Thaissa Falbo
  2016-02-18 22:35 ` [PATCH 2/2] staging: media: davinci_vpfe: remove unnecessary case and enum Thaissa Falbo
  0 siblings, 2 replies; 8+ messages in thread
From: Thaissa Falbo @ 2016-02-18 22:35 UTC (permalink / raw)
  To: outreachy-kernel

Simplify function by:
 - compressing return logic 
 - removing unnecessary case in switch 
 - removing ununsed variable


Thaissa Falbo (2):
  staging: media: davinci_vpfe: remove ret variable of function
  staging: media: davinci_vpfe: remove unnecessary case and enum

 drivers/staging/media/davinci_vpfe/dm365_isif.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

-- 
2.1.4



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

* [PATCH 1/2] staging: media: davinci_vpfe: remove ret variable of function
  2016-02-18 22:35 [PATCH 0/2] staging: media: davinci_vpfe: Compress return logic and remove unnecessary lines of function Thaissa Falbo
@ 2016-02-18 22:35 ` Thaissa Falbo
  2016-02-20 22:55   ` [Outreachy kernel] " Greg KH
  2016-02-18 22:35 ` [PATCH 2/2] staging: media: davinci_vpfe: remove unnecessary case and enum Thaissa Falbo
  1 sibling, 1 reply; 8+ messages in thread
From: Thaissa Falbo @ 2016-02-18 22:35 UTC (permalink / raw)
  To: outreachy-kernel

Signed-off-by: Thaissa Falbo <thaissa.falbo@gmail.com>
---
 drivers/staging/media/davinci_vpfe/dm365_isif.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/media/davinci_vpfe/dm365_isif.c b/drivers/staging/media/davinci_vpfe/dm365_isif.c
index 9b28513..747d29f 100644
--- a/drivers/staging/media/davinci_vpfe/dm365_isif.c
+++ b/drivers/staging/media/davinci_vpfe/dm365_isif.c
@@ -229,7 +229,6 @@ isif_config_format(struct vpfe_device *vpfe_dev, unsigned int pad)
 	struct vpfe_isif_device *vpfe_isif = &vpfe_dev->vpfe_isif;
 	enum isif_frmfmt frm_fmt = ISIF_FRMFMT_INTERLACED;
 	struct v4l2_pix_format format;
-	int ret = 0;
 
 	v4l2_fill_pix_format(&format, &vpfe_dev->vpfe_isif.formats[pad]);
 	mbus_to_pix(&vpfe_dev->vpfe_isif.formats[pad], &format);
@@ -252,8 +251,8 @@ isif_config_format(struct vpfe_device *vpfe_dev, unsigned int pad)
 	switch (vpfe_dev->vpfe_isif.formats[pad].field) {
 	case V4L2_FIELD_INTERLACED:
 		/* do nothing, since it is default */
-		ret = isif_set_buftype(vpfe_isif, ISIF_BUFTYPE_FLD_INTERLEAVED);
-		break;
+		return isif_set_buftype(vpfe_isif,
+				ISIF_BUFTYPE_FLD_INTERLEAVED);
 
 	case V4L2_FIELD_NONE:
 		frm_fmt = ISIF_FRMFMT_PROGRESSIVE;
@@ -261,18 +260,15 @@ isif_config_format(struct vpfe_device *vpfe_dev, unsigned int pad)
 		break;
 
 	case V4L2_FIELD_SEQ_TB:
-		ret = isif_set_buftype(vpfe_isif, ISIF_BUFTYPE_FLD_SEPARATED);
-		break;
+		return isif_set_buftype(vpfe_isif, ISIF_BUFTYPE_FLD_SEPARATED);
 
 	default:
 		return -EINVAL;
 	}
 
 	/* set the frame format */
-	if (!ret)
-		ret = isif_set_frame_format(vpfe_isif, frm_fmt);
+	return isif_set_frame_format(vpfe_isif, frm_fmt);
 
-	return ret;
 }
 
 /*
-- 
2.1.4



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

* [PATCH 2/2] staging: media: davinci_vpfe: remove unnecessary case and enum
  2016-02-18 22:35 [PATCH 0/2] staging: media: davinci_vpfe: Compress return logic and remove unnecessary lines of function Thaissa Falbo
  2016-02-18 22:35 ` [PATCH 1/2] staging: media: davinci_vpfe: remove ret variable " Thaissa Falbo
@ 2016-02-18 22:35 ` Thaissa Falbo
  2016-02-19  3:13   ` [Outreachy kernel] " Julia Lawall
  1 sibling, 1 reply; 8+ messages in thread
From: Thaissa Falbo @ 2016-02-18 22:35 UTC (permalink / raw)
  To: outreachy-kernel

Signed-off-by: Thaissa Falbo <thaissa.falbo@gmail.com>
---
 drivers/staging/media/davinci_vpfe/dm365_isif.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/staging/media/davinci_vpfe/dm365_isif.c b/drivers/staging/media/davinci_vpfe/dm365_isif.c
index 747d29f..b1e6fd0 100644
--- a/drivers/staging/media/davinci_vpfe/dm365_isif.c
+++ b/drivers/staging/media/davinci_vpfe/dm365_isif.c
@@ -227,7 +227,6 @@ static int
 isif_config_format(struct vpfe_device *vpfe_dev, unsigned int pad)
 {
 	struct vpfe_isif_device *vpfe_isif = &vpfe_dev->vpfe_isif;
-	enum isif_frmfmt frm_fmt = ISIF_FRMFMT_INTERLACED;
 	struct v4l2_pix_format format;
 
 	v4l2_fill_pix_format(&format, &vpfe_dev->vpfe_isif.formats[pad]);
@@ -254,11 +253,6 @@ isif_config_format(struct vpfe_device *vpfe_dev, unsigned int pad)
 		return isif_set_buftype(vpfe_isif,
 				ISIF_BUFTYPE_FLD_INTERLEAVED);
 
-	case V4L2_FIELD_NONE:
-		frm_fmt = ISIF_FRMFMT_PROGRESSIVE;
-		/* buffer type only applicable for interlaced scan */
-		break;
-
 	case V4L2_FIELD_SEQ_TB:
 		return isif_set_buftype(vpfe_isif, ISIF_BUFTYPE_FLD_SEPARATED);
 
-- 
2.1.4



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

* Re: [Outreachy kernel] [PATCH 2/2] staging: media: davinci_vpfe: remove unnecessary case and enum
  2016-02-18 22:35 ` [PATCH 2/2] staging: media: davinci_vpfe: remove unnecessary case and enum Thaissa Falbo
@ 2016-02-19  3:13   ` Julia Lawall
  2016-02-19 21:12     ` Thaíssa Falbo
  0 siblings, 1 reply; 8+ messages in thread
From: Julia Lawall @ 2016-02-19  3:13 UTC (permalink / raw)
  To: Thaissa Falbo; +Cc: outreachy-kernel

Why is it unnecessary?  There should probably be more information in the
commit message.

julia

On Thu, 18 Feb 2016, Thaissa Falbo wrote:

> Signed-off-by: Thaissa Falbo <thaissa.falbo@gmail.com>
> ---
>  drivers/staging/media/davinci_vpfe/dm365_isif.c | 6 ------
>  1 file changed, 6 deletions(-)
>
> diff --git a/drivers/staging/media/davinci_vpfe/dm365_isif.c b/drivers/staging/media/davinci_vpfe/dm365_isif.c
> index 747d29f..b1e6fd0 100644
> --- a/drivers/staging/media/davinci_vpfe/dm365_isif.c
> +++ b/drivers/staging/media/davinci_vpfe/dm365_isif.c
> @@ -227,7 +227,6 @@ static int
>  isif_config_format(struct vpfe_device *vpfe_dev, unsigned int pad)
>  {
>  	struct vpfe_isif_device *vpfe_isif = &vpfe_dev->vpfe_isif;
> -	enum isif_frmfmt frm_fmt = ISIF_FRMFMT_INTERLACED;
>  	struct v4l2_pix_format format;
>
>  	v4l2_fill_pix_format(&format, &vpfe_dev->vpfe_isif.formats[pad]);
> @@ -254,11 +253,6 @@ isif_config_format(struct vpfe_device *vpfe_dev, unsigned int pad)
>  		return isif_set_buftype(vpfe_isif,
>  				ISIF_BUFTYPE_FLD_INTERLEAVED);
>
> -	case V4L2_FIELD_NONE:
> -		frm_fmt = ISIF_FRMFMT_PROGRESSIVE;
> -		/* buffer type only applicable for interlaced scan */
> -		break;
> -
>  	case V4L2_FIELD_SEQ_TB:
>  		return isif_set_buftype(vpfe_isif, ISIF_BUFTYPE_FLD_SEPARATED);
>
> --
> 2.1.4
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/a97c778a2c814868c68a81dc18bfe25466422853.1455834014.git.thaissa.falbo%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>


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

* Re: [Outreachy kernel] [PATCH 2/2] staging: media: davinci_vpfe: remove unnecessary case and enum
  2016-02-19  3:13   ` [Outreachy kernel] " Julia Lawall
@ 2016-02-19 21:12     ` Thaíssa Falbo
  2016-02-20  4:20       ` Julia Lawall
  0 siblings, 1 reply; 8+ messages in thread
From: Thaíssa Falbo @ 2016-02-19 21:12 UTC (permalink / raw)
  To: Julia Lawall; +Cc: outreachy-kernel

Thaíssa Falbo



2016-02-19 1:13 GMT-02:00 Julia Lawall <julia.lawall@lip6.fr>:
> Why is it unnecessary?  There should probably be more information in the
> commit message.
>
> julia
>
> On Thu, 18 Feb 2016, Thaissa Falbo wrote:
>
>> Signed-off-by: Thaissa Falbo <thaissa.falbo@gmail.com>
>> ---
>>  drivers/staging/media/davinci_vpfe/dm365_isif.c | 6 ------
>>  1 file changed, 6 deletions(-)
>>
>> diff --git a/drivers/staging/media/davinci_vpfe/dm365_isif.c b/drivers/staging/media/davinci_vpfe/dm365_isif.c
>> index 747d29f..b1e6fd0 100644
>> --- a/drivers/staging/media/davinci_vpfe/dm365_isif.c
>> +++ b/drivers/staging/media/davinci_vpfe/dm365_isif.c
>> @@ -227,7 +227,6 @@ static int
>>  isif_config_format(struct vpfe_device *vpfe_dev, unsigned int pad)
>>  {
>>       struct vpfe_isif_device *vpfe_isif = &vpfe_dev->vpfe_isif;

Here, the variable was set to a constant

>> -     enum isif_frmfmt frm_fmt = ISIF_FRMFMT_INTERLACED;
>>       struct v4l2_pix_format format;
>>
>>       v4l2_fill_pix_format(&format, &vpfe_dev->vpfe_isif.formats[pad]);
>> @@ -254,11 +253,6 @@ isif_config_format(struct vpfe_device *vpfe_dev, unsigned int pad)
>>               return isif_set_buftype(vpfe_isif,
>>                               ISIF_BUFTYPE_FLD_INTERLEAVED);
>>

And then used into one of the cases.

>> -     case V4L2_FIELD_NONE:
>> -             frm_fmt = ISIF_FRMFMT_PROGRESSIVE;
>> -             /* buffer type only applicable for interlaced scan */
>> -             break;
>> -
>>       case V4L2_FIELD_SEQ_TB:
>>               return isif_set_buftype(vpfe_isif, ISIF_BUFTYPE_FLD_SEPARATED);
>>

After the switch, if was never used. There is only the return of the function.

>> --
>> 2.1.4
>>
>> --
>> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
>> To post to this group, send email to outreachy-kernel@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/a97c778a2c814868c68a81dc18bfe25466422853.1455834014.git.thaissa.falbo%40gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
>>


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

* Re: [Outreachy kernel] [PATCH 2/2] staging: media: davinci_vpfe: remove unnecessary case and enum
  2016-02-19 21:12     ` Thaíssa Falbo
@ 2016-02-20  4:20       ` Julia Lawall
  0 siblings, 0 replies; 8+ messages in thread
From: Julia Lawall @ 2016-02-20  4:20 UTC (permalink / raw)
  To: Thaíssa Falbo; +Cc: outreachy-kernel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 3385 bytes --]

On Fri, 19 Feb 2016, Thaíssa Falbo wrote:

> Thaíssa Falbo
>
>
>
> 2016-02-19 1:13 GMT-02:00 Julia Lawall <julia.lawall@lip6.fr>:
> > Why is it unnecessary?  There should probably be more information in the
> > commit message.

You should answer the question here, instead of at the end of the message.
Also, it would be better to put your name after the answer, rather than at
the top of the message.


> >
> > julia
> >
> > On Thu, 18 Feb 2016, Thaissa Falbo wrote:
> >
> >> Signed-off-by: Thaissa Falbo <thaissa.falbo@gmail.com>
> >> ---
> >>  drivers/staging/media/davinci_vpfe/dm365_isif.c | 6 ------
> >>  1 file changed, 6 deletions(-)
> >>
> >> diff --git a/drivers/staging/media/davinci_vpfe/dm365_isif.c b/drivers/staging/media/davinci_vpfe/dm365_isif.c
> >> index 747d29f..b1e6fd0 100644
> >> --- a/drivers/staging/media/davinci_vpfe/dm365_isif.c
> >> +++ b/drivers/staging/media/davinci_vpfe/dm365_isif.c
> >> @@ -227,7 +227,6 @@ static int
> >>  isif_config_format(struct vpfe_device *vpfe_dev, unsigned int pad)
> >>  {
> >>       struct vpfe_isif_device *vpfe_isif = &vpfe_dev->vpfe_isif;
>
> Here, the variable was set to a constant
>
> >> -     enum isif_frmfmt frm_fmt = ISIF_FRMFMT_INTERLACED;
> >>       struct v4l2_pix_format format;
> >>
> >>       v4l2_fill_pix_format(&format, &vpfe_dev->vpfe_isif.formats[pad]);
> >> @@ -254,11 +253,6 @@ isif_config_format(struct vpfe_device *vpfe_dev, unsigned int pad)
> >>               return isif_set_buftype(vpfe_isif,
> >>                               ISIF_BUFTYPE_FLD_INTERLEAVED);
> >>
>
> And then used into one of the cases.
>
> >> -     case V4L2_FIELD_NONE:
> >> -             frm_fmt = ISIF_FRMFMT_PROGRESSIVE;
> >> -             /* buffer type only applicable for interlaced scan */
> >> -             break;
> >> -

After the switch, frm_fmt is used in the call to isif_set_frame_format.
I'm not sure why this call can be discarded.  Also, removing the case and
the break will cause the result to be return -EINVAL;, but that doesn't
seem correct.

julia

> >>       case V4L2_FIELD_SEQ_TB:
> >>               return isif_set_buftype(vpfe_isif, ISIF_BUFTYPE_FLD_SEPARATED);
> >>
>
> After the switch, if was never used. There is only the return of the function.
>
> >> --
> >> 2.1.4
> >>
> >> --
> >> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> >> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> >> To post to this group, send email to outreachy-kernel@googlegroups.com.
> >> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/a97c778a2c814868c68a81dc18bfe25466422853.1455834014.git.thaissa.falbo%40gmail.com.
> >> For more options, visit https://groups.google.com/d/optout.
> >>
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/CAKqL7ZVnFHPjQJ53uuHFWrYZEg6oKgNN9Rg1hiex3SEhu6ms%2BA%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>

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

* Re: [Outreachy kernel] [PATCH 1/2] staging: media: davinci_vpfe: remove ret variable of function
  2016-02-18 22:35 ` [PATCH 1/2] staging: media: davinci_vpfe: remove ret variable " Thaissa Falbo
@ 2016-02-20 22:55   ` Greg KH
  2016-02-21  1:12     ` Thaíssa Falbo
  0 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2016-02-20 22:55 UTC (permalink / raw)
  To: Thaissa Falbo; +Cc: outreachy-kernel

On Thu, Feb 18, 2016 at 08:35:12PM -0200, Thaissa Falbo wrote:
> Signed-off-by: Thaissa Falbo <thaissa.falbo@gmail.com>

I can't accept patches without any changelog text at all :(



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

* Re: [Outreachy kernel] [PATCH 1/2] staging: media: davinci_vpfe: remove ret variable of function
  2016-02-20 22:55   ` [Outreachy kernel] " Greg KH
@ 2016-02-21  1:12     ` Thaíssa Falbo
  0 siblings, 0 replies; 8+ messages in thread
From: Thaíssa Falbo @ 2016-02-21  1:12 UTC (permalink / raw)
  To: Greg KH; +Cc: outreachy-kernel

[-- Attachment #1: Type: text/plain, Size: 302 bytes --]

Sorry, I'm gonna send a v2 on that! :)
Em 20/02/2016 20:55, "Greg KH" <gregkh@linuxfoundation.org> escreveu:

> On Thu, Feb 18, 2016 at 08:35:12PM -0200, Thaissa Falbo wrote:
> > Signed-off-by: Thaissa Falbo <thaissa.falbo@gmail.com>
>
> I can't accept patches without any changelog text at all :(
>
>

[-- Attachment #2: Type: text/html, Size: 630 bytes --]

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

end of thread, other threads:[~2016-02-21  1:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-18 22:35 [PATCH 0/2] staging: media: davinci_vpfe: Compress return logic and remove unnecessary lines of function Thaissa Falbo
2016-02-18 22:35 ` [PATCH 1/2] staging: media: davinci_vpfe: remove ret variable " Thaissa Falbo
2016-02-20 22:55   ` [Outreachy kernel] " Greg KH
2016-02-21  1:12     ` Thaíssa Falbo
2016-02-18 22:35 ` [PATCH 2/2] staging: media: davinci_vpfe: remove unnecessary case and enum Thaissa Falbo
2016-02-19  3:13   ` [Outreachy kernel] " Julia Lawall
2016-02-19 21:12     ` Thaíssa Falbo
2016-02-20  4:20       ` Julia Lawall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.