public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: r8188eu: Directly return 0 instead of using local ret variable
@ 2022-03-11  9:23 Haowen Bai
  2022-03-11  9:56 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Haowen Bai @ 2022-03-11  9:23 UTC (permalink / raw)
  To: Larry.Finger, phil, gregkh; +Cc: linux-staging, linux-kernel, Haowen Bai

fixes coccinelle warning:
drivers/staging/r8188eu/hal/rtl8188eu_xmit.c:152:5-9: Unneeded variable: "pull". Return "0" on line 302

Signed-off-by: Haowen Bai <baihaowen@meizu.com>
---
 drivers/staging/r8188eu/hal/rtl8188eu_xmit.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c b/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c
index 293541d..6ab89f8 100644
--- a/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c
+++ b/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c
@@ -149,7 +149,6 @@ static void fill_txdesc_phy(struct pkt_attrib *pattrib, __le32 *pdw)
 
 static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz, u8 bagg_pkt)
 {
-	int	pull = 0;
 	uint	qsel;
 	u8 data_rate, pwr_status, offset;
 	struct adapter		*adapt = pxmitframe->padapter;
@@ -299,7 +298,8 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz, u8 bag
 	ODM_SetTxAntByTxInfo_88E(&haldata->odmpriv, pmem, pattrib->mac_id);
 
 	rtl8188eu_cal_txdesc_chksum(ptxdesc);
-	return pull;
+
+	return 0;
 }
 
 /* for non-agg data frame or  management frame */
-- 
2.7.4


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

* Re: [PATCH] staging: r8188eu: Directly return 0 instead of using local ret variable
  2022-03-11  9:23 [PATCH] staging: r8188eu: Directly return 0 instead of using local ret variable Haowen Bai
@ 2022-03-11  9:56 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2022-03-11  9:56 UTC (permalink / raw)
  To: Haowen Bai; +Cc: Larry.Finger, phil, linux-staging, linux-kernel

On Fri, Mar 11, 2022 at 05:23:06PM +0800, Haowen Bai wrote:
> fixes coccinelle warning:
> drivers/staging/r8188eu/hal/rtl8188eu_xmit.c:152:5-9: Unneeded variable: "pull". Return "0" on line 302
> 
> Signed-off-by: Haowen Bai <baihaowen@meizu.com>
> ---
>  drivers/staging/r8188eu/hal/rtl8188eu_xmit.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c b/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c
> index 293541d..6ab89f8 100644
> --- a/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c
> +++ b/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c
> @@ -149,7 +149,6 @@ static void fill_txdesc_phy(struct pkt_attrib *pattrib, __le32 *pdw)
>  
>  static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz, u8 bagg_pkt)
>  {
> -	int	pull = 0;
>  	uint	qsel;
>  	u8 data_rate, pwr_status, offset;
>  	struct adapter		*adapt = pxmitframe->padapter;
> @@ -299,7 +298,8 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz, u8 bag
>  	ODM_SetTxAntByTxInfo_88E(&haldata->odmpriv, pmem, pattrib->mac_id);
>  
>  	rtl8188eu_cal_txdesc_chksum(ptxdesc);
> -	return pull;
> +
> +	return 0;
>  }

No, as this function can only return 0, please make it a void function
and fix up the callers to simplify this.

thanks,

greg k-h

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

end of thread, other threads:[~2022-03-11  9:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-11  9:23 [PATCH] staging: r8188eu: Directly return 0 instead of using local ret variable Haowen Bai
2022-03-11  9:56 ` Greg KH

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