staging: r8188eu: use round_up() instead of _RND128()
authorMichael Straube <straube.linux@gmail.com>
Thu, 7 Apr 2022 12:57:41 +0000 (14:57 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 7 Apr 2022 17:45:28 +0000 (19:45 +0200)
Use in-kernel round_up() instead of custom _RND128().

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220407125742.7814-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/hal/usb_ops_linux.c
drivers/staging/r8188eu/include/osdep_service.h

index 6a65dcf..d5e6745 100644 (file)
@@ -287,7 +287,7 @@ static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb)
 
                recvframe_put(precvframe, skb_len);
 
-               pkt_offset = (u16)_RND128(pkt_offset);
+               pkt_offset = (u16)round_up(pkt_offset, 128);
 
                if (pattrib->pkt_rpt_type == NORMAL_RX) { /* Normal rx packet */
                        if (pattrib->physt)
index ff44c4a..f6c55f6 100644 (file)
@@ -96,14 +96,6 @@ static inline void flush_signals_thread(void)
 
 #define _RND(sz, r) ((((sz)+((r)-1))/(r))*(r))
 
-static inline u32 _RND128(u32 sz)
-{
-       u32     val;
-
-       val = ((sz >> 7) + ((sz & 127) ? 1: 0)) << 7;
-       return val;
-}
-
 static inline u32 _RND256(u32 sz)
 {
        u32     val;