From patchwork Mon Oct 19 02:41:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1383972 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=a2T9h4Pg; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CF1Mv04Vpz9sSG for ; Mon, 19 Oct 2020 13:45:46 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 51674824B5; Mon, 19 Oct 2020 04:42:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="a2T9h4Pg"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CF8768244F; Mon, 19 Oct 2020 04:42:07 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd43.google.com (mail-io1-xd43.google.com [IPv6:2607:f8b0:4864:20::d43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id ADDDE823F8 for ; Mon, 19 Oct 2020 04:42:03 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd43.google.com with SMTP id n6so11191695ioc.12 for ; Sun, 18 Oct 2020 19:42:03 -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=hI+3tc/3eDiqFoxa94qmA+iQE/NnMhWx6eiDnbCWY+w=; b=a2T9h4PgGHJjcBeLUIM7UqXrb9640E9ncFQY6sBFhJhW2dlVli6yEIsFmayqBmPTEw oUn2QyJMFJysoHpOXx62LYdESQ3elDmW8y2ZIwro5z9eBHCPZRyo6IYkyYj6YSK70H47 qw1gfLkgzpNNWBDcP5QLzfS0Lb7+KHVcE4Kpw= 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=hI+3tc/3eDiqFoxa94qmA+iQE/NnMhWx6eiDnbCWY+w=; b=k2Ern+x+fvEnu9J39bRWKnG8cqKVzMolnVFFTTicS0nXYjJ6iWZV4sraaH5cdfkLjp vJGEWoM640UMkq0otjtM1bY2kJH1iGTHFnzUs/kjPvIeGkHuDRZtCE4/n6D9NpcM/1QB yOQf4aLATAuFZCt4So1Q3r7uk0AaHAUt6SQNR9dUBV09lq/vAUFQpzGVIcbul6a9NCRg 48unnSURN27Vx/g5QUMNZrJ+job2KgoA+U7OdD2cH1nmurwayOpx3jusI0tMMCB6+8bk dquSevIG+V0gVyKyNxE+k65Uku2mnHJ+8nBxpl/KrTzC6UECvYd8G0ue4M9Sl3iAM3gY /n3g== X-Gm-Message-State: AOAM53025CXf6XlZhVDnANT343hXdjyjVfCAfnlnmFAetavCDuwRdzE9 tCgfr+NiIQHtdU4Zx50ACKESN4xdUVIMGFAk X-Google-Smtp-Source: ABdhPJzpBGSz3DbjfvG3xL0yRI6f+oMrO7UMJoKK8wC7/QyIa8bcwJxcOXJqDc00x0MIzpfQgPu5Uw== X-Received: by 2002:a6b:908a:: with SMTP id s132mr9294542iod.62.1603075322471; Sun, 18 Oct 2020 19:42:02 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id g185sm9750871ilh.35.2020.10.18.19.42.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Oct 2020 19:42:02 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Alper Nebi Yasak , Bin Meng Subject: [PATCH 20/25] binman: Call CheckSize() from the section's Pack() method Date: Sun, 18 Oct 2020 20:41:33 -0600 Message-Id: <20201019024138.3804540-20-sjg@chromium.org> X-Mailer: git-send-email 2.29.0.rc1.297.gfa9743e501-goog In-Reply-To: <20201019024138.3804540-1-sjg@chromium.org> References: <20201019024138.3804540-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean At present CheckSize() is called from the function that packs the entries. Move it up to the main Pack() function so that _PackEntries() can just do the packing. Signed-off-by: Simon Glass --- tools/binman/etype/section.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/binman/etype/section.py b/tools/binman/etype/section.py index c883f0d67c4..f93469a170b 100644 --- a/tools/binman/etype/section.py +++ b/tools/binman/etype/section.py @@ -264,6 +264,9 @@ class Entry_section(Entry): self._SortEntries() self._ExpandEntries() + size = self.CheckSize() + self.size = size + return super().Pack(offset) def _PackEntries(self): @@ -271,7 +274,7 @@ class Entry_section(Entry): offset = self._skip_at_start for entry in self._entries.values(): offset = entry.Pack(offset) - self.size = self.CheckSize() + return offset def _ExpandEntries(self): """Expand any entries that are permitted to"""