From patchwork Thu Nov 14 19:57:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1195188 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) 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="MDOQN9hS"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 47DXjZ2Xzcz9s7T for ; Fri, 15 Nov 2019 07:13:21 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id BA4C1C21C4A; Thu, 14 Nov 2019 20:01:54 +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 53621C21E35; Thu, 14 Nov 2019 19:58:32 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 04BBAC21D9A; Thu, 14 Nov 2019 19:58:31 +0000 (UTC) Received: from mail-io1-f66.google.com (mail-io1-f66.google.com [209.85.166.66]) by lists.denx.de (Postfix) with ESMTPS id 18D8FC21DD7 for ; Thu, 14 Nov 2019 19:58:17 +0000 (UTC) Received: by mail-io1-f66.google.com with SMTP id k1so8223568ioj.6 for ; Thu, 14 Nov 2019 11:58:17 -0800 (PST) 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=K8bAJJWrzRnt8uR6si03Y/TRL7VwAMnDEU/NHdH+TQI=; b=MDOQN9hSzpVEhb2oamUqm1oX2m4n7ou2NifIYWDtgHf+v7aRW4t8V526FViAt45Saf FV95CFqB2Ohw8YPlvZtRCY+DILXQ2CjEQ/0hkeYTqCOl7kM/RSWcLwTIERo6UdyjjPfI c/YD4FMgGOjzr47LZj7185MDJXSnx9OD2apOA= 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=K8bAJJWrzRnt8uR6si03Y/TRL7VwAMnDEU/NHdH+TQI=; b=oofQ0O9cLuMeHUZUslTuUEJGZXrIC1DR0of7UsAB3l9N6SIhIB9SVxRjVxL3kPtil8 U4wtE6FD2Ff2XlWryFXqY072HOUGM1p7afOktTE+kldjHhaI3/oYvZrQHHv+bazlLVW+ jh6NPCFXMpNi3WO+4zMLgv+1i4JA35yU72Eh00dwpbvL4GItsTBaaJJweIxttYqjDWG4 ajtvbRMFIxQSHHv4ULAzXZlbFwfhenniyEMtssx4u13Jps2sn4iEyu10kiaLjAbpS/x2 jEq3tBeiA3QBdlIJe7sEtDKb9qRNJ1xqsPw+s+xmMuN3i8xq40Fqq+6d4NDmB42EGAiP 1mTw== X-Gm-Message-State: APjAAAVpQBJZhB+zTlgruYWBUoc0CVeZ6WiUEFrECeocIj4ABfhgRUpI zJrvqtQw4MGlmyKHIYtH6YARAxtxqaA= X-Google-Smtp-Source: APXvYqz2oXriyg3sMNi7ILEiRCUwWKZKNIPZqiZS7cwORRv0Vc9cBRzF/XjJFEfgq+m5Y/aBEDQOyw== X-Received: by 2002:a5e:c241:: with SMTP id w1mr50355iop.274.1573761495742; Thu, 14 Nov 2019 11:58:15 -0800 (PST) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id c83sm652546iof.48.2019.11.14.11.58.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Nov 2019 11:58:15 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Date: Thu, 14 Nov 2019 12:57:17 -0700 Message-Id: <20191114195751.30357-2-sjg@chromium.org> X-Mailer: git-send-email 2.24.0.rc1.363.gb1bccd3e3d-goog In-Reply-To: <20191114195751.30357-1-sjg@chromium.org> References: <20191114195751.30357-1-sjg@chromium.org> MIME-Version: 1.0 Cc: Tom Rini Subject: [U-Boot] [PATCH v4 09/42] 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 Reviewed-by: Tom Rini --- Changes in v4: None Changes in v3: None Changes in v2: None common/spl/spl.c | 11 +++++++++++ include/bootcount.h | 4 ---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/common/spl/spl.c b/common/spl/spl.c index cc5507f757..a2ef13a41c 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -830,3 +830,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 8fa8cf8218..a26a385233 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) {}