Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/633506/?format=api
{ "id": 633506, "url": "http://patchwork.ozlabs.org/api/patches/633506/?format=api", "web_url": "http://patchwork.ozlabs.org/project/skiboot/patch/1465535032-26749-6-git-send-email-gwshan@linux.vnet.ibm.com/", "project": { "id": 44, "url": "http://patchwork.ozlabs.org/api/projects/44/?format=api", "name": "skiboot firmware development", "link_name": "skiboot", "list_id": "skiboot.lists.ozlabs.org", "list_email": "skiboot@lists.ozlabs.org", "web_url": "http://github.com/open-power/skiboot", "scm_url": "http://github.com/open-power/skiboot", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<1465535032-26749-6-git-send-email-gwshan@linux.vnet.ibm.com>", "list_archive_url": null, "date": "2016-06-10T05:03:34", "name": "[v12,05/23] core/fdt: Introduce __create_dtb()", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "b80738f5e0efd34a4ff7489e33697e36a988c4f3", "submitter": { "id": 63923, "url": "http://patchwork.ozlabs.org/api/people/63923/?format=api", "name": "Gavin Shan", "email": "gwshan@linux.vnet.ibm.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/skiboot/patch/1465535032-26749-6-git-send-email-gwshan@linux.vnet.ibm.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/633506/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/633506/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "skiboot@lists.ozlabs.org" ], "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "skiboot@lists.ozlabs.org" ], "Received": [ "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3rQqrS2fFXz9sD3\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 10 Jun 2016 15:06:00 +1000 (AEST)", "from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3rQqrS1XZHzDqHQ\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 10 Jun 2016 15:06:00 +1000 (AEST)", "from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com\n\t[148.163.156.1])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3rQqqd1qCWzDqJV\n\tfor <skiboot@lists.ozlabs.org>; Fri, 10 Jun 2016 15:05:17 +1000 (AEST)", "from pps.filterd (m0048827.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id\n\tu5A53r0m042485\n\tfor <skiboot@lists.ozlabs.org>; Fri, 10 Jun 2016 01:05:15 -0400", "from e23smtp04.au.ibm.com (e23smtp04.au.ibm.com [202.81.31.146])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 23f9vdg1ty-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <skiboot@lists.ozlabs.org>; Fri, 10 Jun 2016 01:05:15 -0400", "from localhost\n\tby e23smtp04.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <skiboot@lists.ozlabs.org> from <gwshan@linux.vnet.ibm.com>;\n\tFri, 10 Jun 2016 15:05:12 +1000", "from d23dlp01.au.ibm.com (202.81.31.203)\n\tby e23smtp04.au.ibm.com (202.81.31.210) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tFri, 10 Jun 2016 15:05:10 +1000", "from d23relay07.au.ibm.com (d23relay07.au.ibm.com [9.190.26.37])\n\tby d23dlp01.au.ibm.com (Postfix) with ESMTP id A52372CE8063\n\tfor <skiboot@lists.ozlabs.org>; Fri, 10 Jun 2016 15:04:59 +1000 (EST)", "from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97])\n\tby d23relay07.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n\tu5A54cY07668206\n\tfor <skiboot@lists.ozlabs.org>; Fri, 10 Jun 2016 15:04:44 +1000", "from d23av03.au.ibm.com (localhost [127.0.0.1])\n\tby d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id\n\tu5A54S8F023953\n\tfor <skiboot@lists.ozlabs.org>; Fri, 10 Jun 2016 15:04:28 +1000", "from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14])\n\tby d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id\n\tu5A54SD6023878; Fri, 10 Jun 2016 15:04:28 +1000", "from bran.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114])\n\tby ozlabs.au.ibm.com (Postfix) with ESMTP id 4A21EA0150;\n\tFri, 10 Jun 2016 15:03:56 +1000 (AEST)", "from gwshan (shangw.ozlabs.ibm.com [10.61.2.199])\n\tby bran.ozlabs.ibm.com (Postfix) with ESMTP id 473CCE3B1A;\n\tFri, 10 Jun 2016 15:03:56 +1000 (AEST)", "by gwshan (Postfix, from userid 1000)\n\tid 2B67B942CA3; Fri, 10 Jun 2016 15:03:56 +1000 (AEST)" ], "X-IBM-Helo": "d23dlp01.au.ibm.com", "X-IBM-MailFrom": "gwshan@linux.vnet.ibm.com", "X-IBM-RcptTo": "skiboot@lists.ozlabs.org", "From": "Gavin Shan <gwshan@linux.vnet.ibm.com>", "To": "skiboot@lists.ozlabs.org", "Date": "Fri, 10 Jun 2016 15:03:34 +1000", "X-Mailer": "git-send-email 2.1.0", "In-Reply-To": "<1465535032-26749-1-git-send-email-gwshan@linux.vnet.ibm.com>", "References": "<1465535032-26749-1-git-send-email-gwshan@linux.vnet.ibm.com>", "X-TM-AS-MML": "disable", "X-Content-Scanned": "Fidelis XPS MAILER", "x-cbid": "16061005-0012-0000-0000-0000019D849B", "X-IBM-AV-DETECTION": "SAVI=unused REMOTE=unused XFE=unused", "x-cbparentid": "16061005-0013-0000-0000-0000055EFAB5", "Message-Id": "<1465535032-26749-6-git-send-email-gwshan@linux.vnet.ibm.com>", "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2016-06-10_04:, , signatures=0", "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=3\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000\n\tdefinitions=main-1606100058", "Subject": "[Skiboot] [PATCH v12 05/23] core/fdt: Introduce __create_dtb()", "X-BeenThere": "skiboot@lists.ozlabs.org", "X-Mailman-Version": "2.1.22", "Precedence": "list", "List-Id": "Mailing list for skiboot development <skiboot.lists.ozlabs.org>", "List-Unsubscribe": "<https://lists.ozlabs.org/options/skiboot>,\n\t<mailto:skiboot-request@lists.ozlabs.org?subject=unsubscribe>", "List-Archive": "<http://lists.ozlabs.org/pipermail/skiboot/>", "List-Post": "<mailto:skiboot@lists.ozlabs.org>", "List-Help": "<mailto:skiboot-request@lists.ozlabs.org?subject=help>", "List-Subscribe": "<https://lists.ozlabs.org/listinfo/skiboot>,\n\t<mailto:skiboot-request@lists.ozlabs.org?subject=subscribe>", "Cc": "alistair@popple.id.au", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "base64", "Errors-To": "skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org", "Sender": "\"Skiboot\"\n\t<skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>" }, "content": "There is shared logic to flatten the whole device tree (used when\nloading kernel) or device sub-tree (used by PCI hot add). This\nintroduces helper function __create_dtb() for the shared logic.\nNo functional changes introduced.\n\nSigned-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>\nReviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>\n---\n core/fdt.c | 44 ++++++++++++++++++++++++--------------------\n 1 file changed, 24 insertions(+), 20 deletions(-)", "diff": "diff --git a/core/fdt.c b/core/fdt.c\nindex 6d8130d..fbfbac6 100644\n--- a/core/fdt.c\n+++ b/core/fdt.c\n@@ -165,15 +165,31 @@ static void create_dtb_reservemap(void *fdt, const struct dt_node *root)\n \tsave_err(fdt_finish_reservemap(fdt));\n }\n \n+static int __create_dtb(void *fdt, size_t len,\n+\t\t\tconst struct dt_node *root)\n+{\n+\tfdt_create(fdt, len);\n+\tcreate_dtb_reservemap(fdt, root);\n+\tflatten_dt_node(fdt, root);\n+\n+\tsave_err(fdt_finish(fdt));\n+\tif (fdt_error) {\n+\t\tprerror(\"dtb: error %s\\n\", fdt_strerror(fdt_error));\n+\t\treturn fdt_error;\n+\t}\n+\n+\tdump_fdt(fdt);\n+\treturn 0;\n+}\n+\n void *create_dtb(const struct dt_node *root)\n {\n \tvoid *fdt = NULL;\n \tsize_t len = DEVICE_TREE_MAX_SIZE;\n \tuint32_t old_last_phandle = last_phandle;\n+\tint ret;\n \n \tdo {\n-\t\tif (fdt)\n-\t\t\tfree(fdt);\n \t\tlast_phandle = old_last_phandle;\n \t\tfdt_error = 0;\n \t\tfdt = malloc(len);\n@@ -182,26 +198,14 @@ void *create_dtb(const struct dt_node *root)\n \t\t\treturn NULL;\n \t\t}\n \n-\t\tfdt_create(fdt, len);\n-\n-\t\tcreate_dtb_reservemap(fdt, root);\n-\n-\t\t/* Unflatten our live tree */\n-\t\tflatten_dt_node(fdt, root);\n-\n-\t\tsave_err(fdt_finish(fdt));\n-\n-\t\tif (!fdt_error)\n-\t\t\tbreak;\n+\t\tret = __create_dtb(fdt, len, root);\n+\t\tif (ret) {\n+\t\t\tfree(fdt);\n+\t\t\tfdt = NULL;\n+\t\t}\n \n \t\tlen *= 2;\n-\t} while (fdt_error == -FDT_ERR_NOSPACE);\n+\t} while (ret == -FDT_ERR_NOSPACE);\n \n-\tdump_fdt(fdt);\n-\n-\tif (fdt_error) {\n-\t\tprerror(\"dtb: error %s\\n\", fdt_strerror(fdt_error));\n-\t\treturn NULL;\n-\t}\n \treturn fdt;\n }\n", "prefixes": [ "v12", "05/23" ] }