aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Straube <straube.linux@gmail.com>2022-03-29 12:37:53 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-04-04 07:33:47 +0200
commitb5ea08d84f2d3a37835688ca713bfa460891c168 (patch)
treea8f92e616fa5ff4f179ebfeae32102cc259af199
parentstaging: r8188eu: use ieee80211 define for fragment number (diff)
downloadlinux-dev-b5ea08d84f2d3a37835688ca713bfa460891c168.tar.xz
linux-dev-b5ea08d84f2d3a37835688ca713bfa460891c168.zip
staging: r8188eu: refactor rtw_usb_bulk_size_boundary()
Using ternary operator to set a variable to true or false is not needed. Convert two such uses of ternary operator in rtw_usb_bulk_size_boundary() to just use the condition and return the value directly instead of using a return variable. This shortens the code and improves readability. While at it, remove an unneeded line break from the function head. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220329103756.6740-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/r8188eu/include/usb_ops.h11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/staging/r8188eu/include/usb_ops.h b/drivers/staging/r8188eu/include/usb_ops.h
index 14526fcff4ae..3416c8baceb6 100644
--- a/drivers/staging/r8188eu/include/usb_ops.h
+++ b/drivers/staging/r8188eu/include/usb_ops.h
@@ -47,19 +47,14 @@ static inline void rtw_reset_continual_urb_error(struct dvobj_priv *dvobj)
#define USB_HIGH_SPEED_BULK_SIZE 512
#define USB_FULL_SPEED_BULK_SIZE 64
-static inline u8 rtw_usb_bulk_size_boundary(struct adapter *padapter,
- int buf_len)
+static inline u8 rtw_usb_bulk_size_boundary(struct adapter *padapter, int buf_len)
{
- u8 rst = true;
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
if (pdvobjpriv->pusbdev->speed == USB_SPEED_HIGH)
- rst = (0 == (buf_len) % USB_HIGH_SPEED_BULK_SIZE) ?
- true : false;
+ return buf_len % USB_HIGH_SPEED_BULK_SIZE == 0;
else
- rst = (0 == (buf_len) % USB_FULL_SPEED_BULK_SIZE) ?
- true : false;
- return rst;
+ return buf_len % USB_FULL_SPEED_BULK_SIZE == 0;
}
#endif /* __USB_OPS_H_ */