linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: media: atomisp: remove useless breaks
@ 2021-05-06 20:09 Pavel Skripkin
  2021-05-07  7:54 ` Sakari Ailus
  0 siblings, 1 reply; 19+ messages in thread
From: Pavel Skripkin @ 2021-05-06 20:09 UTC (permalink / raw)
  To: mchehab, sakari.ailus, gregkh
  Cc: linux-media, linux-staging, linux-kernel, Pavel Skripkin

Breaks are not useful after a return, they can
simply be removed.

Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
---
 .../pci/hive_isp_css_common/host/input_system.c       | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
index 0f5a231672a8..fd82997b11cc 100644
--- a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
+++ b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
@@ -904,16 +904,12 @@ static input_system_err_t input_system_configure_channel(
 			break;
 		case INPUT_SYSTEM_SOURCE_TPG:
 			return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-			break;
 		case INPUT_SYSTEM_SOURCE_PRBS:
 			return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-			break;
 		case INPUT_SYSTEM_SOURCE_FIFO:
 			return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-			break;
 		default:
 			return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-			break;
 		}
 
 		if (error != INPUT_SYSTEM_ERR_NO_ERROR) return error;
@@ -995,7 +991,6 @@ static input_system_err_t input_buffer_configuration(void)
 			default:
 				config.csi_buffer_flags[port] |= INPUT_SYSTEM_CFG_FLAG_CONFLICT;
 				return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-				break;
 			}
 
 			// Check acquisition buffer specified but set it later since it has to be unique.
@@ -1032,7 +1027,6 @@ static input_system_err_t input_buffer_configuration(void)
 
 			default:
 				return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-				break;
 			}
 		} else {
 			config.csi_buffer_flags[port] = INPUT_SYSTEM_CFG_FLAG_BLOCKED;
@@ -1319,7 +1313,6 @@ static input_system_err_t configuration_to_registers(void)
 
 	default:
 		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-		break;
 
 	} // end of switch (source_type)
 
@@ -1696,16 +1689,12 @@ static input_system_err_t input_system_configure_channel_sensor(
 		break;
 	case INPUT_SYSTEM_FIFO_CAPTURE_WITH_COUNTING:
 		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-		break;
 	case INPUT_SYSTEM_XMEM_CAPTURE:
 		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-		break;
 	case INPUT_SYSTEM_XMEM_ACQUIRE:
 		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-		break;
 	default:
 		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-		break;
 	}
 	return INPUT_SYSTEM_ERR_NO_ERROR;
 }
-- 
2.31.1


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

* Re: [PATCH] staging: media: atomisp: remove useless breaks
  2021-05-06 20:09 [PATCH] staging: media: atomisp: remove useless breaks Pavel Skripkin
@ 2021-05-07  7:54 ` Sakari Ailus
  2021-05-07 13:25   ` Pavel Skripkin
  2021-05-08 10:51   ` [PATCH v2] staging: media: atomisp: code cleanup Pavel Skripkin
  0 siblings, 2 replies; 19+ messages in thread
From: Sakari Ailus @ 2021-05-07  7:54 UTC (permalink / raw)
  To: Pavel Skripkin; +Cc: mchehab, gregkh, linux-media, linux-staging, linux-kernel

Hi Pavel,

On Thu, May 06, 2021 at 11:09:56PM +0300, Pavel Skripkin wrote:
> Breaks are not useful after a return, they can
> simply be removed.
> 
> Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
> ---
>  .../pci/hive_isp_css_common/host/input_system.c       | 11 -----------
>  1 file changed, 11 deletions(-)
> 
> diff --git a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
> index 0f5a231672a8..fd82997b11cc 100644
> --- a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
> +++ b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
> @@ -904,16 +904,12 @@ static input_system_err_t input_system_configure_channel(
>  			break;
>  		case INPUT_SYSTEM_SOURCE_TPG:
>  			return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
> -			break;
>  		case INPUT_SYSTEM_SOURCE_PRBS:
>  			return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
> -			break;
>  		case INPUT_SYSTEM_SOURCE_FIFO:
>  			return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;

While at it, you could drop the individual return statements, too. There
seems to be another such location at the end of the patch.

> -			break;
>  		default:
>  			return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
> -			break;
>  		}
>  
>  		if (error != INPUT_SYSTEM_ERR_NO_ERROR) return error;
> @@ -995,7 +991,6 @@ static input_system_err_t input_buffer_configuration(void)
>  			default:
>  				config.csi_buffer_flags[port] |= INPUT_SYSTEM_CFG_FLAG_CONFLICT;
>  				return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
> -				break;
>  			}
>  
>  			// Check acquisition buffer specified but set it later since it has to be unique.
> @@ -1032,7 +1027,6 @@ static input_system_err_t input_buffer_configuration(void)
>  
>  			default:
>  				return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
> -				break;
>  			}
>  		} else {
>  			config.csi_buffer_flags[port] = INPUT_SYSTEM_CFG_FLAG_BLOCKED;
> @@ -1319,7 +1313,6 @@ static input_system_err_t configuration_to_registers(void)
>  
>  	default:
>  		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
> -		break;
>  
>  	} // end of switch (source_type)
>  
> @@ -1696,16 +1689,12 @@ static input_system_err_t input_system_configure_channel_sensor(
>  		break;
>  	case INPUT_SYSTEM_FIFO_CAPTURE_WITH_COUNTING:
>  		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
> -		break;
>  	case INPUT_SYSTEM_XMEM_CAPTURE:
>  		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
> -		break;
>  	case INPUT_SYSTEM_XMEM_ACQUIRE:
>  		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
> -		break;
>  	default:
>  		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
> -		break;
>  	}
>  	return INPUT_SYSTEM_ERR_NO_ERROR;
>  }

-- 
Regards,

Sakari Ailus

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

* Re: [PATCH] staging: media: atomisp: remove useless breaks
  2021-05-07  7:54 ` Sakari Ailus
@ 2021-05-07 13:25   ` Pavel Skripkin
  2021-05-08 10:51   ` [PATCH v2] staging: media: atomisp: code cleanup Pavel Skripkin
  1 sibling, 0 replies; 19+ messages in thread
From: Pavel Skripkin @ 2021-05-07 13:25 UTC (permalink / raw)
  To: Sakari Ailus; +Cc: mchehab, gregkh, linux-media, linux-staging, linux-kernel

On Fri, 7 May 2021 10:54:58 +0300
Sakari Ailus <sakari.ailus@linux.intel.com> wrote:

Hi, Sakari!

> Hi Pavel,
> 
> On Thu, May 06, 2021 at 11:09:56PM +0300, Pavel Skripkin wrote:
> > Breaks are not useful after a return, they can
> > simply be removed.
> > 
> > Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
> > ---
> >  .../pci/hive_isp_css_common/host/input_system.c       | 11
> > ----------- 1 file changed, 11 deletions(-)
> > 
> > diff --git
> > a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
> > b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
> > index 0f5a231672a8..fd82997b11cc 100644 ---
> > a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
> > +++
> > b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
> > @@ -904,16 +904,12 @@ static input_system_err_t
> > input_system_configure_channel( break; case
> > INPUT_SYSTEM_SOURCE_TPG: return
> > INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
> > -			break;
> >  		case INPUT_SYSTEM_SOURCE_PRBS:
> >  			return
> > INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
> > -			break;
> >  		case INPUT_SYSTEM_SOURCE_FIFO:
> >  			return
> > INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
> 
> While at it, you could drop the individual return statements, too.
> There seems to be another such location at the end of the patch.
>

Good catch, I will remove them in v2.

Also, I noticed, that there are returns in the end of void functions.
Can I remove them too in v2, or it should be done as another patch? 

> > -			break;
> >  		default:
> >  			return
> > INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
> > -			break;
> >  		}
> >  
> >  		if (error != INPUT_SYSTEM_ERR_NO_ERROR) return
> > error; @@ -995,7 +991,6 @@ static input_system_err_t
> > input_buffer_configuration(void) default:
> >  				config.csi_buffer_flags[port] |=
> > INPUT_SYSTEM_CFG_FLAG_CONFLICT; return
> > INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
> > -				break;
> >  			}
> >  
> >  			// Check acquisition buffer specified but
> > set it later since it has to be unique. @@ -1032,7 +1027,6 @@
> > static input_system_err_t input_buffer_configuration(void) 
> >  			default:
> >  				return
> > INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
> > -				break;
> >  			}
> >  		} else {
> >  			config.csi_buffer_flags[port] =
> > INPUT_SYSTEM_CFG_FLAG_BLOCKED; @@ -1319,7 +1313,6 @@ static
> > input_system_err_t configuration_to_registers(void) 
> >  	default:
> >  		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
> > -		break;
> >  
> >  	} // end of switch (source_type)
> >  
> > @@ -1696,16 +1689,12 @@ static input_system_err_t
> > input_system_configure_channel_sensor( break;
> >  	case INPUT_SYSTEM_FIFO_CAPTURE_WITH_COUNTING:
> >  		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
> > -		break;
> >  	case INPUT_SYSTEM_XMEM_CAPTURE:
> >  		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
> > -		break;
> >  	case INPUT_SYSTEM_XMEM_ACQUIRE:
> >  		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
> > -		break;
> >  	default:
> >  		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
> > -		break;
> >  	}
> >  	return INPUT_SYSTEM_ERR_NO_ERROR;
> >  }
> 




With regards,
Pavel Skripkin

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

* [PATCH v2] staging: media: atomisp: code cleanup
  2021-05-07  7:54 ` Sakari Ailus
  2021-05-07 13:25   ` Pavel Skripkin
@ 2021-05-08 10:51   ` Pavel Skripkin
  2021-05-08 10:58     ` Greg KH
  1 sibling, 1 reply; 19+ messages in thread
From: Pavel Skripkin @ 2021-05-08 10:51 UTC (permalink / raw)
  To: mchehab, sakari.ailus, gregkh
  Cc: linux-media, linux-staging, linux-kernel, Pavel Skripkin

Breaks are not useful after a return, they can
simply be removed.

Also, dropped the individual return statements
after or inside switch cases

Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
---
Changes in v2:
  dropped the individual return statements
---
 .../hive_isp_css_common/host/input_system.c    | 18 ------------------
 1 file changed, 18 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
index 0f5a231672a8..cbaaec620581 100644
--- a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
+++ b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
@@ -903,17 +903,10 @@ static input_system_err_t input_system_configure_channel(
 			error = input_system_configure_channel_sensor(channel);
 			break;
 		case INPUT_SYSTEM_SOURCE_TPG:
-			return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-			break;
 		case INPUT_SYSTEM_SOURCE_PRBS:
-			return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-			break;
 		case INPUT_SYSTEM_SOURCE_FIFO:
-			return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-			break;
 		default:
 			return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-			break;
 		}
 
 		if (error != INPUT_SYSTEM_ERR_NO_ERROR) return error;
@@ -995,7 +988,6 @@ static input_system_err_t input_buffer_configuration(void)
 			default:
 				config.csi_buffer_flags[port] |= INPUT_SYSTEM_CFG_FLAG_CONFLICT;
 				return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-				break;
 			}
 
 			// Check acquisition buffer specified but set it later since it has to be unique.
@@ -1032,7 +1024,6 @@ static input_system_err_t input_buffer_configuration(void)
 
 			default:
 				return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-				break;
 			}
 		} else {
 			config.csi_buffer_flags[port] = INPUT_SYSTEM_CFG_FLAG_BLOCKED;
@@ -1319,7 +1310,6 @@ static input_system_err_t configuration_to_registers(void)
 
 	default:
 		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-		break;
 
 	} // end of switch (source_type)
 
@@ -1695,19 +1685,11 @@ static input_system_err_t input_system_configure_channel_sensor(
 
 		break;
 	case INPUT_SYSTEM_FIFO_CAPTURE_WITH_COUNTING:
-		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-		break;
 	case INPUT_SYSTEM_XMEM_CAPTURE:
-		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-		break;
 	case INPUT_SYSTEM_XMEM_ACQUIRE:
-		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-		break;
 	default:
 		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-		break;
 	}
-	return INPUT_SYSTEM_ERR_NO_ERROR;
 }
 
 // Test flags and set structure.
-- 
2.31.1


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

* Re: [PATCH v2] staging: media: atomisp: code cleanup
  2021-05-08 10:51   ` [PATCH v2] staging: media: atomisp: code cleanup Pavel Skripkin
@ 2021-05-08 10:58     ` Greg KH
  2021-05-08 11:32       ` Pavel Skripkin
  2021-05-08 12:21       ` [PATCH v3 0/3] staging: media: atomisp: code clean up Pavel Skripkin
  0 siblings, 2 replies; 19+ messages in thread
From: Greg KH @ 2021-05-08 10:58 UTC (permalink / raw)
  To: Pavel Skripkin
  Cc: mchehab, sakari.ailus, linux-media, linux-staging, linux-kernel

On Sat, May 08, 2021 at 01:51:29PM +0300, Pavel Skripkin wrote:
> Breaks are not useful after a return, they can
> simply be removed.
> 
> Also, dropped the individual return statements
> after or inside switch cases

Almost always, when you say "also" in a patch changelog, that means this
should be split up into two different patches.

I recommend doing that here as well, this should be a 2 patch series,
right?

thanks,

greg k-h

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

* Re: [PATCH v2] staging: media: atomisp: code cleanup
  2021-05-08 10:58     ` Greg KH
@ 2021-05-08 11:32       ` Pavel Skripkin
  2021-05-08 12:21       ` [PATCH v3 0/3] staging: media: atomisp: code clean up Pavel Skripkin
  1 sibling, 0 replies; 19+ messages in thread
From: Pavel Skripkin @ 2021-05-08 11:32 UTC (permalink / raw)
  To: Greg KH; +Cc: mchehab, sakari.ailus, linux-media, linux-staging, linux-kernel

Hi, Greg!

On Sat, 8 May 2021 12:58:06 +0200
Greg KH <gregkh@linuxfoundation.org> wrote:

> On Sat, May 08, 2021 at 01:51:29PM +0300, Pavel Skripkin wrote:
> > Breaks are not useful after a return, they can
> > simply be removed.
> > 
> > Also, dropped the individual return statements
> > after or inside switch cases
> 
> Almost always, when you say "also" in a patch changelog, that means
> this should be split up into two different patches.
> 

I thought, I could add this to current patch, because It was suggested
by maintainer, but, I guess, I was wrong :)

> I recommend doing that here as well, this should be a 2 patch series,
> right?
> 

Thanks for suggestion! I will also remove returns at the end of void
functions as 3rd patch in serie.

> thanks,
> 
> greg k-h

With regards,
Pavel Skripkin

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

* [PATCH v3 0/3] staging: media: atomisp: code clean up
  2021-05-08 10:58     ` Greg KH
  2021-05-08 11:32       ` Pavel Skripkin
@ 2021-05-08 12:21       ` Pavel Skripkin
  2021-05-08 12:21         ` [PATCH v3 1/3] staging: media: atomisp: remove useless breaks Pavel Skripkin
                           ` (2 more replies)
  1 sibling, 3 replies; 19+ messages in thread
From: Pavel Skripkin @ 2021-05-08 12:21 UTC (permalink / raw)
  To: mchehab, sakari.ailus, gregkh
  Cc: linux-media, linux-staging, linux-kernel, Pavel Skripkin

This patch series includes code clean up for input_system.c.

Changes from v3:
  Removed returns at the end of void functions
  Split all changes into 3 patches

Changes from v2:
  Removed useless returns

Pavel Skripkin (3):
  staging: media: atomisp: remove useless breaks
  staging: media: atomisp: remove dublicate code
  staging: media: atomisp: remove useless returns

 .../hive_isp_css_common/host/input_system.c   | 62 -------------------
 1 file changed, 62 deletions(-)

-- 
2.31.1


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

* [PATCH v3 1/3] staging: media: atomisp: remove useless breaks
  2021-05-08 12:21       ` [PATCH v3 0/3] staging: media: atomisp: code clean up Pavel Skripkin
@ 2021-05-08 12:21         ` Pavel Skripkin
  2021-05-08 12:21         ` [PATCH v3 2/3] staging: media: atomisp: remove dublicate code Pavel Skripkin
  2021-05-08 12:21         ` [PATCH v3 3/3] staging: media: atomisp: remove useless returns Pavel Skripkin
  2 siblings, 0 replies; 19+ messages in thread
From: Pavel Skripkin @ 2021-05-08 12:21 UTC (permalink / raw)
  To: mchehab, sakari.ailus, gregkh
  Cc: linux-media, linux-staging, linux-kernel, Pavel Skripkin

Breaks are not useful after a return, they can
simply be removed.

Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
---
 .../pci/hive_isp_css_common/host/input_system.c       | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
index 0f5a231672a8..fd82997b11cc 100644
--- a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
+++ b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
@@ -904,16 +904,12 @@ static input_system_err_t input_system_configure_channel(
 			break;
 		case INPUT_SYSTEM_SOURCE_TPG:
 			return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-			break;
 		case INPUT_SYSTEM_SOURCE_PRBS:
 			return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-			break;
 		case INPUT_SYSTEM_SOURCE_FIFO:
 			return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-			break;
 		default:
 			return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-			break;
 		}
 
 		if (error != INPUT_SYSTEM_ERR_NO_ERROR) return error;
@@ -995,7 +991,6 @@ static input_system_err_t input_buffer_configuration(void)
 			default:
 				config.csi_buffer_flags[port] |= INPUT_SYSTEM_CFG_FLAG_CONFLICT;
 				return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-				break;
 			}
 
 			// Check acquisition buffer specified but set it later since it has to be unique.
@@ -1032,7 +1027,6 @@ static input_system_err_t input_buffer_configuration(void)
 
 			default:
 				return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-				break;
 			}
 		} else {
 			config.csi_buffer_flags[port] = INPUT_SYSTEM_CFG_FLAG_BLOCKED;
@@ -1319,7 +1313,6 @@ static input_system_err_t configuration_to_registers(void)
 
 	default:
 		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-		break;
 
 	} // end of switch (source_type)
 
@@ -1696,16 +1689,12 @@ static input_system_err_t input_system_configure_channel_sensor(
 		break;
 	case INPUT_SYSTEM_FIFO_CAPTURE_WITH_COUNTING:
 		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-		break;
 	case INPUT_SYSTEM_XMEM_CAPTURE:
 		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-		break;
 	case INPUT_SYSTEM_XMEM_ACQUIRE:
 		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-		break;
 	default:
 		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-		break;
 	}
 	return INPUT_SYSTEM_ERR_NO_ERROR;
 }
-- 
2.31.1


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

* [PATCH v3 2/3] staging: media: atomisp: remove dublicate code
  2021-05-08 12:21       ` [PATCH v3 0/3] staging: media: atomisp: code clean up Pavel Skripkin
  2021-05-08 12:21         ` [PATCH v3 1/3] staging: media: atomisp: remove useless breaks Pavel Skripkin
@ 2021-05-08 12:21         ` Pavel Skripkin
  2021-05-08 12:21         ` [PATCH v3 3/3] staging: media: atomisp: remove useless returns Pavel Skripkin
  2 siblings, 0 replies; 19+ messages in thread
From: Pavel Skripkin @ 2021-05-08 12:21 UTC (permalink / raw)
  To: mchehab, sakari.ailus, gregkh
  Cc: linux-media, linux-staging, linux-kernel, Pavel Skripkin

Removed dublicate returns and breaks inside switch
statements and useless return after switch.

Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
---
 .../pci/hive_isp_css_common/host/input_system.c     | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
index fd82997b11cc..76414b6b43c9 100644
--- a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
+++ b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
@@ -903,11 +903,8 @@ static input_system_err_t input_system_configure_channel(
 			error = input_system_configure_channel_sensor(channel);
 			break;
 		case INPUT_SYSTEM_SOURCE_TPG:
-			return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
 		case INPUT_SYSTEM_SOURCE_PRBS:
-			return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
 		case INPUT_SYSTEM_SOURCE_FIFO:
-			return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
 		default:
 			return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
 		}
@@ -1301,13 +1298,7 @@ static input_system_err_t configuration_to_registers(void)
 		break;
 
 	case INPUT_SYSTEM_SOURCE_TPG:
-
-		break;
-
 	case INPUT_SYSTEM_SOURCE_PRBS:
-
-		break;
-
 	case INPUT_SYSTEM_SOURCE_FIFO:
 		break;
 
@@ -1688,15 +1679,11 @@ static input_system_err_t input_system_configure_channel_sensor(
 
 		break;
 	case INPUT_SYSTEM_FIFO_CAPTURE_WITH_COUNTING:
-		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
 	case INPUT_SYSTEM_XMEM_CAPTURE:
-		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
 	case INPUT_SYSTEM_XMEM_ACQUIRE:
-		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
 	default:
 		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
 	}
-	return INPUT_SYSTEM_ERR_NO_ERROR;
 }
 
 // Test flags and set structure.
-- 
2.31.1


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

* [PATCH v3 3/3] staging: media: atomisp: remove useless returns
  2021-05-08 12:21       ` [PATCH v3 0/3] staging: media: atomisp: code clean up Pavel Skripkin
  2021-05-08 12:21         ` [PATCH v3 1/3] staging: media: atomisp: remove useless breaks Pavel Skripkin
  2021-05-08 12:21         ` [PATCH v3 2/3] staging: media: atomisp: remove dublicate code Pavel Skripkin
@ 2021-05-08 12:21         ` Pavel Skripkin
  2021-05-08 12:43           ` Fabio Aiuto
  2 siblings, 1 reply; 19+ messages in thread
From: Pavel Skripkin @ 2021-05-08 12:21 UTC (permalink / raw)
  To: mchehab, sakari.ailus, gregkh
  Cc: linux-media, linux-staging, linux-kernel, Pavel Skripkin

Breaks are not useful at the end of void function,
they can simply be removed.

Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
---
 .../hive_isp_css_common/host/input_system.c   | 38 -------------------
 1 file changed, 38 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
index 76414b6b43c9..8e085dda0c18 100644
--- a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
+++ b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
@@ -174,8 +174,6 @@ void input_system_get_state(
 		ctrl_unit_get_state(ID, sub_id,
 				    &state->ctrl_unit_state[sub_id - CTRL_UNIT0_ID]);
 	}
-
-	return;
 }
 
 void receiver_get_state(
@@ -246,8 +244,6 @@ void receiver_get_state(
 			       _HRT_CSS_RECEIVER_BE_IRQ_STATUS_REG_IDX);
 	state->be_irq_clear = receiver_reg_load(ID,
 						_HRT_CSS_RECEIVER_BE_IRQ_CLEAR_REG_IDX);
-
-	return;
 }
 
 bool is_mipi_format_yuv420(
@@ -310,8 +306,6 @@ void receiver_set_compression(
 	reg = ((field_id < 6) ? (val << (field_id * 5)) : (val << ((
 		    field_id - 6) * 5)));
 	receiver_reg_store(ID, addr, reg);
-
-	return;
 }
 
 void receiver_port_enable(
@@ -330,7 +324,6 @@ void receiver_port_enable(
 
 	receiver_port_reg_store(ID, port_ID,
 				_HRT_CSS_RECEIVER_DEVICE_READY_REG_IDX, reg);
-	return;
 }
 
 bool is_receiver_port_enabled(
@@ -349,7 +342,6 @@ void receiver_irq_enable(
 {
 	receiver_port_reg_store(ID,
 				port_ID, _HRT_CSS_RECEIVER_IRQ_ENABLE_REG_IDX, irq_info);
-	return;
 }
 
 rx_irq_info_t receiver_get_irq_info(
@@ -367,7 +359,6 @@ void receiver_irq_clear(
 {
 	receiver_port_reg_store(ID,
 				port_ID, _HRT_CSS_RECEIVER_IRQ_STATUS_REG_IDX, irq_info);
-	return;
 }
 
 static inline void capture_unit_get_state(
@@ -428,8 +419,6 @@ static inline void capture_unit_get_state(
 	state->FSM_State_Info = input_system_sub_system_reg_load(ID,
 				sub_id,
 				CAPT_FSM_STATE_INFO_REG_ID);
-
-	return;
 }
 
 static inline void acquisition_unit_get_state(
@@ -478,8 +467,6 @@ static inline void acquisition_unit_get_state(
 	state->Int_Cntr_Info = input_system_sub_system_reg_load(ID,
 			       sub_id,
 			       ACQ_INT_CNTR_INFO_REG_ID);
-
-	return;
 }
 
 static inline void ctrl_unit_get_state(
@@ -561,8 +548,6 @@ static inline void ctrl_unit_get_state(
 	state->capt_reserve_one_mem_region = input_system_sub_system_reg_load(ID,
 					     sub_id,
 					     ISYS_CTRL_CAPT_RESERVE_ONE_MEM_REGION_REG_ID);
-
-	return;
 }
 
 static inline void mipi_port_get_state(
@@ -597,8 +582,6 @@ static inline void mipi_port_get_state(
 		state->lane_sync_count[i] = (uint8_t)((state->sync_count) >> (i * 8));
 		state->lane_rx_count[i] = (uint8_t)((state->rx_count) >> (i * 8));
 	}
-
-	return;
 }
 
 static inline void rx_channel_get_state(
@@ -652,8 +635,6 @@ static inline void rx_channel_get_state(
 		state->comp[i] = (mipi_compressor_t)(val & 0x07);
 		state->pred[i] = (mipi_predictor_t)((val & 0x18) >> 3);
 	}
-
-	return;
 }
 
 // MW: "2400" in the name is not good, but this is to avoid a naming conflict
@@ -672,8 +653,6 @@ static void receiver_rst(
 	}
 
 	// AM: Additional actions for stopping receiver?
-
-	return;
 }
 
 //Single function to reset all the devices mapped via GP_DEVICE.
@@ -722,8 +701,6 @@ static void gp_device_rst(const gp_device_ID_t		ID)
 	//	gp_device_reg_store(ID, _REG_GP_SYNCGEN_FRAME_CNT_ADDR, ZERO);
 	gp_device_reg_store(ID, _REG_GP_SOFT_RESET_ADDR,
 			    ZERO); // AM: Maybe this soft reset is not safe.
-
-	return;
 }
 
 static void input_selector_cfg_for_sensor(const gp_device_ID_t ID)
@@ -740,8 +717,6 @@ static void input_selector_cfg_for_sensor(const gp_device_ID_t ID)
 	gp_device_reg_store(ID, _REG_GP_ISEL_SBAND_SEL_ADDR, ZERO);
 	gp_device_reg_store(ID, _REG_GP_ISEL_SYNC_SEL_ADDR, ZERO);
 	gp_device_reg_store(ID, _REG_GP_SOFT_RESET_ADDR, ZERO);
-
-	return;
 }
 
 static void input_switch_rst(const gp_device_ID_t ID)
@@ -760,8 +735,6 @@ static void input_switch_rst(const gp_device_ID_t ID)
 	gp_device_reg_store(ID,
 			    _REG_GP_IFMT_input_switch_fsync_lut,
 			    ZERO);
-
-	return;
 }
 
 static void input_switch_cfg(
@@ -786,8 +759,6 @@ static void input_switch_cfg(
 	gp_device_reg_store(ID,
 			    _REG_GP_IFMT_input_switch_fsync_lut,
 			    cfg->vsync_data_reg);
-
-	return;
 }
 
 static void input_system_network_rst(const input_system_ID_t ID)
@@ -843,8 +814,6 @@ static void input_system_network_rst(const input_system_ID_t ID)
 						  ISYS_CTRL_INIT_REG_ID,
 						  1U); //AM: Is there any named constant?
 	}
-
-	return;
 }
 
 // Function that resets current configuration.
@@ -1072,8 +1041,6 @@ static void capture_unit_configure(
 					  sub_id,
 					  CAPT_NUM_MEM_REGIONS_REG_ID,
 					  cfg->nof_mem_regs);
-
-	return;
 }
 
 static void acquisition_unit_configure(
@@ -1097,8 +1064,6 @@ static void acquisition_unit_configure(
 					  sub_id,
 					  ACQ_MEM_REGION_SIZE_REG_ID,
 					  cfg->mem_reg_size);
-
-	return;
 }
 
 static void ctrl_unit_configure(
@@ -1165,7 +1130,6 @@ static void ctrl_unit_configure(
 					  sub_id,
 					  ISYS_CTRL_CAPT_RESERVE_ONE_MEM_REGION_REG_ID,
 					  0);
-	return;
 }
 
 static void input_system_network_configure(
@@ -1223,8 +1187,6 @@ static void input_system_network_configure(
 				    sub_id,
 				    &cfg->ctrl_unit_cfg[sub_id - CTRL_UNIT0_ID]);
 	}
-
-	return;
 }
 
 static input_system_err_t configuration_to_registers(void)
-- 
2.31.1


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

* Re: [PATCH v3 3/3] staging: media: atomisp: remove useless returns
  2021-05-08 12:21         ` [PATCH v3 3/3] staging: media: atomisp: remove useless returns Pavel Skripkin
@ 2021-05-08 12:43           ` Fabio Aiuto
  2021-05-08 12:48             ` Dan Carpenter
                               ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Fabio Aiuto @ 2021-05-08 12:43 UTC (permalink / raw)
  To: Pavel Skripkin
  Cc: mchehab, sakari.ailus, gregkh, linux-media, linux-staging, linux-kernel

Hi Pavel,

On Sat, May 08, 2021 at 03:21:52PM +0300, Pavel Skripkin wrote:
> Breaks are not useful at the end of void function,
> they can simply be removed.

this commit description is not really describing the changes that
have been made

> 
> Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>

thank you,

fabio

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

* Re: [PATCH v3 3/3] staging: media: atomisp: remove useless returns
  2021-05-08 12:43           ` Fabio Aiuto
@ 2021-05-08 12:48             ` Dan Carpenter
  2021-05-08 12:59               ` Fabio Aiuto
  2021-05-08 13:05             ` Pavel Skripkin
  2021-05-08 13:16             ` [PATCH v4 0/3] staging: media: atomisp: code clean up Pavel Skripkin
  2 siblings, 1 reply; 19+ messages in thread
From: Dan Carpenter @ 2021-05-08 12:48 UTC (permalink / raw)
  To: Fabio Aiuto
  Cc: Pavel Skripkin, mchehab, sakari.ailus, gregkh, linux-media,
	linux-staging, linux-kernel

On Sat, May 08, 2021 at 02:43:35PM +0200, Fabio Aiuto wrote:
> Hi Pavel,
> 
> On Sat, May 08, 2021 at 03:21:52PM +0300, Pavel Skripkin wrote:
> > Breaks are not useful at the end of void function,
> > they can simply be removed.
> 
> this commit description is not really describing the changes that
> have been made
> 

Pavel clearly intended to say "Returns" instead of "Breaks".  But when
you're complaining about commit messages please write a better one so
the people can cut and paste it.

regards,
dan carpenter


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

* Re: [PATCH v3 3/3] staging: media: atomisp: remove useless returns
  2021-05-08 12:48             ` Dan Carpenter
@ 2021-05-08 12:59               ` Fabio Aiuto
  0 siblings, 0 replies; 19+ messages in thread
From: Fabio Aiuto @ 2021-05-08 12:59 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Pavel Skripkin, mchehab, sakari.ailus, gregkh, linux-media,
	linux-staging, linux-kernel

On Sat, May 08, 2021 at 03:48:41PM +0300, Dan Carpenter wrote:
> On Sat, May 08, 2021 at 02:43:35PM +0200, Fabio Aiuto wrote:
> > Hi Pavel,
> > 
> > On Sat, May 08, 2021 at 03:21:52PM +0300, Pavel Skripkin wrote:
> > > Breaks are not useful at the end of void function,
> > > they can simply be removed.
> > 
> > this commit description is not really describing the changes that
> > have been made
> > 
> 
> Pavel clearly intended to say "Returns" instead of "Breaks".  But when
> you're complaining about commit messages please write a better one so
> the people can cut and paste it.
> 
> regards,
> dan carpenter
> 

got it, thank you Dan, and sorry Pavel

fabio

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

* Re: [PATCH v3 3/3] staging: media: atomisp: remove useless returns
  2021-05-08 12:43           ` Fabio Aiuto
  2021-05-08 12:48             ` Dan Carpenter
@ 2021-05-08 13:05             ` Pavel Skripkin
  2021-05-08 13:16             ` [PATCH v4 0/3] staging: media: atomisp: code clean up Pavel Skripkin
  2 siblings, 0 replies; 19+ messages in thread
From: Pavel Skripkin @ 2021-05-08 13:05 UTC (permalink / raw)
  To: Fabio Aiuto
  Cc: mchehab, sakari.ailus, gregkh, linux-media, linux-staging, linux-kernel

Hi, Fabio!

On Sat, 8 May 2021 14:43:35 +0200
Fabio Aiuto <fabioaiuto83@gmail.com> wrote:

> Hi Pavel,
> 
> On Sat, May 08, 2021 at 03:21:52PM +0300, Pavel Skripkin wrote:
> > Breaks are not useful at the end of void function,
> > they can simply be removed.
> 
> this commit description is not really describing the changes that
> have been made
> 

oh..., it's copy-paste error. Thank you for pointing it out :)
Will fix it in v4 

> > 
> > Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
> 
> thank you,
> 
> fabio


With regards,
Pavel Skripkin

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

* [PATCH v4 0/3] staging: media: atomisp: code clean up
  2021-05-08 12:43           ` Fabio Aiuto
  2021-05-08 12:48             ` Dan Carpenter
  2021-05-08 13:05             ` Pavel Skripkin
@ 2021-05-08 13:16             ` Pavel Skripkin
  2021-05-08 13:17               ` [PATCH v4 1/3] staging: media: atomisp: remove useless breaks Pavel Skripkin
                                 ` (3 more replies)
  2 siblings, 4 replies; 19+ messages in thread
From: Pavel Skripkin @ 2021-05-08 13:16 UTC (permalink / raw)
  To: mchehab, sakari.ailus, gregkh
  Cc: linux-media, linux-staging, linux-kernel, Pavel Skripkin

This patch series include code clean up for input_system.c.

Changes from v4:
  Fixed commit message in 3rd patch

Changes from v3:
  Removed returns at the end of void functions
  Split all changes into 3 patches

Changes from v2:
  Removed useless returns


Pavel Skripkin (3):
  staging: media: atomisp: remove useless breaks
  staging: media: atomisp: remove dublicate code
  staging: media: atomisp: remove useless returns

 .../hive_isp_css_common/host/input_system.c   | 62 -------------------
 1 file changed, 62 deletions(-)

-- 
2.31.1


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

* [PATCH v4 1/3] staging: media: atomisp: remove useless breaks
  2021-05-08 13:16             ` [PATCH v4 0/3] staging: media: atomisp: code clean up Pavel Skripkin
@ 2021-05-08 13:17               ` Pavel Skripkin
  2021-05-08 13:17               ` [PATCH v4 2/3] staging: media: atomisp: remove dublicate code Pavel Skripkin
                                 ` (2 subsequent siblings)
  3 siblings, 0 replies; 19+ messages in thread
From: Pavel Skripkin @ 2021-05-08 13:17 UTC (permalink / raw)
  To: mchehab, sakari.ailus, gregkh
  Cc: linux-media, linux-staging, linux-kernel, Pavel Skripkin

Breaks are not useful after a return, they can
simply be removed.

Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
---
 .../pci/hive_isp_css_common/host/input_system.c       | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
index 0f5a231672a8..fd82997b11cc 100644
--- a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
+++ b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
@@ -904,16 +904,12 @@ static input_system_err_t input_system_configure_channel(
 			break;
 		case INPUT_SYSTEM_SOURCE_TPG:
 			return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-			break;
 		case INPUT_SYSTEM_SOURCE_PRBS:
 			return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-			break;
 		case INPUT_SYSTEM_SOURCE_FIFO:
 			return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-			break;
 		default:
 			return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-			break;
 		}
 
 		if (error != INPUT_SYSTEM_ERR_NO_ERROR) return error;
@@ -995,7 +991,6 @@ static input_system_err_t input_buffer_configuration(void)
 			default:
 				config.csi_buffer_flags[port] |= INPUT_SYSTEM_CFG_FLAG_CONFLICT;
 				return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-				break;
 			}
 
 			// Check acquisition buffer specified but set it later since it has to be unique.
@@ -1032,7 +1027,6 @@ static input_system_err_t input_buffer_configuration(void)
 
 			default:
 				return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-				break;
 			}
 		} else {
 			config.csi_buffer_flags[port] = INPUT_SYSTEM_CFG_FLAG_BLOCKED;
@@ -1319,7 +1313,6 @@ static input_system_err_t configuration_to_registers(void)
 
 	default:
 		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-		break;
 
 	} // end of switch (source_type)
 
@@ -1696,16 +1689,12 @@ static input_system_err_t input_system_configure_channel_sensor(
 		break;
 	case INPUT_SYSTEM_FIFO_CAPTURE_WITH_COUNTING:
 		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-		break;
 	case INPUT_SYSTEM_XMEM_CAPTURE:
 		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-		break;
 	case INPUT_SYSTEM_XMEM_ACQUIRE:
 		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-		break;
 	default:
 		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
-		break;
 	}
 	return INPUT_SYSTEM_ERR_NO_ERROR;
 }
-- 
2.31.1


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

* [PATCH v4 2/3] staging: media: atomisp: remove dublicate code
  2021-05-08 13:16             ` [PATCH v4 0/3] staging: media: atomisp: code clean up Pavel Skripkin
  2021-05-08 13:17               ` [PATCH v4 1/3] staging: media: atomisp: remove useless breaks Pavel Skripkin
@ 2021-05-08 13:17               ` Pavel Skripkin
  2021-05-08 13:17               ` [PATCH v4 3/3] staging: media: atomisp: remove useless returns Pavel Skripkin
  2021-05-25 16:18               ` [PATCH v4 0/3] staging: media: atomisp: code clean up Sakari Ailus
  3 siblings, 0 replies; 19+ messages in thread
From: Pavel Skripkin @ 2021-05-08 13:17 UTC (permalink / raw)
  To: mchehab, sakari.ailus, gregkh
  Cc: linux-media, linux-staging, linux-kernel, Pavel Skripkin

Removed dublicate returns and breaks inside switch
statements and useless return after switch.

Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
---
 .../pci/hive_isp_css_common/host/input_system.c     | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
index fd82997b11cc..76414b6b43c9 100644
--- a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
+++ b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
@@ -903,11 +903,8 @@ static input_system_err_t input_system_configure_channel(
 			error = input_system_configure_channel_sensor(channel);
 			break;
 		case INPUT_SYSTEM_SOURCE_TPG:
-			return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
 		case INPUT_SYSTEM_SOURCE_PRBS:
-			return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
 		case INPUT_SYSTEM_SOURCE_FIFO:
-			return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
 		default:
 			return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
 		}
@@ -1301,13 +1298,7 @@ static input_system_err_t configuration_to_registers(void)
 		break;
 
 	case INPUT_SYSTEM_SOURCE_TPG:
-
-		break;
-
 	case INPUT_SYSTEM_SOURCE_PRBS:
-
-		break;
-
 	case INPUT_SYSTEM_SOURCE_FIFO:
 		break;
 
@@ -1688,15 +1679,11 @@ static input_system_err_t input_system_configure_channel_sensor(
 
 		break;
 	case INPUT_SYSTEM_FIFO_CAPTURE_WITH_COUNTING:
-		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
 	case INPUT_SYSTEM_XMEM_CAPTURE:
-		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
 	case INPUT_SYSTEM_XMEM_ACQUIRE:
-		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
 	default:
 		return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
 	}
-	return INPUT_SYSTEM_ERR_NO_ERROR;
 }
 
 // Test flags and set structure.
-- 
2.31.1


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

* [PATCH v4 3/3] staging: media: atomisp: remove useless returns
  2021-05-08 13:16             ` [PATCH v4 0/3] staging: media: atomisp: code clean up Pavel Skripkin
  2021-05-08 13:17               ` [PATCH v4 1/3] staging: media: atomisp: remove useless breaks Pavel Skripkin
  2021-05-08 13:17               ` [PATCH v4 2/3] staging: media: atomisp: remove dublicate code Pavel Skripkin
@ 2021-05-08 13:17               ` Pavel Skripkin
  2021-05-25 16:18               ` [PATCH v4 0/3] staging: media: atomisp: code clean up Sakari Ailus
  3 siblings, 0 replies; 19+ messages in thread
From: Pavel Skripkin @ 2021-05-08 13:17 UTC (permalink / raw)
  To: mchehab, sakari.ailus, gregkh
  Cc: linux-media, linux-staging, linux-kernel, Pavel Skripkin

Returns are not useful at the end of void functions,
they can simply be removed.

Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
---
 .../hive_isp_css_common/host/input_system.c   | 38 -------------------
 1 file changed, 38 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
index 76414b6b43c9..8e085dda0c18 100644
--- a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
+++ b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
@@ -174,8 +174,6 @@ void input_system_get_state(
 		ctrl_unit_get_state(ID, sub_id,
 				    &state->ctrl_unit_state[sub_id - CTRL_UNIT0_ID]);
 	}
-
-	return;
 }
 
 void receiver_get_state(
@@ -246,8 +244,6 @@ void receiver_get_state(
 			       _HRT_CSS_RECEIVER_BE_IRQ_STATUS_REG_IDX);
 	state->be_irq_clear = receiver_reg_load(ID,
 						_HRT_CSS_RECEIVER_BE_IRQ_CLEAR_REG_IDX);
-
-	return;
 }
 
 bool is_mipi_format_yuv420(
@@ -310,8 +306,6 @@ void receiver_set_compression(
 	reg = ((field_id < 6) ? (val << (field_id * 5)) : (val << ((
 		    field_id - 6) * 5)));
 	receiver_reg_store(ID, addr, reg);
-
-	return;
 }
 
 void receiver_port_enable(
@@ -330,7 +324,6 @@ void receiver_port_enable(
 
 	receiver_port_reg_store(ID, port_ID,
 				_HRT_CSS_RECEIVER_DEVICE_READY_REG_IDX, reg);
-	return;
 }
 
 bool is_receiver_port_enabled(
@@ -349,7 +342,6 @@ void receiver_irq_enable(
 {
 	receiver_port_reg_store(ID,
 				port_ID, _HRT_CSS_RECEIVER_IRQ_ENABLE_REG_IDX, irq_info);
-	return;
 }
 
 rx_irq_info_t receiver_get_irq_info(
@@ -367,7 +359,6 @@ void receiver_irq_clear(
 {
 	receiver_port_reg_store(ID,
 				port_ID, _HRT_CSS_RECEIVER_IRQ_STATUS_REG_IDX, irq_info);
-	return;
 }
 
 static inline void capture_unit_get_state(
@@ -428,8 +419,6 @@ static inline void capture_unit_get_state(
 	state->FSM_State_Info = input_system_sub_system_reg_load(ID,
 				sub_id,
 				CAPT_FSM_STATE_INFO_REG_ID);
-
-	return;
 }
 
 static inline void acquisition_unit_get_state(
@@ -478,8 +467,6 @@ static inline void acquisition_unit_get_state(
 	state->Int_Cntr_Info = input_system_sub_system_reg_load(ID,
 			       sub_id,
 			       ACQ_INT_CNTR_INFO_REG_ID);
-
-	return;
 }
 
 static inline void ctrl_unit_get_state(
@@ -561,8 +548,6 @@ static inline void ctrl_unit_get_state(
 	state->capt_reserve_one_mem_region = input_system_sub_system_reg_load(ID,
 					     sub_id,
 					     ISYS_CTRL_CAPT_RESERVE_ONE_MEM_REGION_REG_ID);
-
-	return;
 }
 
 static inline void mipi_port_get_state(
@@ -597,8 +582,6 @@ static inline void mipi_port_get_state(
 		state->lane_sync_count[i] = (uint8_t)((state->sync_count) >> (i * 8));
 		state->lane_rx_count[i] = (uint8_t)((state->rx_count) >> (i * 8));
 	}
-
-	return;
 }
 
 static inline void rx_channel_get_state(
@@ -652,8 +635,6 @@ static inline void rx_channel_get_state(
 		state->comp[i] = (mipi_compressor_t)(val & 0x07);
 		state->pred[i] = (mipi_predictor_t)((val & 0x18) >> 3);
 	}
-
-	return;
 }
 
 // MW: "2400" in the name is not good, but this is to avoid a naming conflict
@@ -672,8 +653,6 @@ static void receiver_rst(
 	}
 
 	// AM: Additional actions for stopping receiver?
-
-	return;
 }
 
 //Single function to reset all the devices mapped via GP_DEVICE.
@@ -722,8 +701,6 @@ static void gp_device_rst(const gp_device_ID_t		ID)
 	//	gp_device_reg_store(ID, _REG_GP_SYNCGEN_FRAME_CNT_ADDR, ZERO);
 	gp_device_reg_store(ID, _REG_GP_SOFT_RESET_ADDR,
 			    ZERO); // AM: Maybe this soft reset is not safe.
-
-	return;
 }
 
 static void input_selector_cfg_for_sensor(const gp_device_ID_t ID)
@@ -740,8 +717,6 @@ static void input_selector_cfg_for_sensor(const gp_device_ID_t ID)
 	gp_device_reg_store(ID, _REG_GP_ISEL_SBAND_SEL_ADDR, ZERO);
 	gp_device_reg_store(ID, _REG_GP_ISEL_SYNC_SEL_ADDR, ZERO);
 	gp_device_reg_store(ID, _REG_GP_SOFT_RESET_ADDR, ZERO);
-
-	return;
 }
 
 static void input_switch_rst(const gp_device_ID_t ID)
@@ -760,8 +735,6 @@ static void input_switch_rst(const gp_device_ID_t ID)
 	gp_device_reg_store(ID,
 			    _REG_GP_IFMT_input_switch_fsync_lut,
 			    ZERO);
-
-	return;
 }
 
 static void input_switch_cfg(
@@ -786,8 +759,6 @@ static void input_switch_cfg(
 	gp_device_reg_store(ID,
 			    _REG_GP_IFMT_input_switch_fsync_lut,
 			    cfg->vsync_data_reg);
-
-	return;
 }
 
 static void input_system_network_rst(const input_system_ID_t ID)
@@ -843,8 +814,6 @@ static void input_system_network_rst(const input_system_ID_t ID)
 						  ISYS_CTRL_INIT_REG_ID,
 						  1U); //AM: Is there any named constant?
 	}
-
-	return;
 }
 
 // Function that resets current configuration.
@@ -1072,8 +1041,6 @@ static void capture_unit_configure(
 					  sub_id,
 					  CAPT_NUM_MEM_REGIONS_REG_ID,
 					  cfg->nof_mem_regs);
-
-	return;
 }
 
 static void acquisition_unit_configure(
@@ -1097,8 +1064,6 @@ static void acquisition_unit_configure(
 					  sub_id,
 					  ACQ_MEM_REGION_SIZE_REG_ID,
 					  cfg->mem_reg_size);
-
-	return;
 }
 
 static void ctrl_unit_configure(
@@ -1165,7 +1130,6 @@ static void ctrl_unit_configure(
 					  sub_id,
 					  ISYS_CTRL_CAPT_RESERVE_ONE_MEM_REGION_REG_ID,
 					  0);
-	return;
 }
 
 static void input_system_network_configure(
@@ -1223,8 +1187,6 @@ static void input_system_network_configure(
 				    sub_id,
 				    &cfg->ctrl_unit_cfg[sub_id - CTRL_UNIT0_ID]);
 	}
-
-	return;
 }
 
 static input_system_err_t configuration_to_registers(void)
-- 
2.31.1


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

* Re: [PATCH v4 0/3] staging: media: atomisp: code clean up
  2021-05-08 13:16             ` [PATCH v4 0/3] staging: media: atomisp: code clean up Pavel Skripkin
                                 ` (2 preceding siblings ...)
  2021-05-08 13:17               ` [PATCH v4 3/3] staging: media: atomisp: remove useless returns Pavel Skripkin
@ 2021-05-25 16:18               ` Sakari Ailus
  3 siblings, 0 replies; 19+ messages in thread
From: Sakari Ailus @ 2021-05-25 16:18 UTC (permalink / raw)
  To: Pavel Skripkin; +Cc: mchehab, gregkh, linux-media, linux-staging, linux-kernel

On Sat, May 08, 2021 at 04:16:47PM +0300, Pavel Skripkin wrote:
> This patch series include code clean up for input_system.c.
> 
> Changes from v4:
>   Fixed commit message in 3rd patch
> 
> Changes from v3:
>   Removed returns at the end of void functions
>   Split all changes into 3 patches
> 
> Changes from v2:
>   Removed useless returns
> 
> 
> Pavel Skripkin (3):
>   staging: media: atomisp: remove useless breaks
>   staging: media: atomisp: remove dublicate code
>   staging: media: atomisp: remove useless returns
> 
>  .../hive_isp_css_common/host/input_system.c   | 62 -------------------
>  1 file changed, 62 deletions(-)

Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>

-- 
Sakari Ailus

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

end of thread, other threads:[~2021-05-25 16:18 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-06 20:09 [PATCH] staging: media: atomisp: remove useless breaks Pavel Skripkin
2021-05-07  7:54 ` Sakari Ailus
2021-05-07 13:25   ` Pavel Skripkin
2021-05-08 10:51   ` [PATCH v2] staging: media: atomisp: code cleanup Pavel Skripkin
2021-05-08 10:58     ` Greg KH
2021-05-08 11:32       ` Pavel Skripkin
2021-05-08 12:21       ` [PATCH v3 0/3] staging: media: atomisp: code clean up Pavel Skripkin
2021-05-08 12:21         ` [PATCH v3 1/3] staging: media: atomisp: remove useless breaks Pavel Skripkin
2021-05-08 12:21         ` [PATCH v3 2/3] staging: media: atomisp: remove dublicate code Pavel Skripkin
2021-05-08 12:21         ` [PATCH v3 3/3] staging: media: atomisp: remove useless returns Pavel Skripkin
2021-05-08 12:43           ` Fabio Aiuto
2021-05-08 12:48             ` Dan Carpenter
2021-05-08 12:59               ` Fabio Aiuto
2021-05-08 13:05             ` Pavel Skripkin
2021-05-08 13:16             ` [PATCH v4 0/3] staging: media: atomisp: code clean up Pavel Skripkin
2021-05-08 13:17               ` [PATCH v4 1/3] staging: media: atomisp: remove useless breaks Pavel Skripkin
2021-05-08 13:17               ` [PATCH v4 2/3] staging: media: atomisp: remove dublicate code Pavel Skripkin
2021-05-08 13:17               ` [PATCH v4 3/3] staging: media: atomisp: remove useless returns Pavel Skripkin
2021-05-25 16:18               ` [PATCH v4 0/3] staging: media: atomisp: code clean up Sakari Ailus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).