Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1558710/?format=api
{ "id": 1558710, "url": "http://patchwork.ozlabs.org/api/patches/1558710/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20211123180354.615946-4-sjg@chromium.org/", "project": { "id": 18, "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api", "name": "U-Boot", "link_name": "uboot", "list_id": "u-boot.lists.denx.de", "list_email": "u-boot@lists.denx.de", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20211123180354.615946-4-sjg@chromium.org>", "list_archive_url": null, "date": "2021-11-23T18:03:40", "name": "[03/17] dtoc: Add support for reading fixed-length bytes properties", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "41e875ae0a517fa5a576654d2876fd08e3bf9b2e", "submitter": { "id": 6170, "url": "http://patchwork.ozlabs.org/api/people/6170/?format=api", "name": "Simon Glass", "email": "sjg@chromium.org" }, "delegate": { "id": 3184, "url": "http://patchwork.ozlabs.org/api/users/3184/?format=api", "username": "sjg", "first_name": "Simon", "last_name": "Glass", "email": "sjg@chromium.org" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20211123180354.615946-4-sjg@chromium.org/mbox/", "series": [ { "id": 273476, "url": "http://patchwork.ozlabs.org/api/series/273476/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=273476", "date": "2021-11-23T18:03:37", "name": "binman: Various tidy-ups and refactors", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/273476/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1558710/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1558710/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<u-boot-bounces@lists.denx.de>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Authentication-Results": [ "bilbo.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256\n header.s=google header.b=QZMN7QH7;\n\tdkim-atps=neutral", "ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>)", "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=chromium.org", "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de", "phobos.denx.de;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=chromium.org header.i=@chromium.org\n header.b=\"QZMN7QH7\";\n\tdkim-atps=neutral", "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=chromium.org", "phobos.denx.de;\n spf=pass smtp.mailfrom=sjg@chromium.org" ], "Received": [ "from phobos.denx.de (phobos.denx.de [85.214.62.61])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (4096 bits))\n\t(No client certificate requested)\n\tby bilbo.ozlabs.org (Postfix) with ESMTPS id 4HzBr26xBXz9ssD\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 24 Nov 2021 05:05:06 +1100 (AEDT)", "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 0F1C082F73;\n\tTue, 23 Nov 2021 19:04:44 +0100 (CET)", "by phobos.denx.de (Postfix, from userid 109)\n id 433AD8372E; Tue, 23 Nov 2021 19:04:27 +0100 (CET)", "from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com\n [IPv6:2607:f8b0:4864:20::32e])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id D16B483681\n for <u-boot@lists.denx.de>; Tue, 23 Nov 2021 19:04:16 +0100 (CET)", "by mail-ot1-x32e.google.com with SMTP id\n r10-20020a056830080a00b0055c8fd2cebdso119421ots.6\n for <u-boot@lists.denx.de>; Tue, 23 Nov 2021 10:04:16 -0800 (PST)", "from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net.\n [67.190.101.114])\n by smtp.gmail.com with ESMTPSA id c8sm2357514otk.40.2021.11.23.10.04.14\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 23 Nov 2021 10:04:14 -0800 (PST)" ], "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de", "X-Spam-Level": "", "X-Spam-Status": "No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,\n DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,\n SPF_PASS autolearn=ham autolearn_force=no version=3.4.2", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n s=google;\n h=from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding;\n bh=rW6DuiJgFJytjuChgUSioCLCXiqC9uhznYMckWbanuQ=;\n b=QZMN7QH7MYSxEKM/KqmWKYXAHV/7CGzjvx+lU6LRIhV82Ew+9v3+ibnJxieItfcA5j\n Bi/XK0F1DODZ5zyQGPi6WlSalKpAGOJ70asxxe+/w/NZgwDqKCZGi18PGcsAaJuPawsP\n ubeXZghymwPzMoGFBjgy4JodvrG5Tys3CcNy8=", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20210112;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n :references:mime-version:content-transfer-encoding;\n bh=rW6DuiJgFJytjuChgUSioCLCXiqC9uhznYMckWbanuQ=;\n b=7/vmTQtlgpvXsmFp5qKrFxs1MMY0xrLJ1g9BnZ9YMUy4niENUbuuY+w1Xb1/RF1itj\n Xi2yHfOCez4I2gKH/z362jSPiozoGt72lQ9Z+uh2Hm0TS2dublxcZnV87cZvAITo3SOV\n gVrh97slArnJk6pE3h/yYvQ5iHoybAXbk7hyBpp5ZWi+fqG7BCu0e1icH5rwr9DwtgY3\n tyM8F9c5CIJlbiO5pFe9yNujlq42+v203J6zZlbzZZVaflWCrU+QATlmCpctILKeUdWm\n QE3RhE9vjNJA6vKXdfLym9sQ3ypvWWBjrbMhIja0Trf46heee9gzUdK9YaETUphliKu/\n n8rA==", "X-Gm-Message-State": "AOAM5319yQOY0yymZeDFVFA1IkUXolSqcTkJYMmw7Hb13d1Asqsh0nD0\n WeF6wmf8P7hjShj5bK0woerUlH6ZvdgJag==", "X-Google-Smtp-Source": "\n ABdhPJxhd6B5Cv2C5fB/tfBr8oXcKA+s0LNMYO0P7Wy6M1UI2TKg+W7zCXN936Do4tMlh3lSuY9NkQ==", "X-Received": "by 2002:a05:6830:2712:: with SMTP id\n j18mr6281228otu.302.1637690655192;\n Tue, 23 Nov 2021 10:04:15 -0800 (PST)", "From": "Simon Glass <sjg@chromium.org>", "To": "U-Boot Mailing List <u-boot@lists.denx.de>", "Cc": "Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org>,\n Walter Lozano <walter.lozano@collabora.com>", "Subject": "[PATCH 03/17] dtoc: Add support for reading fixed-length bytes\n properties", "Date": "Tue, 23 Nov 2021 11:03:40 -0700", "Message-Id": "<20211123180354.615946-4-sjg@chromium.org>", "X-Mailer": "git-send-email 2.34.0.rc2.393.gf8c9666880-goog", "In-Reply-To": "<20211123180354.615946-1-sjg@chromium.org>", "References": "<20211123180354.615946-1-sjg@chromium.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "u-boot@lists.denx.de", "X-Mailman-Version": "2.1.37", "Precedence": "list", "List-Id": "U-Boot discussion <u-boot.lists.denx.de>", "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n <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>,\n <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.103.2 at phobos.denx.de", "X-Virus-Status": "Clean" }, "content": "Add functions to read a sequence of bytes from the devicetree.\n\nSigned-off-by: Simon Glass <sjg@chromium.org>\n---\n\n scripts/pylint.base | 4 ++--\n tools/dtoc/fdt_util.py | 20 ++++++++++++++++++++\n tools/dtoc/test_fdt.py | 17 +++++++++++++++++\n 3 files changed, 39 insertions(+), 2 deletions(-)", "diff": "diff --git a/scripts/pylint.base b/scripts/pylint.base\nindex d848ebe9058..f4f226799c1 100644\n--- a/scripts/pylint.base\n+++ b/scripts/pylint.base\n@@ -44,12 +44,12 @@ cros_ec_rw -6.00\n defs 6.67\n dtoc.dtb_platdata 7.82\n dtoc.fdt 3.47\n-dtoc.fdt_util 4.53\n+dtoc.fdt_util 4.95\n dtoc.main 7.33\n dtoc.setup 5.00\n dtoc.src_scan 8.75\n dtoc.test_dtoc 8.54\n-dtoc.test_fdt 6.92\n+dtoc.test_fdt 6.93\n dtoc.test_src_scan 9.43\n efivar 6.71\n endian-swap 8.93\ndiff --git a/tools/dtoc/fdt_util.py b/tools/dtoc/fdt_util.py\nindex 51d0eb52423..51bdbdcd3b2 100644\n--- a/tools/dtoc/fdt_util.py\n+++ b/tools/dtoc/fdt_util.py\n@@ -202,6 +202,26 @@ def GetByte(node, propname, default=None):\n (node.name, propname, len(value), 1))\n return ord(value[0])\n \n+def GetBytes(node, propname, size, default=None):\n+ \"\"\"Get a set of bytes from a property\n+\n+ Args:\n+ node (Node): Node object to read from\n+ propname (str): property name to read\n+ size (int): Number of bytes to expect\n+ default (bytes): Default value or None\n+\n+ Returns:\n+ bytes: Bytes value read, or default if none\n+ \"\"\"\n+ prop = node.props.get(propname)\n+ if not prop:\n+ return default\n+ if len(prop.bytes) != size:\n+ raise ValueError(\"Node '%s' property '%s' has length %d, expecting %d\" %\n+ (node.name, propname, len(prop.bytes), size))\n+ return prop.bytes\n+\n def GetPhandleList(node, propname):\n \"\"\"Get a list of phandles from a property\n \ndiff --git a/tools/dtoc/test_fdt.py b/tools/dtoc/test_fdt.py\nindex 21a9a7ca063..7a4c7efaa4a 100755\n--- a/tools/dtoc/test_fdt.py\n+++ b/tools/dtoc/test_fdt.py\n@@ -635,6 +635,23 @@ class TestFdtUtil(unittest.TestCase):\n self.assertIn(\"property 'intval' has length 4, expecting 1\",\n str(e.exception))\n \n+ def testGetBytes(self):\n+ self.assertEqual(bytes([5]), fdt_util.GetBytes(self.node, 'byteval', 1))\n+ self.assertEqual(None, fdt_util.GetBytes(self.node, 'missing', 3))\n+ self.assertEqual(\n+ bytes([3]), fdt_util.GetBytes(self.node, 'missing', 3, bytes([3])))\n+\n+ with self.assertRaises(ValueError) as e:\n+ fdt_util.GetBytes(self.node, 'longbytearray', 7)\n+ self.assertIn(\n+ \"Node 'spl-test' property 'longbytearray' has length 9, expecting 7\",\n+ str(e.exception))\n+\n+ self.assertEqual(\n+ bytes([0, 0, 0, 1]), fdt_util.GetBytes(self.node, 'intval', 4))\n+ self.assertEqual(\n+ bytes([3]), fdt_util.GetBytes(self.node, 'missing', 3, bytes([3])))\n+\n def testGetPhandleList(self):\n dtb = fdt.FdtScan(find_dtb_file('dtoc_test_phandle.dts'))\n node = dtb.GetNode('/phandle-source2')\n", "prefixes": [ "03/17" ] }