Message ID | 20190930144112.175618-10-sjg@chromium.org |
---|---|
State | Changes Requested |
Delegated to: | Tom Rini |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="FxvnafN7"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46hltX3Vjgz9s7T for <incoming@patchwork.ozlabs.org>; Tue, 1 Oct 2019 00:59:48 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 27BDCC21E73; Mon, 30 Sep 2019 14:45:35 +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=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID 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 71E5AC21E3A; Mon, 30 Sep 2019 14:41:48 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 0B7A6C21E42; Mon, 30 Sep 2019 14:41:31 +0000 (UTC) Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) by lists.denx.de (Postfix) with ESMTPS id 82456C21E08 for <u-boot@lists.denx.de>; Mon, 30 Sep 2019 14:41:27 +0000 (UTC) Received: by mail-io1-f67.google.com with SMTP id n197so38885671iod.9 for <u-boot@lists.denx.de>; Mon, 30 Sep 2019 07:41:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cNKd/t4z8o5nxwBrM81d9dUEKocazY1k3lhPEkOx8Fw=; b=FxvnafN7uOvz873zqNoUaMxkOvSQse50UukzGxqWyVW01NjMBLqDsvsf/9RfWosJUp WTvVrhIYCU1IeZyDpa1r2D0ueFFEfDbKk0skAkmgpawvylN/U0Y0Szs9SDGkV0r15KJF jVQdpXZi1k6KzNouQuiDOuIadInxDi6FwLisU= 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=cNKd/t4z8o5nxwBrM81d9dUEKocazY1k3lhPEkOx8Fw=; b=k+PUvuBVMUDzL42PuJBEIUWirnqoVTUATWQplqJt1D624LLsuQioaEQPIO1TYAUxDY OnQ4NGJVOvqjpbHZ3VZFD4lSYLW2DsDTLUC0rwRnA3bffqi6aycvdGth7IYCijQyhVal 5w+D8YziKf9bYYlKawzVnkeoolWQWx6dv+v0QM7l4r0lAJqu9jI/bmnnVnfYlzMm40MG zNS6PGo13e4114ci2F+qVO9V/mLGlL6XTJRVkC0Ozvvf2xBZvmSrP4q9dNjWDXmgASdo Sdu1ra46SaMCOYcem5ZxA0lnyd5OstbRyta8tr897LdcJPV1iAYcLJjEwc8TVm82S+O7 6bsQ== X-Gm-Message-State: APjAAAVjgYoeL0t07jzKgj3frLcxBobAL3PsjymXDKQUQCrY/6qpN1gw vsYGJHwOdA2Rf179QkjfQt+WWXrZwqU= X-Google-Smtp-Source: APXvYqxCGUG3rO6Zl89VC8eHk0xn99vrmegMrUOZ/tDukbLMvlO21kAuO1cXEkDqBF3BLpnwSI9GqA== X-Received: by 2002:a02:1ac5:: with SMTP id 188mr19305777jai.71.1569854486329; Mon, 30 Sep 2019 07:41:26 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id c4sm5892885ioa.70.2019.09.30.07.41.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2019 07:41:26 -0700 (PDT) From: Simon Glass <sjg@chromium.org> To: U-Boot Mailing List <u-boot@lists.denx.de> Date: Mon, 30 Sep 2019 08:40:40 -0600 Message-Id: <20190930144112.175618-10-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.444.g18eeb5a265-goog In-Reply-To: <20190930144112.175618-1-sjg@chromium.org> References: <20190930144112.175618-1-sjg@chromium.org> MIME-Version: 1.0 Cc: Tom Rini <trini@konsulko.com> Subject: [U-Boot] [PATCH 09/41] spl: bootcount: Move code out of header file X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <http://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> |
Series |
common: Further reduce common.h
|
expand
|
diff --git a/common/spl/spl.c b/common/spl/spl.c index 7a443a0f322..6e3d4bd599d 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -790,3 +790,14 @@ ulong spl_relocate_stack_gd(void) return 0; #endif } + +#if defined(CONFIG_BOOTCOUNT_LIMIT) && !defined(CONFIG_SPL_BOOTCOUNT_LIMIT) +void bootcount_store(ulong a) +{ +} + +ulong bootcount_load(void) +{ + return 0; +} +#endif diff --git a/include/bootcount.h b/include/bootcount.h index 8fa8cf82181..a26a3852338 100644 --- a/include/bootcount.h +++ b/include/bootcount.h @@ -127,10 +127,6 @@ static inline void bootcount_inc(void) #endif /* !CONFIG_SPL_BUILD */ } -#if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_SPL_BOOTCOUNT_LIMIT) -void bootcount_store(ulong a) {}; -ulong bootcount_load(void) { return 0; } -#endif /* CONFIG_SPL_BUILD && !CONFIG_SPL_BOOTCOUNT_LIMIT */ #else static inline int bootcount_error(void) { return 0; } static inline void bootcount_inc(void) {}
It is not good practice to write code in a header file. If it is included multiple times then the code can cause duplicate functions. Move the bootcount_store() and bootcount_load() functions into SPL. Note: bootcount is a bit strange in that it uses driver model but does not define proper drivers. This should be fixed. Signed-off-by: Simon Glass <sjg@chromium.org> --- common/spl/spl.c | 11 +++++++++++ include/bootcount.h | 4 ---- 2 files changed, 11 insertions(+), 4 deletions(-)