staging: r8188eu: refactor rtw_inc_and_chk_continual_urb_error()
Refactor rtw_inc_and_chk_continual_urb_error(). Return directly instead of using a return variable and initialize the variable 'value' at declaration. This shortens the code and improves readability. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220329103756.6740-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b5ea08d84f
commit
0166ffdc89
@@ -27,13 +27,12 @@
|
||||
*/
|
||||
static inline int rtw_inc_and_chk_continual_urb_error(struct dvobj_priv *dvobj)
|
||||
{
|
||||
int ret = false;
|
||||
int value;
|
||||
value = atomic_inc_return(&dvobj->continual_urb_error);
|
||||
if (value > MAX_CONTINUAL_URB_ERR)
|
||||
ret = true;
|
||||
int value = atomic_inc_return(&dvobj->continual_urb_error);
|
||||
|
||||
return ret;
|
||||
if (value > MAX_CONTINUAL_URB_ERR)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user