From patchwork Thu Aug 2 17:29:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geoff Levand X-Patchwork-Id: 952922 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41hHLv6K2Kz9s2g for ; Fri, 3 Aug 2018 03:32:55 +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="3auY0gJZ"; 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 41hHLv4hxnzF277 for ; Fri, 3 Aug 2018 03:32:55 +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="3auY0gJZ"; 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="3auY0gJZ"; 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 41hHHB2WM6zF22V for ; Fri, 3 Aug 2018 03:29:42 +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=3auY0gJZTMsoO9XrasA5j3+zb naZDJqJqmn1lmwR1GJTxvYqRZi3jGFngB69+JbzbEIQSWeGZ+UaACKHnG6WHLvtSEQ+AoppyRr9mM lp6oRhzlcUyakSnlmOjf/DsJOiE/sxqEaxLtHjsLtx1GZLooiRFlDeKudm8GTd8vRyGqZ3rw7CA5B O+jb/CJYydJ1FbrX7G3xRp7IIemhhxrXlbmAxpYSIXjeJvvc3nUq9wqkeynJuxoSKDeM/tFZom+DF DQAjQ9JhhJJNSUqjOvU7nYSOGmu9rMrHVeYaCT0ZeCUuVJpUXwLb4BMp0OrIsDvc1aHJMxEa01Mfj iy2rcldpg==; Received: from geoff by merlin.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1flHPu-0007ZG-LA; Thu, 02 Aug 2018 17:29:38 +0000 Message-Id: <048ee2258797a9d9c102814f06f368ab7bbca4d2.1533230644.git.geoff@infradead.org> In-Reply-To: References: From: Geoff Levand Patch-Date: Thu, 2 Aug 2018 10:19:53 -0700 Subject: [PATCH v2 22/30] discover/powerpc: Add param_name arg To: Samuel Mendoza-Jonas Date: Thu, 02 Aug 2018 17:29:38 +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");