[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211109121823.GJ2001@kadam>
Date: Tue, 9 Nov 2021 15:18:24 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Pavel Skripkin <paskripkin@...il.com>
Cc: cgel.zte@...il.com, Larry.Finger@...inger.net,
phil@...lpotter.co.uk, gregkh@...uxfoundation.org,
straube.linux@...il.com, linux-staging@...ts.linux.dev,
linux-kernel@...r.kernel.org,
Changcheng Deng <deng.changcheng@....com.cn>,
Zeal Robot <zealci@....com.cn>
Subject: Re: [PATCH] staging: r8188eu: remove unneeded variable
On Tue, Nov 09, 2021 at 03:09:21PM +0300, Pavel Skripkin wrote:
> On 11/9/21 14:53, cgel.zte@...il.com wrote:
> > From: Changcheng Deng <deng.changcheng@....com.cn>
> >
> > Fix the following coccicheck review:
> > ./drivers/staging/r8188eu/core/rtw_cmd.c: 66: 5-8: Unneeded variable
> >
> > Remove unneeded variable used to store return value.
> >
> > Reported-by: Zeal Robot <zealci@....com.cn>
> > Signed-off-by: Changcheng Deng <deng.changcheng@....com.cn>
> > ---
> > drivers/staging/r8188eu/core/rtw_cmd.c | 4 +---
> > 1 file changed, 1 insertion(+), 3 deletions(-)
> >
> > diff --git a/drivers/staging/r8188eu/core/rtw_cmd.c b/drivers/staging/r8188eu/core/rtw_cmd.c
> > index e17332677daa..1b1c47f4a34e 100644
> > --- a/drivers/staging/r8188eu/core/rtw_cmd.c
> > +++ b/drivers/staging/r8188eu/core/rtw_cmd.c
> > @@ -62,8 +62,6 @@ static void c2h_wk_callback(struct work_struct *work);
> > static int _rtw_init_evt_priv(struct evt_priv *pevtpriv)
> > {
> > - int res = _SUCCESS;
> > -
> > /* allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf */
> > atomic_set(&pevtpriv->event_seq, 0);
> > pevtpriv->evt_done_cnt = 0;
> > @@ -72,7 +70,7 @@ static int _rtw_init_evt_priv(struct evt_priv *pevtpriv)
> > pevtpriv->c2h_wk_alive = false;
> > pevtpriv->c2h_queue = rtw_cbuf_alloc(C2H_QUEUE_MAX_LEN + 1);
> > - return res;
> > + return _SUCCESS;
> > }
>
> Shouldn't it return just void then?
>
There is only one caller. It should be folded into the caller and
deleted. Then the caller could be made void.
regards,
dan carpenter
Powered by blists - more mailing lists