+ use-existing-helper-to-convert-on-off-to-boolean.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: mm: use existing helper to convert "on"/"off" to boolean
has been added to the -mm tree.  Its filename is
     use-existing-helper-to-convert-on-off-to-boolean.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/use-existing-helper-to-convert-on-off-to-boolean.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/use-existing-helper-to-convert-on-off-to-boolean.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Minfei Huang <mnghuan@xxxxxxxxx>
Subject: mm: use existing helper to convert "on"/"off" to boolean

It's more convenient to use existing function helper to convert string
"on/off" to boolean.

Link: http://lkml.kernel.org/r/1461908824-16129-1-git-send-email-mnghuan@xxxxxxxxx
Signed-off-by: Minfei Huang <mnghuan@xxxxxxxxx>
Acked-by: Michal Hocko <mhocko@xxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/page_alloc.c  |    9 +--------
 mm/page_poison.c |    8 +-------
 2 files changed, 2 insertions(+), 15 deletions(-)

diff -puN mm/page_alloc.c~use-existing-helper-to-convert-on-off-to-boolean mm/page_alloc.c
--- a/mm/page_alloc.c~use-existing-helper-to-convert-on-off-to-boolean
+++ a/mm/page_alloc.c
@@ -613,14 +613,7 @@ static int __init early_debug_pagealloc(
 {
 	if (!buf)
 		return -EINVAL;
-
-	if (strcmp(buf, "on") == 0)
-		_debug_pagealloc_enabled = true;
-
-	if (strcmp(buf, "off") == 0)
-		_debug_pagealloc_enabled = false;
-
-	return 0;
+	return kstrtobool(buf, &_debug_pagealloc_enabled);
 }
 early_param("debug_pagealloc", early_debug_pagealloc);
 
diff -puN mm/page_poison.c~use-existing-helper-to-convert-on-off-to-boolean mm/page_poison.c
--- a/mm/page_poison.c~use-existing-helper-to-convert-on-off-to-boolean
+++ a/mm/page_poison.c
@@ -13,13 +13,7 @@ static int early_page_poison_param(char
 {
 	if (!buf)
 		return -EINVAL;
-
-	if (strcmp(buf, "on") == 0)
-		want_page_poisoning = true;
-	else if (strcmp(buf, "off") == 0)
-		want_page_poisoning = false;
-
-	return 0;
+	return strtobool(buf, &want_page_poisoning);
 }
 early_param("page_poison", early_page_poison_param);
 
_

Patches currently in -mm which might be from mnghuan@xxxxxxxxx are

use-existing-helper-to-convert-on-off-to-boolean.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux