public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/page_alloc.c: Remove function return value
@ 2022-12-29  7:17 lvqian
  2022-12-29  7:54 ` Baoquan He
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: lvqian @ 2022-12-29  7:17 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, lvqian

From: lvqian <lvqian@nfschina.com>

The return value of this function has no meaning,
so the original int type is replaced with a void type,
which reduces the execution time of one return.

Signed-off-by: lvqian <lvqian@nfschina.com>
---
 mm/page_alloc.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 0745aedebb37..fffe16d854a9 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -828,17 +828,16 @@ static int __init early_debug_pagealloc(char *buf)
 }
 early_param("debug_pagealloc", early_debug_pagealloc);
 
-static int __init debug_guardpage_minorder_setup(char *buf)
+static void __init debug_guardpage_minorder_setup(char *buf)
 {
 	unsigned long res;
 
 	if (kstrtoul(buf, 10, &res) < 0 ||  res > MAX_ORDER / 2) {
 		pr_err("Bad debug_guardpage_minorder value\n");
-		return 0;
+	} else {
+		_debug_guardpage_minorder = res;
+		pr_info("Setting debug_guardpage_minorder to %lu\n", res);
 	}
-	_debug_guardpage_minorder = res;
-	pr_info("Setting debug_guardpage_minorder to %lu\n", res);
-	return 0;
 }
 early_param("debug_guardpage_minorder", debug_guardpage_minorder_setup);
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [PATCH] mm/page_alloc.c: Remove function return value
@ 2022-12-29  7:13 lvqian
  0 siblings, 0 replies; 5+ messages in thread
From: lvqian @ 2022-12-29  7:13 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, lvqian

From: lvqian <lvqian@nfschina.com>

The return value of this function has no meaning, 
so the original bool type is replaced with a void type, 
which reduces the execution time of one return.

Signed-off-by: lvqian <lvqian@nfschina.com>
---
 mm/page_alloc.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 0745aedebb37..5304bd5d2f6c 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -834,11 +834,10 @@ static int __init debug_guardpage_minorder_setup(char *buf)
 
 	if (kstrtoul(buf, 10, &res) < 0 ||  res > MAX_ORDER / 2) {
 		pr_err("Bad debug_guardpage_minorder value\n");
-		return 0;
+	} else {
+		_debug_guardpage_minorder = res;
+		pr_info("Setting debug_guardpage_minorder to %lu\n", res);
 	}
-	_debug_guardpage_minorder = res;
-	pr_info("Setting debug_guardpage_minorder to %lu\n", res);
-	return 0;
 }
 early_param("debug_guardpage_minorder", debug_guardpage_minorder_setup);
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-12-29 12:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-29  7:17 [PATCH] mm/page_alloc.c: Remove function return value lvqian
2022-12-29  7:54 ` Baoquan He
2022-12-29 11:53 ` kernel test robot
2022-12-29 12:34 ` kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2022-12-29  7:13 lvqian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox