From patchwork Thu Nov 16 09:22:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 119028 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp5359098qgn; Thu, 16 Nov 2017 01:26:09 -0800 (PST) X-Google-Smtp-Source: AGs4zMZie5BT+2PCpmy+OOiPA1R1XonHKSZ+BTmB7XC47plJ47i32IEGZGncLKFYiBTiixvsAP/g X-Received: by 10.80.173.88 with SMTP id z24mr1409766edc.133.1510824369314; Thu, 16 Nov 2017 01:26:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510824369; cv=none; d=google.com; s=arc-20160816; b=Eo7QbAxnXHUEO1nCOGHbstcFOTt8xYW/doACR4UcqRCG3R3Q3OhOgRNuyUP05TqKBz hOE0W35SrdUPT6s5imDIu+FDKqRGZkwsbcTYHtd8yaIQeJcmfsHwu1wy+1GT7GwqVIuq 3/GhQFAenY9c+7iaYZ/D+Ml0AAEFjCOxeONgU5oT1NrmODqkaguYURyFOpWu9jTq5uWm LOff3G95+AW7sHBqzaiZtlX2NFN8u1BTCBpiW4ALdCG7lm45ZjRgjfAxeEuKOSpF6AfR XEmPJopG0Ag0yN9daEEfFLg0ZlQtySeDsJrG4wRnQmnlYbewYe0m7C1/PxLg/Co+BDs+ eAPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:arc-authentication-results; bh=BD3V/Zd4cSuhsMe6/Pt4Vng/TBWgWvy7DbA9a5CgMwg=; b=EQNFxHgR1xXNpQeN+Qiv0KTKiu9C3quifpnbgPT5nzX4g2q0Sy4JPEcEKEAwJAdw/v v22+SSxJyT+Sr3lITTDVqLGTKOnzwjcvhzsYJwMd7jiiAra2+4nM6k6eoePOJKzOCX94 EPjdh181UvCFddn8HIAoFcofP4T6q3oFosudht3aAeipTUki4/4UB9k1hwnySSFmsQlR VR4xQdHiXAllZJAZDT34bT8V91CIN8/6sUUqYI5v49ikWaGt0wTslO9dHitASMa447fJ t8OVujHVXWPTpyUXlmXHlKYRbckvB5/kka0niUnDSta9KCWpM/6rUCkBeO+OU/F1qT/s 6FGA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id n88si828197edc.498.2017.11.16.01.26.09; Thu, 16 Nov 2017 01:26:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id EB105C21DDA; Thu, 16 Nov 2017 09:23:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 89289C21D90; Thu, 16 Nov 2017 09:23:12 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 9A03FC21D8D; Thu, 16 Nov 2017 09:22:53 +0000 (UTC) Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by lists.denx.de (Postfix) with ESMTP id 76AFEC21D99 for ; Thu, 16 Nov 2017 09:22:49 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 694162093B; Thu, 16 Nov 2017 10:22:48 +0100 (CET) Received: from localhost (unknown [185.94.189.187]) by mail.free-electrons.com (Postfix) with ESMTPSA id 1650D20DD4; Thu, 16 Nov 2017 10:22:38 +0100 (CET) From: Maxime Ripard To: Tom Rini Date: Thu, 16 Nov 2017 10:22:24 +0100 Message-Id: <20171116092231.27740-4-maxime.ripard@free-electrons.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171116092231.27740-1-maxime.ripard@free-electrons.com> References: <20171116092231.27740-1-maxime.ripard@free-electrons.com> Cc: Andre Przywara , agraf@suse.de, u-boot@lists.denx.de, Maxime Ripard , Jagan Teki Subject: [U-Boot] [RFC PATCH 03/10] env: Rename env_driver_lookup_default and env_get_default_location X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The env_driver_lookup_default and env_get_default_location functions are about to get refactored to support loading from multiple environment. The name is therefore not really well suited anymore. Drop the default part to be a bit more relevant. Signed-off-by: Maxime Ripard Reviewed-by: Lukasz Majewski --- env/env.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/env/env.c b/env/env.c index 094538ff5b62..97ada5b5a6fd 100644 --- a/env/env.c +++ b/env/env.c @@ -10,7 +10,7 @@ DECLARE_GLOBAL_DATA_PTR; -static struct env_driver *env_driver_lookup(enum env_location loc) +static struct env_driver *_env_driver_lookup(enum env_location loc) { struct env_driver *drv; const int n_ents = ll_entry_count(struct env_driver, env_driver); @@ -26,7 +26,7 @@ static struct env_driver *env_driver_lookup(enum env_location loc) return NULL; } -static enum env_location env_get_default_location(void) +static enum env_location env_get_location(void) { if IS_ENABLED(CONFIG_ENV_IS_IN_EEPROM) return ENVL_EEPROM; @@ -52,12 +52,12 @@ static enum env_location env_get_default_location(void) return ENVL_UNKNOWN; } -static struct env_driver *env_driver_lookup_default(void) +static struct env_driver *env_driver_lookup(void) { - enum env_location loc = env_get_default_location(); + enum env_location loc = env_get_location(); struct env_driver *drv; - drv = env_driver_lookup(loc); + drv = _env_driver_lookup(loc); if (!drv) { debug("%s: No environment driver for location %d\n", __func__, loc); @@ -69,7 +69,7 @@ static struct env_driver *env_driver_lookup_default(void) int env_get_char(int index) { - struct env_driver *drv = env_driver_lookup_default(); + struct env_driver *drv = env_driver_lookup(); int ret; if (gd->env_valid == ENV_INVALID) @@ -89,7 +89,7 @@ int env_get_char(int index) int env_load(void) { - struct env_driver *drv = env_driver_lookup_default(); + struct env_driver *drv = env_driver_lookup(); int ret = 0; if (!drv) @@ -108,7 +108,7 @@ int env_load(void) int env_save(void) { - struct env_driver *drv = env_driver_lookup_default(); + struct env_driver *drv = env_driver_lookup(); int ret; if (!drv) @@ -129,7 +129,7 @@ int env_save(void) int env_init(void) { - struct env_driver *drv = env_driver_lookup_default(); + struct env_driver *drv = env_driver_lookup(); int ret = -ENOENT; if (!drv)