From: Nadav Amit <nadav.amit@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org,
VMware PV-Drivers Reviewers <pv-drivers@vmware.com>,
Arnd Bergmann <arnd@arndb.de>, Nadav Amit <namit@vmware.com>
Subject: [PATCH 3/3] vmw_balloon: open-code vmballoon_compaction_init()
Date: Tue, 13 Sep 2022 02:43:06 -0700 [thread overview]
Message-ID: <20220913094306.317734-4-namit@vmware.com> (raw)
In-Reply-To: <20220913094306.317734-1-namit@vmware.com>
From: Nadav Amit <namit@vmware.com>
Following commit 68f2736a85832 ("mm: Convert all PageMovable users to
movable_operations"), the code of vmballoon_compaction_init() is very
simple and does not worth a separate function.
Instead, open code vmballoon_compaction_init. As migratepage is always
defined, use IS_ENABLED(), which makes the code easier to read. No
functional change is intended.
Signed-off-by: Nadav Amit <namit@vmware.com>
---
drivers/misc/vmw_balloon.c | 26 +++-----------------------
1 file changed, 3 insertions(+), 23 deletions(-)
diff --git a/drivers/misc/vmw_balloon.c b/drivers/misc/vmw_balloon.c
index 762442b9ece8..46212cd09854 100644
--- a/drivers/misc/vmw_balloon.c
+++ b/drivers/misc/vmw_balloon.c
@@ -1848,28 +1848,6 @@ static int vmballoon_migratepage(struct balloon_dev_info *b_dev_info,
return ret;
}
-/**
- * vmballoon_compaction_init() - initialized compaction for the balloon.
- *
- * @b: pointer to the balloon.
- *
- * If during the initialization a failure occurred, this function does not
- * perform cleanup. The caller must call vmballoon_compaction_deinit() in this
- * case.
- *
- * Return: zero on success or error code on failure.
- */
-static __init void vmballoon_compaction_init(struct vmballoon *b)
-{
- b->b_dev_info.migratepage = vmballoon_migratepage;
-}
-
-#else /* CONFIG_BALLOON_COMPACTION */
-static inline void vmballoon_compaction_init(struct vmballoon *b)
-{
-}
-#endif /* CONFIG_BALLOON_COMPACTION */
-
static int __init vmballoon_init(void)
{
int error;
@@ -1909,7 +1887,9 @@ static int __init vmballoon_init(void)
* balloon_devinfo_init() .
*/
balloon_devinfo_init(&balloon.b_dev_info);
- vmballoon_compaction_init(&balloon);
+
+ if (IS_ENABLED(CONFIG_BALLOON_COMPACTION))
+ b->b_dev_info.migratepage = vmballoon_migratepage;
queue_delayed_work(system_freezable_wq, &balloon.dwork, 0);
--
2.25.1
next prev parent reply other threads:[~2022-09-13 18:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-13 9:43 [PATCH 0/3] vmw_balloon: misc fixes and enhancements Nadav Amit
2022-09-13 9:43 ` [PATCH 1/3] vmw_balloon: access reset_required through READ/WRITE_ONCE Nadav Amit
2022-09-13 9:43 ` [PATCH 2/3] vmw_balloon: exit if initalization fails Nadav Amit
2022-09-13 9:43 ` Nadav Amit [this message]
2022-09-14 10:14 ` [PATCH 3/3] vmw_balloon: open-code vmballoon_compaction_init() David Hildenbrand
2022-09-15 0:05 ` kernel test robot
2022-09-15 3:16 ` Nadav Amit
2022-09-16 8:10 ` kernel test robot
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=20220913094306.317734-4-namit@vmware.com \
--to=nadav.amit@gmail.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=namit@vmware.com \
--cc=pv-drivers@vmware.com \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox