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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux