Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5D2ACC4332F for ; Thu, 3 Mar 2022 21:16:57 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7071783D3D; Thu, 3 Mar 2022 22:16:02 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ZTwkbEZY"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EEF7383D1C; Thu, 3 Mar 2022 22:15:58 +0100 (CET) Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) (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 8098B83D0F for ; Thu, 3 Mar 2022 22:15:53 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=alpernebiyasak@gmail.com Received: by mail-ed1-x52b.google.com with SMTP id x5so8248997edd.11 for ; Thu, 03 Mar 2022 13:15:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:from:subject:to:cc :references:content-language:in-reply-to:content-transfer-encoding; bh=fquDFnESGxwIgCfd2PXhqoP5FbczUi6BX8cDU/lhYOY=; b=ZTwkbEZYu/1qSxM5pe61s5u5dddag2Am9pZmgQYsiWm2RtnOQ9/LH/z9yqQlE/AP39 FRawC8IsrNRXqMi0QvIxYxiRrEGfidHf9YXU98Oe9zIOsQsKHEPQAR7BQ/VQ48JHWKhp 5SAJ6qiXb2PXKAAzyFKG4tgyd3wGhhT8reuf4bEyvGlibMRzHhbGLFd16+jryCILFgHi thxM2Pd+D3DkJF2ib5aT4OS7GHHzldbuqi5GAPUa13BKN2SmaHqIBeHDNirFrf7DdJwS byjzXvDtuv5x+7SmZ6Va710fktSiUnwkW8y8DzQqE6YscKCK+WEcCdBpWufM06mV1jYh fMVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:from :subject:to:cc:references:content-language:in-reply-to :content-transfer-encoding; bh=fquDFnESGxwIgCfd2PXhqoP5FbczUi6BX8cDU/lhYOY=; b=nH5ekXgyJk2OKrxUX0/dq4jn7WlaqmwZdXKXsDX4eY0jtbydbj88Z2CIejq0RV2++b RmtoX0FMiCPNcdaDESlVpZmBt6V8+Q2mnBGML2HgDa0FuNOufylH2Rv2fGfpE/ZFyYU1 5Cho/2LMq2Hx9UFu1vyryPv5AAD2DgsKVdFj3avCtFPMNrETy11LFnKU+rEQljld5sOD rxgBDhnt+bgKn9yye2zW4AaGIRL6MIJ3IoZOzlphZYmwXMhnP/9BqEvxRb1YE4m1dOvH RrH3aWK7DNr/cj6RjReVz876HCdDEjNe92X7Refw/VJMBc5BjWAv36iljpnlUuk4zEVF FGpA== X-Gm-Message-State: AOAM53355GbBliAIopHPxG50zYHQjS1n3gca3HthCRPLmx54JYwf4Y5l KzDUtHvGvdtq02BcAUqI17Y= X-Google-Smtp-Source: ABdhPJyT8lGnaek9DJDnppDHB7uF01P3Es2NY38pb3Zn4DVeZwVgO1n2JlcZ7oj16sY7YvquLCGQoQ== X-Received: by 2002:aa7:dbd6:0:b0:408:4a31:97a5 with SMTP id v22-20020aa7dbd6000000b004084a3197a5mr37051156edt.186.1646342153069; Thu, 03 Mar 2022 13:15:53 -0800 (PST) Received: from [192.168.0.74] ([178.233.26.119]) by smtp.gmail.com with ESMTPSA id ky5-20020a170907778500b006d1b2dd8d4csm1097372ejc.99.2022.03.03.13.15.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Mar 2022 13:15:52 -0800 (PST) Message-ID: <783b082d-2880-6712-8418-d3013c894c3e@gmail.com> Date: Fri, 4 Mar 2022 00:08:52 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 From: Alper Nebi Yasak Subject: Re: [PATCH v2 08/25] binman: Rename ExpandToLimit to extend_to_limit To: Simon Glass Cc: Ivan Mikhaylov , Tom Rini , Philippe Reynes , huang lin , Jeffy Chen , Kever Yang , U-Boot Mailing List References: <20220223230040.159317-1-sjg@chromium.org> <20220223230040.159317-9-sjg@chromium.org> Content-Language: en-US In-Reply-To: <20220223230040.159317-9-sjg@chromium.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.5 at phobos.denx.de X-Virus-Status: Clean On 24/02/2022 02:00, Simon Glass wrote: > The word 'expand' is used for entries which generate subentries. It is > also used for entries that can have an '_expanded' version which is used > to break out its contents. > > Rather than talking about expanding an entry's size, use the term > 'extending'. It is slightly more precise and avoids the above conflicts. > > This change renders the old 'expand-size' property invalid, so add an > error check for that. > > Signed-off-by: Simon Glass > --- > > Changes in v2: > - Add patch to rename ExpandToLimit to extend_to_limit > > tools/binman/binman.rst | 2 +- > tools/binman/entry.py | 8 +++++--- > tools/binman/etype/section.py | 10 +++++----- > tools/binman/ftest.py | 8 ++++++++ > tools/binman/test/088_expand_size.dts | 8 ++++---- > tools/binman/test/089_expand_size_bad.dts | 2 +- > tools/binman/test/225_expand_size_bad.dts | 10 ++++++++++ > 7 files changed, 34 insertions(+), 14 deletions(-) > create mode 100644 tools/binman/test/225_expand_size_bad.dts I haven't ever used expand-size, but: Reviewed-by: Alper Nebi Yasak > diff --git a/tools/binman/binman.rst b/tools/binman/binman.rst > index 0061e43659..85f8337a31 100644 > --- a/tools/binman/binman.rst > +++ b/tools/binman/binman.rst > @@ -480,7 +480,7 @@ image-pos: > for each entry. This makes it easy to find out exactly where the entry > ended up in the image, regardless of parent sections, etc. > > -expand-size: > +extend-size: > Expand the size of this entry to fit available space. This space is only Expand -> Extend > limited by the size of the image/section and the position of the next > entry. > diff --git a/tools/binman/entry.py b/tools/binman/entry.py > index de8526618d..a59eb56f14 100644 > --- a/tools/binman/entry.py > +++ b/tools/binman/entry.py > @@ -233,6 +233,8 @@ class Entry(object): > """ > if 'pos' in self._node.props: > self.Raise("Please use 'offset' instead of 'pos'") > + if 'expand-size' in self._node.props: > + self.Raise("Please use 'extend-size' instead of 'expand-size'") > self.offset = fdt_util.GetInt(self._node, 'offset') > self.size = fdt_util.GetInt(self._node, 'size') > self.orig_offset = fdt_util.GetInt(self._node, 'orig-offset') > @@ -260,7 +262,7 @@ class Entry(object): > self.align_size) > self.align_end = fdt_util.GetInt(self._node, 'align-end') > self.offset_unset = fdt_util.GetBool(self._node, 'offset-unset') > - self.expand_size = fdt_util.GetBool(self._node, 'expand-size') > + self.expand_size = fdt_util.GetBool(self._node, 'extend-size') Consider also changing the attribute name, I don't see many instances of it with git-grep. Maybe even the test dts names. > self.missing_msg = fdt_util.GetString(self._node, 'missing-msg') > > # This is only supported by blobs and sections at present > @@ -772,8 +774,8 @@ features to produce new behaviours. > name = '%s.%s' % (node.name, name) > return name > > - def ExpandToLimit(self, limit): > - """Expand an entry so that it ends at the given offset limit""" > + def extend_to_limit(self, limit): > + """Extent an entry so that it ends at the given offset limit""" Extent -> Extend > if self.offset + self.size < limit: > self.size = limit - self.offset > # Request the contents again, since changing the size requires that > [...]