From patchwork Tue Jul 17 19:25:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 945291 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=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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 41VW1d0hRWz9s0w for ; Wed, 18 Jul 2018 05:44:05 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id C263DC21BE5; Tue, 17 Jul 2018 19:42:49 +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_H3, RCVD_IN_MSPIKE_WL 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 357E0C21E1B; Tue, 17 Jul 2018 19:27:27 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 14E4AC21E1A; Tue, 17 Jul 2018 19:27:08 +0000 (UTC) Received: from mail-qt0-f202.google.com (mail-qt0-f202.google.com [209.85.216.202]) by lists.denx.de (Postfix) with ESMTPS id 55596C21F77 for ; Tue, 17 Jul 2018 19:26:52 +0000 (UTC) Received: by mail-qt0-f202.google.com with SMTP id i10-v6so1568732qtp.13 for ; Tue, 17 Jul 2018 12:26:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:date:in-reply-to:message-id :references:subject:from:to:cc; bh=n3TrIgm7YtIg8MMIqGTR04mnnyhv5ip+q2x/UAy8JFo=; b=Ex0+8bcs5JD2AczOLikFja0H0AJyjZn9TeJcbY967CEG8/bBJokFfvLtWGW8BnhubY 9GRMM0kRmyvOdBihHHM/LnvjmN3FsAGXCBjuz1oRPH8I1Qt7CyBYqLSR9dtftMyHT0xH KBEjtYlVpuDwwxoCAnBJ0Z5tEITRa09mKgH3P3eBuQmmdd7lsRJ6oIAvDrKAwXJC/b0Q sWwVkSDk3G//+tkhEIcnq2TlyeUyerC3v/VUjMjCISZHq+y+LrVLfyhmrxfTo/ADCKWe r002rDJsc9aQ+dbBYNcIMGgcbETJzmE6mVdxiGkovLPI5Tn+eKYMaaK7JcKfPcRL54NW Wr1g== X-Gm-Message-State: AOUpUlFJwIyEv+ri31246pZRyYpWVTR4xr6bP3B2kEi+0xQQnXX4mvuP X9gK+xXQhYbBSUJXIEt51kXLq6A= X-Google-Smtp-Source: AAOMgpd36LvUlnf6GUp7hL34J3mcku8qDL6Q1j8BJeZ52KNbfbqzasHIHl/7eSdq+HJLdvIVAhe4Iwk= MIME-Version: 1.0 X-Received: by 2002:a0c:9dc1:: with SMTP id p1-v6mr1437970qvf.27.1531855611535; Tue, 17 Jul 2018 12:26:51 -0700 (PDT) Date: Tue, 17 Jul 2018 13:25:51 -0600 In-Reply-To: <20180717192552.198496-1-sjg@chromium.org> Message-Id: <20180717192552.198496-29-sjg@chromium.org> References: <20180717192552.198496-1-sjg@chromium.org> X-Mailer: git-send-email 2.18.0.203.gfac676dfb9-goog From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini Subject: [U-Boot] [PATCH 28/29] binman: Add a test to catch use of the old 'pos' property 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" This property has been changed to 'offset'. To help downstream users who might still be using 'pos', add a check that this is not used by mistake. Signed-off-by: Simon Glass --- tools/binman/entry.py | 2 ++ tools/binman/ftest.py | 7 +++++++ tools/binman/test/79_uses_pos.dts | 10 ++++++++++ 3 files changed, 19 insertions(+) create mode 100644 tools/binman/test/79_uses_pos.dts diff --git a/tools/binman/entry.py b/tools/binman/entry.py index 6ce5dbdc90..77cfab9c5d 100644 --- a/tools/binman/entry.py +++ b/tools/binman/entry.py @@ -143,6 +143,8 @@ class Entry(object): This reads all the fields we recognise from the node, ready for use. """ + if 'pos' in self._node.props: + self.Raise("Please use 'offset' instead of 'pos'") self.offset = fdt_util.GetInt(self._node, 'offset') self.size = fdt_util.GetInt(self._node, 'size') self.align = fdt_util.GetInt(self._node, 'align') diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index ce473dfaff..3d5f23558c 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -1361,6 +1361,13 @@ class TestFunctional(unittest.TestCase): data = self._DoReadFile('78_u_boot_tpl.dts') self.assertEqual(U_BOOT_TPL_DATA + U_BOOT_TPL_DTB_DATA, data) + def testUsesPos(self): + """Test that the 'pos' property cannot be used anymore""" + with self.assertRaises(ValueError) as e: + data = self._DoReadFile('79_uses_pos.dts') + self.assertIn("Node '/binman/u-boot': Please use 'offset' instead of " + "'pos'", str(e.exception)) + if __name__ == "__main__": unittest.main() diff --git a/tools/binman/test/79_uses_pos.dts b/tools/binman/test/79_uses_pos.dts new file mode 100644 index 0000000000..7638b9b5e0 --- /dev/null +++ b/tools/binman/test/79_uses_pos.dts @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0+ +/dts-v1/; + +/ { + binman { + u-boot { + pos = <10>; + }; + }; +};