From patchwork Tue Jul 24 22:15:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geoff Levand X-Patchwork-Id: 948892 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41Zt6q317Pz9s2g for ; Wed, 25 Jul 2018 08:18:43 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="tSBtmd4u"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41Zt6q1RQczDrdc for ; Wed, 25 Jul 2018 08:18:43 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="tSBtmd4u"; dkim-atps=neutral X-Original-To: Petitboot@lists.ozlabs.org Delivered-To: Petitboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (mailfrom) smtp.mailfrom=infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=geoff@infradead.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="tSBtmd4u"; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41Zt3R3HVRzDrnp for ; Wed, 25 Jul 2018 08:15:47 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Date:Cc:To:Subject:From:References: In-Reply-To:Message-Id:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=72yIn2a3b1rfxyQ8JWHII1cK+3K0ZgNLGpTLE0aHQMM=; b=tSBtmd4uL1tjNOOrSeQWX0N8E 2/WMtXfq3IK5LwYYt0Of7ks4o9O89YfwTnjv1xOHNYxb6e3yCnuOMgdnSugjIvmAW8KfGVJEWP13P jitm+FAf0qmfadOt9MTKYqaIMD1KEUwqAHfQ0L9QloLBuGA/WKm9RJwzXDrNsTmNW0p7f1ciMXbZF i6sAN+YTeOW2HaW3J9qAlaYQYRbNmMsYN+PqiBu83QW4vDHCQaaAO9GvBcO4lkHL15/iMOwtDRHUT QWkolWHw263o7dMpywikaL2tGFSMOIKvXZXsw6JiwPfsrY67uDfiLyaPoVxfPKMy+vKB+e3pUgGMH 4w41RzcaQ==; Received: from geoff by merlin.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fi5ap-0004lS-Cc; Tue, 24 Jul 2018 22:15:43 +0000 Message-Id: <976f547781bb7d839e877657659a85d36a2864b3.1532469861.git.geoff@infradead.org> In-Reply-To: References: From: Geoff Levand Patch-Date: Tue, 24 Jul 2018 15:03:16 -0700 Subject: [PATCH v1 21/30] discover/powerpc: Add param_name arg To: Samuel Mendoza-Jonas Date: Tue, 24 Jul 2018 22:15:43 +0000 X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ge Song , Petitboot@lists.ozlabs.org MIME-Version: 1.0 Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" Update update_network_config and update_bootdev_config to operate on a generic parameter name passed as an argument. Signed-off-by: Geoff Levand --- discover/platform-powerpc.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/discover/platform-powerpc.c b/discover/platform-powerpc.c index c7432fb..87ff72e 100644 --- a/discover/platform-powerpc.c +++ b/discover/platform-powerpc.c @@ -609,7 +609,7 @@ static void update_string_config(struct platform_powerpc *platform, } static void update_network_config(struct platform_powerpc *platform, - struct config *config) + const char *param_name, const struct config *config) { unsigned int i; char *val; @@ -642,13 +642,13 @@ static void update_network_config(struct platform_powerpc *platform, talloc_free(dns_str); } - update_string_config(platform, "petitboot,network", val); + update_string_config(platform, param_name, val); talloc_free(val); } static void update_bootdev_config(struct platform_powerpc *platform, - struct config *config) + const char *param_name, const struct config *config) { char *val = NULL, *boot_str = NULL, *tmp = NULL; struct autoboot_option *opt; @@ -674,7 +674,7 @@ static void update_bootdev_config(struct platform_powerpc *platform, tmp = val = talloc_asprintf_append(val, "%s", boot_str); } - update_string_config(platform, "petitboot,bootdevs", val); + update_string_config(platform, param_name, val); talloc_free(tmp); if (boot_str) talloc_free(boot_str); @@ -721,9 +721,9 @@ static void update_config(struct platform_powerpc *platform, val = config->https_proxy ?: ""; update_string_config(platform, "petitboot,https_proxy", val); - update_network_config(platform, config); + update_network_config(platform, "petitboot,network", config); - update_bootdev_config(platform, config); + update_bootdev_config(platform, "petitboot,bootdevs", config); } static void set_ipmi_bootdev(struct config *config, enum ipmi_bootdev bootdev, @@ -1071,7 +1071,7 @@ static void get_ipmi_network_override(struct platform_powerpc *platform, if (!rc && persistent) { /* Write this new config to NVRAM */ - update_network_config(platform, config); + update_network_config(platform, "petitboot,network", config); rc = write_nvram(platform); if (rc) pb_log("platform: Failed to save persistent interface override\n");