Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1124759ybl; Thu, 12 Dec 2019 10:01:20 -0800 (PST) X-Google-Smtp-Source: APXvYqwZZPO3oPmnw2PkiWl7RmhtOPwz6nCuDOfdCaCSPydYMnoPfvPBijMXiFn9SEJW5pnB1oWB X-Received: by 2002:a9d:12ea:: with SMTP id g97mr9743238otg.105.1576173680032; Thu, 12 Dec 2019 10:01:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576173680; cv=none; d=google.com; s=arc-20160816; b=GcLmMyAsa9bJoGLlxGvhWfNPqIqi/uIIvpxsG71Qqe9DhbaEI5U00zoAOC0rM0zAeG m751VTJIE75qkJliCFbWTznwDORWZ3TfjAbZDcbK3W7kgsx7xIsN39KCTfOQuSPUD/2Q 0zIhZl77cEWYfmhI81KfaprDxaOAsoyjXKI+oHwUV0/e079MAvsiqByRIdMur9G6jK3U YYw2lf6LpF5KWKoUYTqwNsv9XlTq1ttTzVL9/ZsRD4P/v7/B4BhmqQgUsQPRxlWH01IX feaSvqdiLZN3Df9Tda2d0WJlN5zBZd8u6+zUanvcXsA2d3kzGZDDk2gD4QuN/5dqVcs4 XCmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=LIz5NrqH1ej4Iy+bT6fVc5ps2O6rp6v/Upl0mdghbT8=; b=QSoCuKIdqG1yX7rgHR4q+CdAH0JC/ptLCNcvlCyXqZZIveM6aii7TPkroOrRX/2NJp aksQZbwzg6/i5bVEghWgaTi+DA99hOZm6DTgpEJ4CwZeGLsmQmmQBqeUOHubvTAwPN7y OMyGVPAtFf3hWkZSqYeriY6NZBS4y+oFeUsHXFV9ylJQBMkYpWyatc+oLCP3nor12dur W3XAK3pHA3z6vNptor9Y2kQjgA6ti/hI18SMx40P5qRk3srIJsR/wxTrXGe4a/AvNsaW dRP1TonjoCLlOXtA4tVYUh89V4kwTx0ocv2DHoEQS11f8tY6foEU4cC9lcSa5AxIh7mV y/Mg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5si3484832ote.187.2019.12.12.10.01.05; Thu, 12 Dec 2019 10:01:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730278AbfLLSA3 (ORCPT + 99 others); Thu, 12 Dec 2019 13:00:29 -0500 Received: from mail-qv1-f66.google.com ([209.85.219.66]:46983 "EHLO mail-qv1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730023AbfLLSA1 (ORCPT ); Thu, 12 Dec 2019 13:00:27 -0500 Received: by mail-qv1-f66.google.com with SMTP id t9so1293250qvh.13 for ; Thu, 12 Dec 2019 10:00:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LIz5NrqH1ej4Iy+bT6fVc5ps2O6rp6v/Upl0mdghbT8=; b=oSoasHRuDqiE7PFiDZ9EIKccIjUqhwVNIx2nAMSwgNlTKCu8zGLwNDWMGhQs6Wix+q B3IExuHFRxouYc64S0y5Pp7fhAKu+7q1kYcD2E+IKFeWmvQCZt2is4xh71b4tJkFJcSJ 8yRXBBpLwBaCKLoppEcVNZJx43kl7Tq6hsx/XWU3YEaZ6IZFfu2AXXL8GM7qiybsPpux 1cjFgzjp4pdyzudtlgm6ol7cY+PyRxtvuFl44MzKB61t9jegwQZJW6By4OBt9VHaZVjq ihr/udlovkzxxkIo8AVmTuONokEsPmdYMHME5loT/CyJpIf8uY0WFY3o03Wt8z9B7f75 iuFQ== X-Gm-Message-State: APjAAAV9UG8JYRzCn1mbvJOnUF7S5ZbKUvyflb9Z+x01Ujd+MaYboele mHoZOwNNnmZ/kW3K2x6rJIb1RCVZ X-Received: by 2002:a0c:b502:: with SMTP id d2mr7995940qve.110.1576173626502; Thu, 12 Dec 2019 10:00:26 -0800 (PST) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id j7sm1946037qkd.46.2019.12.12.10.00.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Dec 2019 10:00:25 -0800 (PST) From: Arvind Sankar To: Andrew Morton , Linus Torvalds Cc: linux-kernel@vger.kernel.org Subject: [PATCH v2 2/3] init/main.c: remove unnecessary repair_env_string in do_initcall_level Date: Thu, 12 Dec 2019 13:00:22 -0500 Message-Id: <20191212180023.24339-3-nivedita@alum.mit.edu> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191212180023.24339-1-nivedita@alum.mit.edu> References: <20191123214039.139275-1-nivedita@alum.mit.edu> <20191212180023.24339-1-nivedita@alum.mit.edu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Arvind Sankar --- init/main.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/init/main.c b/init/main.c index 4ebf4346a44c..a1febc3de582 100644 --- a/init/main.c +++ b/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 *param, char *val, } else BUG(); } - return 0; } /* Anything after -- gets handed straight to init. */ @@ -272,7 +270,7 @@ static int __init set_init_arg(char *param, char *val, 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 *param, char *val, 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)) @@ -990,6 +988,12 @@ static const char *initcall_level_names[] __initdata = { "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; @@ -999,7 +1003,7 @@ static void __init do_initcall_level(int level) 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++) -- 2.23.0