linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch v2] staging: rtl8723bs: hal: odm_HWConfig: odm_HWConfig: Unneeded variable: "result". Return "HAL_STATUS_SUCCESS"
@ 2019-05-19 17:27 Hariprasad Kelam
  2019-05-20  8:57 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: Hariprasad Kelam @ 2019-05-19 17:27 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Hariprasad Kelam, Payal Kshirsagar, devel,
	linux-kernel

This patch fixes below warnings reported by coccicheck

drivers/staging/rtl8723bs/hal/odm_HWConfig.c:501:4-10: Unneeded
variable: "result". Return "HAL_STATUS_SUCCESS" on line 526

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
-----
Changes in v2:
  - fixed typo in commit message
---

---
 drivers/staging/rtl8723bs/hal/odm_HWConfig.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/odm_HWConfig.c b/drivers/staging/rtl8723bs/hal/odm_HWConfig.c
index d802a1f..4711c65 100644
--- a/drivers/staging/rtl8723bs/hal/odm_HWConfig.c
+++ b/drivers/staging/rtl8723bs/hal/odm_HWConfig.c
@@ -498,8 +498,6 @@ HAL_STATUS ODM_ConfigBBWithHeaderFile(
 
 HAL_STATUS ODM_ConfigMACWithHeaderFile(PDM_ODM_T pDM_Odm)
 {
-	u8 result = HAL_STATUS_SUCCESS;
-
 	ODM_RT_TRACE(
 		pDM_Odm,
 		ODM_COMP_INIT,
@@ -523,5 +521,5 @@ HAL_STATUS ODM_ConfigMACWithHeaderFile(PDM_ODM_T pDM_Odm)
 
 	READ_AND_CONFIG(8723B, _MAC_REG);
 
-	return result;
+	return HAL_STATUS_SUCCESS;
 }
-- 
2.7.4


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

* Re: [Patch v2] staging: rtl8723bs: hal: odm_HWConfig: odm_HWConfig: Unneeded variable: "result". Return "HAL_STATUS_SUCCESS"
  2019-05-19 17:27 [Patch v2] staging: rtl8723bs: hal: odm_HWConfig: odm_HWConfig: Unneeded variable: "result". Return "HAL_STATUS_SUCCESS" Hariprasad Kelam
@ 2019-05-20  8:57 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2019-05-20  8:57 UTC (permalink / raw)
  To: Hariprasad Kelam; +Cc: Payal Kshirsagar, devel, linux-kernel

On Sun, May 19, 2019 at 10:57:24PM +0530, Hariprasad Kelam wrote:
> This patch fixes below warnings reported by coccicheck
> 
> drivers/staging/rtl8723bs/hal/odm_HWConfig.c:501:4-10: Unneeded
> variable: "result". Return "HAL_STATUS_SUCCESS" on line 526
> 
> Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
> -----
> Changes in v2:
>   - fixed typo in commit message
> ---
> 
> ---
>  drivers/staging/rtl8723bs/hal/odm_HWConfig.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/hal/odm_HWConfig.c b/drivers/staging/rtl8723bs/hal/odm_HWConfig.c
> index d802a1f..4711c65 100644
> --- a/drivers/staging/rtl8723bs/hal/odm_HWConfig.c
> +++ b/drivers/staging/rtl8723bs/hal/odm_HWConfig.c
> @@ -498,8 +498,6 @@ HAL_STATUS ODM_ConfigBBWithHeaderFile(
>  
>  HAL_STATUS ODM_ConfigMACWithHeaderFile(PDM_ODM_T pDM_Odm)
>  {
> -	u8 result = HAL_STATUS_SUCCESS;
> -
>  	ODM_RT_TRACE(
>  		pDM_Odm,
>  		ODM_COMP_INIT,
> @@ -523,5 +521,5 @@ HAL_STATUS ODM_ConfigMACWithHeaderFile(PDM_ODM_T pDM_Odm)
>  
>  	READ_AND_CONFIG(8723B, _MAC_REG);
>  
> -	return result;
> +	return HAL_STATUS_SUCCESS;
>  }

This whole function should really be reduced to just one line (the trace
stuff is not needed), and as this can not fail, it should not be
returning a value.

And if it can be one line, then why is it a function at all?  It's only
called in one place.

thanks,

greg k-h

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

end of thread, other threads:[~2019-05-20  8:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-19 17:27 [Patch v2] staging: rtl8723bs: hal: odm_HWConfig: odm_HWConfig: Unneeded variable: "result". Return "HAL_STATUS_SUCCESS" Hariprasad Kelam
2019-05-20  8:57 ` Greg Kroah-Hartman

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).