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

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

index 9b53b92..ed092fa 100644 (file)
@@ -264,7 +264,7 @@ _next:
                        goto post_process;
                }
 
-               pcmd->cmdsz = _RND4((pcmd->cmdsz));/* _RND4 */
+               pcmd->cmdsz = round_up(pcmd->cmdsz, 4);
 
                memcpy(pcmdbuf, pcmd->parmbuf, pcmd->cmdsz);
 
index 56e5cbf..388c227 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 _RND4(u32 sz)
-{
-       u32     val;
-
-       val = ((sz >> 2) + ((sz & 3) ? 1: 0)) << 2;
-       return val;
-}
-
 static inline u32 _RND8(u32 sz)
 {
        u32     val;