From patchwork Fri Jan 31 06:17:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 11359355 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A210F139A for ; Fri, 31 Jan 2020 06:17:20 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6E8852082E for ; Fri, 31 Jan 2020 06:17:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="Z3NhXnRJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6E8852082E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AC4C66B059B; Fri, 31 Jan 2020 01:17:18 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id A4E166B059D; Fri, 31 Jan 2020 01:17:18 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 989526B059E; Fri, 31 Jan 2020 01:17:18 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0231.hostedemail.com [216.40.44.231]) by kanga.kvack.org (Postfix) with ESMTP id 7EDFB6B059B for ; Fri, 31 Jan 2020 01:17:18 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 23849180AD802 for ; Fri, 31 Jan 2020 06:17:18 +0000 (UTC) X-FDA: 76436922156.19.oven84_3fb5b0d1baa1a X-Spam-Summary: 2,0,0,405ef8e4fb46a73a,d41d8cd98f00b204,akpm@linux-foundation.org,:akpm@linux-foundation.org:cmetcalf@tilera.com:krzysiek@podlesie.net::mm-commits@vger.kernel.org:nivedita@alum.mit.edu:torvalds@linux-foundation.org,RULES_HIT:41:355:379:800:960:967:968:973:988:989:1260:1263:1345:1359:1381:1431:1437:1534:1542:1711:1730:1747:1777:1792:2393:2525:2559:2563:2682:2685:2859:2902:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3353:3865:3866:3867:3870:3871:3872:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4250:4321:4419:4605:5007:6261:6653:7576:7875:7903:8599:8660:9025:9545:10004:10913:11026:11473:11658:11914:12043:12048:12294:12297:12438:12517:12519:12555:12679:12783:12986:13148:13230:13255:14093:14181:14721:14849:21080:21212:21451:21627:21939:21990:30054:30070:30079,0,RBL:error,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: oven84_3fb5b0d1baa1a X-Filterd-Recvd-Size: 4172 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf25.hostedemail.com (Postfix) with ESMTP for ; Fri, 31 Jan 2020 06:17:17 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C9EA42253D; Fri, 31 Jan 2020 06:17:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580451437; bh=BwtOY7fetOwUcwTpXa5VM9g8hUjrkAa+5GhWmNYfIhc=; h=Date:From:To:Subject:In-Reply-To:From; b=Z3NhXnRJaIO/uKPY7vPK9oxRFR3VnYH3vB1xPwLbZSfEFwX7K4Igp7xZdCniPf9wA g0slpR0f3VlgUk9xem06HpuECme0jSGPyxgREeYoy7P8S/tIfDTKFExgRZKynBMeNg CAuclgtU5tgvGOaMwOz7EasNa0cGq0KD3V9q+WH8= Date: Thu, 30 Jan 2020 22:17:16 -0800 From: Andrew Morton To: akpm@linux-foundation.org, cmetcalf@tilera.com, krzysiek@podlesie.net, linux-mm@kvack.org, mm-commits@vger.kernel.org, nivedita@alum.mit.edu, torvalds@linux-foundation.org Subject: [patch 112/118] init/main.c: remove unnecessary repair_env_string in do_initcall_level Message-ID: <20200131061716.ric_8Equn%akpm@linux-foundation.org> In-Reply-To: <20200130221021.5f0211c56346d5485af07923@linux-foundation.org> User-Agent: s-nail v14.8.16 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: Arvind Sankar Subject: init/main.c: remove unnecessary repair_env_string in do_initcall_level Since commit 08746a65c296 ("init: fix in-place parameter modification regression"), parse_args in do_initcall_level is called on a copy of saved_command_line. It is unnecessary to call repair_env_string during this parsing, as this copy is not used for anything later. Remove the now unnecessary arguments from repair_env_string as well. Link: http://lkml.kernel.org/r/20191212180023.24339-3-nivedita@alum.mit.edu Signed-off-by: Arvind Sankar Cc: Krzysztof Mazur Cc: Chris Metcalf Signed-off-by: Andrew Morton --- init/main.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) --- a/init/main.c~init-mainc-remove-unnecessary-repair_env_string-in-do_initcall_level +++ a/init/main.c @@ -246,8 +246,7 @@ static int __init loglevel(char *str) early_param("loglevel", loglevel); /* Change NUL term back to "=", to make "param" the whole string. */ -static int __init repair_env_string(char *param, char *val, - const char *unused, void *arg) +static void __init repair_env_string(char *param, char *val) { if (val) { /* param=val or param="val"? */ @@ -260,7 +259,6 @@ static int __init repair_env_string(char } else BUG(); } - return 0; } /* Anything after -- gets handed straight to init. */ @@ -272,7 +270,7 @@ static int __init set_init_arg(char *par if (panic_later) return 0; - repair_env_string(param, val, unused, NULL); + repair_env_string(param, val); for (i = 0; argv_init[i]; i++) { if (i == MAX_INIT_ARGS) { @@ -292,7 +290,7 @@ static int __init set_init_arg(char *par static int __init unknown_bootoption(char *param, char *val, const char *unused, void *arg) { - repair_env_string(param, val, unused, NULL); + repair_env_string(param, val); /* Handle obsolete-style parameters */ if (obsolete_checksetup(param)) @@ -991,6 +989,12 @@ static const char *initcall_level_names[ "late", }; +static int __init ignore_unknown_bootoption(char *param, char *val, + const char *unused, void *arg) +{ + return 0; +} + static void __init do_initcall_level(int level) { initcall_entry_t *fn; @@ -1000,7 +1004,7 @@ static void __init do_initcall_level(int initcall_command_line, __start___param, __stop___param - __start___param, level, level, - NULL, &repair_env_string); + NULL, ignore_unknown_bootoption); trace_initcall_level(initcall_level_names[level]); for (fn = initcall_levels[level]; fn < initcall_levels[level+1]; fn++)