Re: [PATCH] staging: r8188eu: remove unneeded variable

From: Pavel Skripkin
Date: Tue Nov 09 2021 - 07:24:04 EST


On 11/9/21 15:18, Dan Carpenter wrote:
> 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.


Ah, I see. I've overlooked, that this function name starts with _ and the wrapper just does `return _rtw_init_evt_priv();`. Interesting approach...

I agree, that _rtw_init_evt_priv should be just renamed to rtw_init_evt_priv() and the old wrapper should be just removed



With regards,
Pavel Skripkin