staging: r8188eu: remove function _rtw_vmalloc
authorPhillip Potter <phil@philpotter.co.uk>
Wed, 18 Aug 2021 23:48:49 +0000 (00:48 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Aug 2021 05:42:57 +0000 (07:42 +0200)
Remove the function _rtw_vmalloc from os_dep/osdep_service.c, converting
its only user (also in os_dep/osdep_service.c) to use plain vmalloc.
This function is just an inline wrapper around vmalloc which returns a u8
pointer, which isn't needed. Also remove the declaration from
include/osdep_service.h.

It is considered generally bad practice to declare functions as inline in
the majority of cases, as not only can this qualifier be ignored by the
compiler but the compiler generally makes good decisions about inlining
anyway.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210818234853.208448-4-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/include/osdep_service.h
drivers/staging/r8188eu/os_dep/osdep_service.c

index a9f147cd42fe41b69433fabc6ba911090a5ffab4..4c00adeb72eeb662c03a3cb5ebc626ae5bf4d879 100644 (file)
@@ -171,7 +171,6 @@ extern unsigned char WPA_TKIP_CIPHER[4];
 extern unsigned char RSN_TKIP_CIPHER[4];
 
 #define rtw_update_mem_stat(flag, sz) do {} while (0)
-u8 *_rtw_vmalloc(u32 sz);
 u8 *_rtw_zvmalloc(u32 sz);
 #define rtw_zvmalloc(sz)                       _rtw_zvmalloc((sz))
 
index 6218a9052ee9064767db662fe03ca6dfbbd48029..800f493f100061f35357ed873696a8fd5e548f51 100644 (file)
@@ -36,17 +36,10 @@ u32 rtw_atoi(u8 *s)
        return num;
 }
 
-inline u8 *_rtw_vmalloc(u32 sz)
-{
-       u8      *pbuf;
-       pbuf = vmalloc(sz);
-       return pbuf;
-}
-
 inline u8 *_rtw_zvmalloc(u32 sz)
 {
        u8      *pbuf;
-       pbuf = _rtw_vmalloc(sz);
+       pbuf = vmalloc(sz);
        if (pbuf)
                memset(pbuf, 0, sz);
        return pbuf;