Message ID | 20201019024138.3804540-18-sjg@chromium.org |
---|---|
State | Superseded |
Delegated to: | Simon Glass |
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=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>) 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=jYnOo2LW; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 4CF1Mk4HrLz9sSf for <incoming@patchwork.ozlabs.org>; Mon, 19 Oct 2020 13:45:38 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2F963824AC; Mon, 19 Oct 2020 04:42:31 +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="jYnOo2LW"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A72858242B; Mon, 19 Oct 2020 04:42:06 +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-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) (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 0F52082435 for <u-boot@lists.denx.de>; Mon, 19 Oct 2020 04:42:02 +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-xd41.google.com with SMTP id b8so11223774ioh.11 for <u-boot@lists.denx.de>; Sun, 18 Oct 2020 19:42:01 -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=+XsVv/FMe+6rkX5Z6st/FTicLNhQFIBMhtqRwkfC5hE=; b=jYnOo2LWtRYE/jHZcotoUsHNpWPKQwRmUgN2WQmcZfuL+agLFTL9ZiJAyq9AaE0Gw4 FbAJCa84PZqSiZyIwU+DpgQuY1kZUL4PzZihjU3/O21yrjlqsonDxYNDSL0uSXTwGnl+ OabD3bWAhfMCgbOgggQBQC19646EYrmo08Z20= 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=+XsVv/FMe+6rkX5Z6st/FTicLNhQFIBMhtqRwkfC5hE=; b=j/vH+cI4ooOmNBItWjW8h7nIwijaVuOwkL95nqekWdyz2uUPKmDDwZPzxWlzF3bV0a 3T2RPFrLxy8CZG0rB7RUjQFyzCn0iqMuQ0WyyHXF9vqPUCGN8GSYIqkahlrMYktNKbzt coo2WzqLkeSE0LJ1H27QhdEs7BCtZ4K4Bes9Pqfe2KWPlyC+4n9jd8sOGPLAfrOktt7q sWC18Orr16p7I60AWZVSTVNnzFKNdChTPUqpJFB7O55xzv9ZSRNgB6t2UHlHprgM0JXX dVag4eDUppcXUEiQjO4Kby/uU4TdPTeoDUhGSzWI55XG0w45RnM3Jw846dVc/FUoNmtm jN0Q== X-Gm-Message-State: AOAM531Kky8Ybiu5e+cwp6nwRaNQhSOdSBZ4h2IfVmQn85+MbafmLE+7 0HLaOnIOWUohmfvUy5Jaw6NKJfPCce+DMUcI X-Google-Smtp-Source: ABdhPJwrlzIHYnxhv73va0m4FS3ZRJnYHBsB59h4W9Hop8VTeXwvuVR9aLX6A8FnLYWB/DHt6Kb88w== X-Received: by 2002:a6b:7f43:: with SMTP id m3mr9011791ioq.114.1603075320776; Sun, 18 Oct 2020 19:42:00 -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.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Oct 2020 19:42:00 -0700 (PDT) From: Simon Glass <sjg@chromium.org> To: U-Boot Mailing List <u-boot@lists.denx.de> Cc: Simon Glass <sjg@chromium.org>, Alper Nebi Yasak <alpernebiyasak@gmail.com>, Bin Meng <bmeng.cn@gmail.com> Subject: [PATCH 18/25] binman: Move sort and expand to the main Pack() function Date: Sun, 18 Oct 2020 20:41:31 -0600 Message-Id: <20201019024138.3804540-18-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 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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: <https://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> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean |
Series |
binman: Support compression of sections
|
expand
|
diff --git a/tools/binman/etype/section.py b/tools/binman/etype/section.py index fb4bf640bfb..c883f0d67c4 100644 --- a/tools/binman/etype/section.py +++ b/tools/binman/etype/section.py @@ -260,6 +260,10 @@ class Entry_section(Entry): def Pack(self, offset): """Pack all entries into the section""" self._PackEntries() + if self._sort: + self._SortEntries() + self._ExpandEntries() + return super().Pack(offset) def _PackEntries(self): @@ -290,9 +294,6 @@ class Entry_section(Entry): def CheckEntries(self): """Check that entries do not overlap or extend outside the section""" - if self._sort: - self._SortEntries() - self._ExpandEntries() offset = 0 prev_name = 'None' for entry in self._entries.values():
At present sorting and expanding entries are side-effects of the CheckEntries() function. This is a bit confusing, as 'checking' would not normally involve making changes. Move these steps into the Pack() function instead. Signed-off-by: Simon Glass <sjg@chromium.org> --- tools/binman/etype/section.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)