LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Phillip Potter <phil@philpotter.co.uk>
To: gregkh@linuxfoundation.org
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	martin@kaiser.cx, straube.linux@gmail.com,
	Larry.Finger@lwfinger.net
Subject: [PATCH 3/7] staging: r8188eu: remove function _rtw_vmalloc
Date: Thu, 19 Aug 2021 00:48:49 +0100	[thread overview]
Message-ID: <20210818234853.208448-4-phil@philpotter.co.uk> (raw)
In-Reply-To: <20210818234853.208448-1-phil@philpotter.co.uk>

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>
---
 drivers/staging/r8188eu/include/osdep_service.h | 1 -
 drivers/staging/r8188eu/os_dep/osdep_service.c  | 9 +--------
 2 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/staging/r8188eu/include/osdep_service.h b/drivers/staging/r8188eu/include/osdep_service.h
index a9f147cd42fe..4c00adeb72ee 100644
--- a/drivers/staging/r8188eu/include/osdep_service.h
+++ b/drivers/staging/r8188eu/include/osdep_service.h
@@ -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))
 
diff --git a/drivers/staging/r8188eu/os_dep/osdep_service.c b/drivers/staging/r8188eu/os_dep/osdep_service.c
index 6218a9052ee9..800f493f1000 100644
--- a/drivers/staging/r8188eu/os_dep/osdep_service.c
+++ b/drivers/staging/r8188eu/os_dep/osdep_service.c
@@ -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;
-- 
2.31.1


  parent reply	other threads:[~2021-08-18 23:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-18 23:48 [PATCH 0/7] staging: r8188eu: memory allocation cleanup series Phillip Potter
2021-08-18 23:48 ` [PATCH 1/7] staging: r8188eu: convert only rtw_vmalloc call to vmalloc Phillip Potter
2021-08-18 23:48 ` [PATCH 2/7] staging: r8188eu: remove rtw_vmalloc preprocessor definition Phillip Potter
2021-08-18 23:48 ` Phillip Potter [this message]
2021-08-18 23:48 ` [PATCH 4/7] staging: r8188eu: convert all rtw_zvmalloc calls to vzalloc calls Phillip Potter
2021-08-18 23:48 ` [PATCH 5/7] staging: r8188eu: remove rtw_zvmalloc preprocessor definition Phillip Potter
2021-08-18 23:48 ` [PATCH 6/7] staging: r8188eu: remove function _rtw_zvmalloc Phillip Potter
2021-08-18 23:48 ` [PATCH 7/7] staging: r8188eu: remove rtw_update_mem_stat macro and associated flags Phillip Potter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210818234853.208448-4-phil@philpotter.co.uk \
    --to=phil@philpotter.co.uk \
    --cc=Larry.Finger@lwfinger.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=martin@kaiser.cx \
    --cc=straube.linux@gmail.com \
    --subject='Re: [PATCH 3/7] staging: r8188eu: remove function _rtw_vmalloc' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).