From patchwork Tue Mar 22 21:48:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12789272 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 983B3C433F5 for ; Tue, 22 Mar 2022 21:48:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3871F6B019C; Tue, 22 Mar 2022 17:48:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 336696B019D; Tue, 22 Mar 2022 17:48:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 225406B019E; Tue, 22 Mar 2022 17:48:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0175.hostedemail.com [216.40.44.175]) by kanga.kvack.org (Postfix) with ESMTP id 111D46B019C for ; Tue, 22 Mar 2022 17:48:08 -0400 (EDT) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id CA67D8249980 for ; Tue, 22 Mar 2022 21:48:07 +0000 (UTC) X-FDA: 79273360614.31.632BDE7 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf13.hostedemail.com (Postfix) with ESMTP id 52A6B2001D for ; Tue, 22 Mar 2022 21:48:07 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 41C5BB81DAF; Tue, 22 Mar 2022 21:48:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2891C340EC; Tue, 22 Mar 2022 21:48:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1647985685; bh=z4mrUtnlH4ASlAaRrDE7qBye07gqXWEm8RyBeOgfDUg=; h=Date:To:From:In-Reply-To:Subject:From; b=pRCETW4PfGSJG7SNdsnvUnmZ9SbeV6hGwg+H7+R8b0nxEdqFvqHypdVf5nE9IzaTX mAnUkPczsvQTBJeCua8MVUfIza7RQvr4Lq9+T8sobQLyTSV1Op1TraRLpJw3xRvLnb Rk967EdWg+/9meC3yyq2fg8uwWAFcq8C8TO4pnsM= Date: Tue, 22 Mar 2022 14:48:04 -0700 To: linux@treblig.org,akpm@linux-foundation.org,patches@lists.linux.dev,linux-mm@kvack.org,mm-commits@vger.kernel.org,torvalds@linux-foundation.org,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20220322143803.04a5e59a07e48284f196a2f9@linux-foundation.org> Subject: [patch 188/227] mm/page_table_check.c: use strtobool for param parsing Message-Id: <20220322214804.F2891C340EC@smtp.kernel.org> X-Stat-Signature: k651ijebim4a7x9bzfa8c37aoeansizn Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=pRCETW4P; dmarc=none; spf=pass (imf13.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 52A6B2001D X-HE-Tag: 1647985687-572577 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: "Dr. David Alan Gilbert" Subject: mm/page_table_check.c: use strtobool for param parsing Use strtobool rather than open coding "on" and "off" parsing. Link: https://lkml.kernel.org/r/20220227181038.126926-1-linux@treblig.org Signed-off-by: Dr. David Alan Gilbert Signed-off-by: Andrew Morton --- mm/page_table_check.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) --- a/mm/page_table_check.c~mm-use-strtobool-for-param-parsing +++ a/mm/page_table_check.c @@ -23,15 +23,7 @@ EXPORT_SYMBOL(page_table_check_disabled) static int __init early_page_table_check_param(char *buf) { - if (!buf) - return -EINVAL; - - if (strcmp(buf, "on") == 0) - __page_table_check_enabled = true; - else if (strcmp(buf, "off") == 0) - __page_table_check_enabled = false; - - return 0; + return strtobool(buf, &__page_table_check_enabled); } early_param("page_table_check", early_page_table_check_param);