Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/556249/?format=api
{ "id": 556249, "url": "http://patchwork.ozlabs.org/api/patches/556249/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/patch/566DF69F.5090700@simon.arlott.org.uk/", "project": { "id": 3, "url": "http://patchwork.ozlabs.org/api/projects/3/?format=api", "name": "Linux MTD development", "link_name": "linux-mtd", "list_id": "linux-mtd.lists.infradead.org", "list_email": "linux-mtd@lists.infradead.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<566DF69F.5090700@simon.arlott.org.uk>", "list_archive_url": null, "date": "2015-12-13T22:52:15", "name": "[linux-next,v4,10/11] mtd: bcm63xxpart: Move NOR flash layout to a separate function", "commit_ref": "4110fdd295e1219f4e4c4e35e2eba7b605b74ed7", "pull_url": null, "state": "accepted", "archived": false, "hash": "2be89d61c150767c748c0daa1b115ff86d1d605f", "submitter": { "id": 1123, "url": "http://patchwork.ozlabs.org/api/people/1123/?format=api", "name": "Simon Arlott", "email": "simon@fire.lp0.eu" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-mtd/patch/566DF69F.5090700@simon.arlott.org.uk/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/556249/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/556249/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Received": [ "from bombadil.infradead.org (bombadil.infradead.org\n\t[IPv6:2001:1868:205::9])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id B8B74140311\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 14 Dec 2015 09:53:52 +1100 (AEDT)", "from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux))\n\tid 1a8FVR-0000A9-Gm; Sun, 13 Dec 2015 22:52:41 +0000", "from proxima.lp0.eu ([2001:8b0:ffea:0:205:b4ff:fe12:530])\n\tby bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux))\n\tid 1a8FVP-0008UO-6Z\n\tfor linux-mtd@lists.infradead.org; Sun, 13 Dec 2015 22:52:39 +0000", "from redrum.lp0.eu ([2001:8b0:ffea:0:2e0:81ff:fe4d:2bec]:44507\n\tident=simon)\n\tby proxima.lp0.eu ([2001:8b0:ffea:0:205:b4ff:fe12:530]:465)\n\twith esmtpsav (UNKNOWN:DHE-RSA-AES256-SHA:256/CN=Simon Arlott)\n\tid 1a8FV2-00049a-P4 (Exim); Sun, 13 Dec 2015 22:52:17 +0000" ], "Authentication-Results": "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tsecure) header.d=fire.lp0.eu header.i=@fire.lp0.eu header.b=KeOn/Qb7;\n\tdkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=fire.lp0.eu; s=exim; \n\th=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:Cc:References:To:Subject;\n\tbh=EJJTKb6JA8fZxv0JOfb/4ZLwvEES2/I5jvez/jAvSxc=; \n\tb=KeOn/Qb7E6wdJro4G6CR1R27ZBJoLkt7AGrV6iJ/sFakISK+49QV/fN/ZJdbWMNenO1F8XA+zaATjv2C8n+yR9pBy8mDMdeLye3FHiI4oftiDqNu/7ak71gvl6YGlVxy6Fwjaj4fITB4Tr4i0iQjF1QuI6dg86Q0VSbH55rt48rjkXkFb6uKWtWlYbny2yNMMgR8fSo84bVBzJV5eUcspxIBq+8bBWPZ8HUewnMfjrIV9p9GLmb85FOVtgVKa/YUr8JHVr3nRO8/KV0ZtaFxWYST66I3UDOr0OVfk0GB313Ojt13uWm4LeT3t+iWJ1ZsehqvoB/RFCF44qRVV8/GPw==;", "Subject": "[PATCH linux-next v4 10/11] mtd: bcm63xxpart: Move NOR flash layout\n\tto a separate function", "To": "Ralf Baechle <ralf@linux-mips.org>, David Woodhouse\n\t<dwmw2@infradead.org>, Brian Norris <computersforpeace@gmail.com>,\n\tKevin Cernekee <cernekee@gmail.com>, Florian Fainelli\n\t<f.fainelli@gmail.com>, Jonas Gorski <jogo@openwrt.org>", "References": "<566DF43B.5010400@simon.arlott.org.uk>", "From": "Simon Arlott <simon@fire.lp0.eu>", "Message-ID": "<566DF69F.5090700@simon.arlott.org.uk>", "Date": "Sun, 13 Dec 2015 22:52:15 +0000", "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101\n\tThunderbird/38.4.0", "MIME-Version": "1.0", "In-Reply-To": "<566DF43B.5010400@simon.arlott.org.uk>", "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ", "X-CRM114-CacheID": "sfid-20151213_145239_477940_7FD1EEA9 ", "X-CRM114-Status": "GOOD ( 14.17 )", "X-Spam-Score": "-4.3 (----)", "X-Spam-Report": "SpamAssassin version 3.4.0 on bombadil.infradead.org summary:\n\tContent analysis details: (-4.3 points)\n\tpts rule name description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/,\n\tmedium trust [2001:8b0:ffea:0:205:b4ff:fe12:530 listed in]\n\t[list.dnswl.org]\n\t-0.0 SPF_HELO_PASS SPF: HELO matches SPF record\n\t-0.0 SPF_PASS SPF: sender matches SPF record\n\t-0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay\n\tdomain\n\t-1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]\n\t0.1 DKIM_SIGNED Message has a DKIM or DK signature,\n\tnot necessarily valid\n\t-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from\n\tauthor's domain\n\t-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature", "X-BeenThere": "linux-mtd@lists.infradead.org", "X-Mailman-Version": "2.1.20", "Precedence": "list", "List-Id": "Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>", "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>", "List-Archive": "<http://lists.infradead.org/pipermail/linux-mtd/>", "List-Post": "<mailto:linux-mtd@lists.infradead.org>", "List-Help": "<mailto:linux-mtd-request@lists.infradead.org?subject=help>", "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>", "Cc": "MIPS Mailing List <linux-mips@linux-mips.org>,\n\tMTD Maling List <linux-mtd@lists.infradead.org>,\n\tLinux Kernel Mailing List <linux-kernel@vger.kernel.org>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Sender": "\"linux-mtd\" <linux-mtd-bounces@lists.infradead.org>", "Errors-To": "linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org" }, "content": "Move the NOR flash layout to a separate function to allow the NAND flash\nlayout to be supported.\n\nSigned-off-by: Simon Arlott <simon@fire.lp0.eu>\n---\nv4: New patch.\n\n drivers/mtd/bcm63xxpart.c | 54 ++++++++++++++++++++++++++++-------------------\n 1 file changed, 32 insertions(+), 22 deletions(-)", "diff": "diff --git a/drivers/mtd/bcm63xxpart.c b/drivers/mtd/bcm63xxpart.c\nindex 41aa202..26c38a1 100644\n--- a/drivers/mtd/bcm63xxpart.c\n+++ b/drivers/mtd/bcm63xxpart.c\n@@ -124,13 +124,11 @@ static int bcm63xx_read_image_tag(struct mtd_info *master, const char *name,\n \treturn 1;\n }\n \n-static int bcm63xx_parse_cfe_partitions(struct mtd_info *master,\n-\t\t\t\t\tconst struct mtd_partition **pparts,\n-\t\t\t\t\tstruct mtd_part_parser_data *data)\n+static int bcm63xx_parse_cfe_nor_partitions(struct mtd_info *master,\n+\tconst struct mtd_partition **pparts, struct bcm963xx_nvram *nvram)\n {\n \t/* CFE, NVRAM and global Linux are always present */\n \tint nrparts = 3, curpart = 0;\n-\tstruct bcm963xx_nvram *nvram = NULL;\n \tstruct bcm_tag *buf = NULL;\n \tstruct mtd_partition *parts;\n \tint ret;\n@@ -141,17 +139,6 @@ static int bcm63xx_parse_cfe_partitions(struct mtd_info *master,\n \tint i;\n \tbool rootfs_first = false;\n \n-\tif (bcm63xx_detect_cfe(master))\n-\t\treturn -EINVAL;\n-\n-\tnvram = vzalloc(sizeof(*nvram));\n-\tif (!nvram)\n-\t\treturn -ENOMEM;\n-\n-\tret = bcm63xx_read_nvram(master, nvram);\n-\tif (ret)\n-\t\tgoto out;\n-\n \tcfe_erasesize = max_t(uint32_t, master->erasesize,\n \t\t\t BCM963XX_CFE_BLOCK_SIZE);\n \n@@ -159,12 +146,9 @@ static int bcm63xx_parse_cfe_partitions(struct mtd_info *master,\n \tnvramlen = nvram->psi_size * SZ_1K;\n \tnvramlen = roundup(nvramlen, cfe_erasesize);\n \n-\t/* Allocate memory for buffer */\n \tbuf = vmalloc(sizeof(struct bcm_tag));\n-\tif (!buf) {\n-\t\tret = -ENOMEM;\n-\t\tgoto out;\n-\t}\n+\tif (!buf)\n+\t\treturn -ENOMEM;\n \n \t/* Get the tag */\n \tret = bcm63xx_read_image_tag(master, \"rootfs\", cfelen, buf);\n@@ -234,7 +218,6 @@ invalid_tag:\n \tif (kernellen > 0)\n \t\tnrparts++;\n \n-\t/* Ask kernel for more memory */\n \tparts = kzalloc(sizeof(*parts) * nrparts + 10 * nrparts, GFP_KERNEL);\n \tif (!parts) {\n \t\tret = -ENOMEM;\n@@ -292,13 +275,40 @@ invalid_tag:\n \tret = 0;\n \n out:\n-\tvfree(nvram);\n \tvfree(buf);\n \n \tif (ret)\n \t\treturn ret;\n \n \treturn nrparts;\n+}\n+\n+static int bcm63xx_parse_cfe_partitions(struct mtd_info *master,\n+\t\t\t\t\tconst struct mtd_partition **pparts,\n+\t\t\t\t\tstruct mtd_part_parser_data *data)\n+{\n+\tstruct bcm963xx_nvram *nvram = NULL;\n+\tint ret;\n+\n+\tif (bcm63xx_detect_cfe(master))\n+\t\treturn -EINVAL;\n+\n+\tnvram = vzalloc(sizeof(*nvram));\n+\tif (!nvram)\n+\t\treturn -ENOMEM;\n+\n+\tret = bcm63xx_read_nvram(master, nvram);\n+\tif (ret)\n+\t\tgoto out;\n+\n+\tif (!mtd_type_is_nand(master))\n+\t\tret = bcm63xx_parse_cfe_nor_partitions(master, pparts, nvram);\n+\telse\n+\t\tret = -EINVAL;\n+\n+out:\n+\tvfree(nvram);\n+\treturn ret;\n };\n \n static struct mtd_part_parser bcm63xx_cfe_parser = {\n", "prefixes": [ "linux-next", "v4", "10/11" ] }