Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1191913/?format=api
{ "id": 1191913, "url": "http://patchwork.ozlabs.org/api/patches/1191913/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20191108130123.6839-23-linux@rasmusvillemoes.dk/", "project": { "id": 2, "url": "http://patchwork.ozlabs.org/api/projects/2/?format=api", "name": "Linux PPC development", "link_name": "linuxppc-dev", "list_id": "linuxppc-dev.lists.ozlabs.org", "list_email": "linuxppc-dev@lists.ozlabs.org", "web_url": "https://github.com/linuxppc/wiki/wiki", "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git", "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/", "list_archive_url_format": "https://lore.kernel.org/linuxppc-dev/{}/", "commit_url_format": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}" }, "msgid": "<20191108130123.6839-23-linux@rasmusvillemoes.dk>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20191108130123.6839-23-linux@rasmusvillemoes.dk/", "date": "2019-11-08T13:00:58", "name": "[v4,22/47] soc: fsl: qe: qe.c: use of_property_read_* helpers", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": false, "hash": "472c29efb1a7fb67353fc1303b80ec3729ac5d29", "submitter": { "id": 27394, "url": "http://patchwork.ozlabs.org/api/people/27394/?format=api", "name": "Rasmus Villemoes", "email": "linux@rasmusvillemoes.dk" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20191108130123.6839-23-linux@rasmusvillemoes.dk/mbox/", "series": [ { "id": 141654, "url": "http://patchwork.ozlabs.org/api/series/141654/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=141654", "date": "2019-11-08T13:00:38", "name": "QUICC Engine support on ARM and ARM64", "version": 4, "mbox": "http://patchwork.ozlabs.org/series/141654/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1191913/comments/", "check": "success", "checks": "http://patchwork.ozlabs.org/api/patches/1191913/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>", "X-Original-To": [ "patchwork-incoming@ozlabs.org", "linuxppc-dev@lists.ozlabs.org" ], "Delivered-To": [ "patchwork-incoming@ozlabs.org", "linuxppc-dev@lists.ozlabs.org" ], "Received": [ "from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange X25519 server-signature RSA-PSS (4096 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 478jFf1lMvz9s4Y\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat, 9 Nov 2019 01:24:22 +1100 (AEDT)", "from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 478jFb1GjTzF4PJ\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat, 9 Nov 2019 01:24:19 +1100 (AEDT)", "from mail-lf1-x141.google.com (mail-lf1-x141.google.com\n\t[IPv6:2a00:1450:4864:20::141])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange X25519 server-signature RSA-PSS (2048 bits)\n\tserver-digest SHA256) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 478gQb4kflzF6vY\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tSat, 9 Nov 2019 00:01:59 +1100 (AEDT)", "by mail-lf1-x141.google.com with SMTP id f5so4430708lfp.1\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tFri, 08 Nov 2019 05:01:59 -0800 (PST)", "from prevas-ravi.prevas.se ([81.216.59.226])\n\tby smtp.gmail.com with ESMTPSA id\n\td28sm2454725lfn.33.2019.11.08.05.01.55\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 08 Nov 2019 05:01:55 -0800 (PST)" ], "Authentication-Results": [ "ozlabs.org; dmarc=none (p=none dis=none)\n\theader.from=rasmusvillemoes.dk", "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=rasmusvillemoes.dk header.i=@rasmusvillemoes.dk\n\theader.b=\"CzwCiuj6\"; dkim-atps=neutral", "lists.ozlabs.org; spf=pass (sender SPF authorized)\n\tsmtp.mailfrom=rasmusvillemoes.dk (client-ip=2a00:1450:4864:20::141;\n\thelo=mail-lf1-x141.google.com; envelope-from=linux@rasmusvillemoes.dk;\n\treceiver=<UNKNOWN>)", "lists.ozlabs.org; dmarc=none (p=none dis=none)\n\theader.from=rasmusvillemoes.dk", "lists.ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=rasmusvillemoes.dk header.i=@rasmusvillemoes.dk\n\theader.b=\"CzwCiuj6\"; dkim-atps=neutral" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=rasmusvillemoes.dk; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=DamhDMgU5LUEj6+/3a9o1XbDY44tIM+8wHrJxcRu+uM=;\n\tb=CzwCiuj6exVzCOFgPuTt4r411VFLxU0lG62JmrAC0Tq/FkGLV3hcmjLjTOyorGZ6BF\n\tf5vdfP5f8/tUJl6K09ZcsdwAkooUD8r/2Uhwc8HsNoAH1bikyuyJ6cAkf0huPMxyLgC/\n\tq3hQieIudS4xARAsuE4JftrjXtWacrgN01Omo=", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=DamhDMgU5LUEj6+/3a9o1XbDY44tIM+8wHrJxcRu+uM=;\n\tb=aN0MgOsacVv05sAY9Gd1qfUwkfywsTYh0T6Mw5Yzbl9bjZ0sQEoLusVsPhJAUU9mqd\n\tct5LTHe0SSyHmJl41GHDQv0B/YwwmqvQCzgTpzOeR0sKnOAkjk5y6tP4lQ6iGH02oMik\n\tPLLtSmlDcNCe3MpL2mHP1fUB41vQDiUaZlV9QIDHfpnx7Ny8gV59ugAzo8nYOab0E0UI\n\tphd71nwiup+N87NPWEsDdx7fGc/OBBJU2CHOA96z9/NmQ8weKzCxKohQ5tLh5JCvwZUh\n\tKD/Hcmeg26V4uSkqKTvf8yl6IIwrlxy00dc050JxgeSPbX39PAfx5xR9qmaFamAd0uE0\n\txgdw==", "X-Gm-Message-State": "APjAAAVdVIio5bNVVs3mmcScQxr1YsUMMKhXhqJlEBLZi3y6AcDZrmtI\n\t1npv0EnYskWoFvikY6oB/6MbJQ==", "X-Google-Smtp-Source": "APXvYqxLhyI+di0UO4K7+gvbN3eZpupJEQvTp7M7AQUxi/FrrJBEEQYjplGtvhFcgeq0+SdHb/S3Bw==", "X-Received": "by 2002:a19:fc1c:: with SMTP id\n\ta28mr6554479lfi.170.1573218116086; \n\tFri, 08 Nov 2019 05:01:56 -0800 (PST)", "From": "Rasmus Villemoes <linux@rasmusvillemoes.dk>", "To": "Qiang Zhao <qiang.zhao@nxp.com>, Li Yang <leoyang.li@nxp.com>,\n\tChristophe Leroy <christophe.leroy@c-s.fr>", "Subject": "[PATCH v4 22/47] soc: fsl: qe: qe.c: use of_property_read_* helpers", "Date": "Fri, 8 Nov 2019 14:00:58 +0100", "Message-Id": "<20191108130123.6839-23-linux@rasmusvillemoes.dk>", "X-Mailer": "git-send-email 2.23.0", "In-Reply-To": "<20191108130123.6839-1-linux@rasmusvillemoes.dk>", "References": "<20191108130123.6839-1-linux@rasmusvillemoes.dk>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "linuxppc-dev@lists.ozlabs.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>", "List-Unsubscribe": "<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>", "List-Archive": "<http://lists.ozlabs.org/pipermail/linuxppc-dev/>", "List-Post": "<mailto:linuxppc-dev@lists.ozlabs.org>", "List-Help": "<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>", "List-Subscribe": "<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>", "Cc": "Scott Wood <oss@buserror.net>,\n\tRasmus Villemoes <linux@rasmusvillemoes.dk>, \n\tlinuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,\n\tlinux-arm-kernel@lists.infradead.org", "Errors-To": "linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org", "Sender": "\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>" }, "content": "Instead of manually doing of_get_property/of_find_property and reading\nthe value by assigning to a u32* or u64* and dereferencing, use the\nof_property_read_* functions.\n\nThis make the code more readable, and more importantly, is required\nfor this to work correctly on little-endian platforms.\n\nSigned-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>\n---\n drivers/soc/fsl/qe/qe.c | 33 ++++++++-------------------------\n 1 file changed, 8 insertions(+), 25 deletions(-)", "diff": "diff --git a/drivers/soc/fsl/qe/qe.c b/drivers/soc/fsl/qe/qe.c\nindex a4763282ea68..ec511840db3c 100644\n--- a/drivers/soc/fsl/qe/qe.c\n+++ b/drivers/soc/fsl/qe/qe.c\n@@ -159,8 +159,7 @@ static unsigned int brg_clk = 0;\n unsigned int qe_get_brg_clk(void)\n {\n \tstruct device_node *qe;\n-\tint size;\n-\tconst u32 *prop;\n+\tu32 brg;\n \tunsigned int mod;\n \n \tif (brg_clk)\n@@ -170,9 +169,8 @@ unsigned int qe_get_brg_clk(void)\n \tif (!qe)\n \t\treturn brg_clk;\n \n-\tprop = of_get_property(qe, \"brg-frequency\", &size);\n-\tif (prop && size == sizeof(*prop))\n-\t\tbrg_clk = *prop;\n+\tif (!of_property_read_u32(qe, \"brg-frequency\", &brg))\n+\t\tbrg_clk = brg;\n \n \tof_node_put(qe);\n \n@@ -571,11 +569,9 @@ EXPORT_SYMBOL(qe_upload_firmware);\n struct qe_firmware_info *qe_get_firmware_info(void)\n {\n \tstatic int initialized;\n-\tstruct property *prop;\n \tstruct device_node *qe;\n \tstruct device_node *fw = NULL;\n \tconst char *sprop;\n-\tunsigned int i;\n \n \t/*\n \t * If we haven't checked yet, and a driver hasn't uploaded a firmware\n@@ -609,20 +605,11 @@ struct qe_firmware_info *qe_get_firmware_info(void)\n \t\tstrlcpy(qe_firmware_info.id, sprop,\n \t\t\tsizeof(qe_firmware_info.id));\n \n-\tprop = of_find_property(fw, \"extended-modes\", NULL);\n-\tif (prop && (prop->length == sizeof(u64))) {\n-\t\tconst u64 *iprop = prop->value;\n-\n-\t\tqe_firmware_info.extended_modes = *iprop;\n-\t}\n+\tof_property_read_u64(fw, \"extended-modes\",\n+\t\t\t &qe_firmware_info.extended_modes);\n \n-\tprop = of_find_property(fw, \"virtual-traps\", NULL);\n-\tif (prop && (prop->length == 32)) {\n-\t\tconst u32 *iprop = prop->value;\n-\n-\t\tfor (i = 0; i < ARRAY_SIZE(qe_firmware_info.vtraps); i++)\n-\t\t\tqe_firmware_info.vtraps[i] = iprop[i];\n-\t}\n+\tof_property_read_u32_array(fw, \"virtual-traps\", qe_firmware_info.vtraps,\n+\t\t\t\t ARRAY_SIZE(qe_firmware_info.vtraps));\n \n \tof_node_put(fw);\n \n@@ -633,17 +620,13 @@ EXPORT_SYMBOL(qe_get_firmware_info);\n unsigned int qe_get_num_of_risc(void)\n {\n \tstruct device_node *qe;\n-\tint size;\n \tunsigned int num_of_risc = 0;\n-\tconst u32 *prop;\n \n \tqe = qe_get_device_node();\n \tif (!qe)\n \t\treturn num_of_risc;\n \n-\tprop = of_get_property(qe, \"fsl,qe-num-riscs\", &size);\n-\tif (prop && size == sizeof(*prop))\n-\t\tnum_of_risc = *prop;\n+\tof_property_read_u32(qe, \"fsl,qe-num-riscs\", &num_of_risc);\n \n \tof_node_put(qe);\n \n", "prefixes": [ "v4", "22/47" ] }