{"id":817312,"url":"http://patchwork.ozlabs.org/api/patches/817312/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-mtd/patch/1506052009-8285-9-git-send-email-yamada.masahiro@socionext.com/","project":{"id":3,"url":"http://patchwork.ozlabs.org/api/projects/3/?format=json","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":"<1506052009-8285-9-git-send-email-yamada.masahiro@socionext.com>","list_archive_url":null,"date":"2017-09-22T03:46:45","name":"[v2,08/12] mtd: nand: denali: clean up comments","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"58d61735494100d71fec6e01502a51539fac1ae0","submitter":{"id":65882,"url":"http://patchwork.ozlabs.org/api/people/65882/?format=json","name":"Masahiro Yamada","email":"yamada.masahiro@socionext.com"},"delegate":{"id":58324,"url":"http://patchwork.ozlabs.org/api/users/58324/?format=json","username":"bbrezillon","first_name":"Boris","last_name":"Brezillon","email":"boris.brezillon@free-electrons.com"},"mbox":"http://patchwork.ozlabs.org/project/linux-mtd/patch/1506052009-8285-9-git-send-email-yamada.masahiro@socionext.com/mbox/","series":[{"id":4537,"url":"http://patchwork.ozlabs.org/api/series/4537/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-mtd/list/?series=4537","date":"2017-09-22T03:46:37","name":"mtd: nand: denali: more clean-ups","version":2,"mbox":"http://patchwork.ozlabs.org/series/4537/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/817312/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/817312/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","Authentication-Results":["ozlabs.org; spf=none (mailfrom)\n\tsmtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133;\n\thelo=bombadil.infradead.org;\n\tenvelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"GiIMPtxg\"; \n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=nifty.com header.i=@nifty.com\n\theader.b=\"dgj6pEF/\"; dkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xyzz93GSnz9ryk\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 13:50:45 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dvEz7-0007PD-Ra; Fri, 22 Sep 2017 03:50:37 +0000","from conuserg-09.nifty.com ([210.131.2.76])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dvEwJ-0004Fi-3P\n\tfor linux-mtd@lists.infradead.org; Fri, 22 Sep 2017 03:47:50 +0000","from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp\n\t[153.142.97.92]) (authenticated)\n\tby conuserg-09.nifty.com with ESMTP id v8M3kwAR029389;\n\tFri, 22 Sep 2017 12:47:05 +0900"],"DKIM-Signature":["v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe:\n\tList-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References:\n\tIn-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID:\n\tContent-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc\n\t:Resent-Message-ID:List-Owner;\n\tbh=GbQ2YTFKcH7eWljm+QSnjyUgBky5qLYLgcYWDZG/Xj0=;\n\tb=GiIMPtxgIqAOqjam6jiBmxq6gK\n\tUXoqf8n5cJZyb4uIHNrfixvbbsr6u+KOPf55x6F8SDnzDjEv1vHDiWVBbtaltC5BbUDbT9vPaQ/20\n\trPFqmhLE5k5DKEpb+WiJlLa0D5o6O/aQfzisObwTEJuGEZhaGsBrRRH3W7mfsNVrEjmPruEYD38Ra\n\t4ANeqHtCtVfENjqKTGfWJb1Y1Z8pjyyKI5edPFkChbIavmEpsLlncRAOiXi3H2AWZOKZ0jv5MkVy0\n\t1gzTBFA1PWTdYotulxvTysROOS4H5X27qm+6SM497iG9e+AJPaltN6fyM7mWkugm+Qk/Yyv+V84y1\n\tuRubgw1g==;","v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com;\n\ts=dec2015msa; t=1506052026;\n\tbh=pWWM1QhHhO0KtMdj0Q6470CMqQyJr3iyfJBFlOHblAk=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=dgj6pEF/Zkk+E1Pp10xLbTQ+gSuIeII88qAV9xLHXYwurV6bb/ySvcglqYX8WzroE\n\tyb/2PEfS7m/KqJrWJbjMZJjpQKw9L9bDLHYXLltlwXiia1n1TmSUr8iXAXAT0lJWkl\n\tRhdYT2oLQLCS999G1p6UPdLlouiY5bhnBQBKGZ0z5qXHuGWdP9onInMaD5uExKJhqy\n\tHwbT+N1LDFxwpyiEwnQrZcQo4W/0Xy9d0jv4aOB6ZzKb9A0HycZFjWaxpZpsd6aKe7\n\tfw+IN7Px4QM0xQX/pGfDW/MflRZnjvGnp07rd9Zj/fCQA5c0/GSZGwnmfFNqjhNd4/\n\tWIJowuOkHitZQ=="],"DKIM-Filter":"OpenDKIM Filter v2.10.3 conuserg-09.nifty.com v8M3kwAR029389","X-Nifty-SrcIP":"[153.142.97.92]","From":"Masahiro Yamada <yamada.masahiro@socionext.com>","To":"linux-mtd@lists.infradead.org","Subject":"[PATCH v2 08/12] mtd: nand: denali: clean up comments","Date":"Fri, 22 Sep 2017 12:46:45 +0900","Message-Id":"<1506052009-8285-9-git-send-email-yamada.masahiro@socionext.com>","X-Mailer":"git-send-email 2.7.4","In-Reply-To":"<1506052009-8285-1-git-send-email-yamada.masahiro@socionext.com>","References":"<1506052009-8285-1-git-send-email-yamada.masahiro@socionext.com>","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170921_204743_477111_91E1FFA4 ","X-CRM114-Status":"GOOD (  17.35  )","X-Spam-Score":"-1.2 (-)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-1.2 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail)\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]\n\t-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature\n\t0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n\tnot necessarily valid","X-BeenThere":"linux-mtd@lists.infradead.org","X-Mailman-Version":"2.1.21","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":"Boris Brezillon <boris.brezillon@free-electrons.com>,\n\tMarek Vasut <marek.vasut@gmail.com>,\n\tRichard Weinberger <richard@nod.at>, linux-kernel@vger.kernel.org,\n\tMasahiro Yamada <yamada.masahiro@socionext.com>, \n\tCyrille Pitchen <cyrille.pitchen@wedev4u.fr>,\n\tBrian Norris <computersforpeace@gmail.com>,\n\tDavid Woodhouse <dwmw2@infradead.org>","MIME-Version":"1.0","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":"This driver explains too much about what is apparent from the code.\n\nComments around basic APIs such as init_completion(), spin_lock_init(),\netc. seem unneeded lessons to kernel developers.\n(With those comments dropped, denali_drv_init() is small enough,\nso it has been merged into the probe function.)\n\nAlso, NAND driver developers should know the NAND init procedure, so\nthere is no need to explain nand_scan_ident/tail.\n\nI removed FSF's address from the license blocks, and added simple\ncomments to struct members.\n\nSigned-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>\n---\n\nChanges in v2:\n  - Add more comments to struct members\n\n drivers/mtd/nand/denali.c     | 52 +++++--------------------------------------\n drivers/mtd/nand/denali.h     | 24 +++++++-------------\n drivers/mtd/nand/denali_dt.c  |  1 -\n drivers/mtd/nand/denali_pci.c |  2 --\n 4 files changed, 13 insertions(+), 66 deletions(-)","diff":"diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c\nindex ca98015..02ce310 100644\n--- a/drivers/mtd/nand/denali.c\n+++ b/drivers/mtd/nand/denali.c\n@@ -10,11 +10,6 @@\n  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\n  * more details.\n- *\n- * You should have received a copy of the GNU General Public License along with\n- * this program; if not, write to the Free Software Foundation, Inc.,\n- * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.\n- *\n  */\n \n #include <linux/bitfield.h>\n@@ -64,10 +59,6 @@ MODULE_LICENSE(\"GPL\");\n  */\n #define DENALI_CLK_X_MULT\t6\n \n-/*\n- * this macro allows us to convert from an MTD structure to our own\n- * device context (denali) structure.\n- */\n static inline struct denali_nand_info *mtd_to_denali(struct mtd_info *mtd)\n {\n \treturn container_of(mtd_to_nand(mtd), struct denali_nand_info, nand);\n@@ -450,9 +441,8 @@ static int denali_sw_ecc_fixup(struct mtd_info *mtd,\n \t} while (!(err_cor_info & ERR_CORRECTION_INFO__LAST_ERR));\n \n \t/*\n-\t * Once handle all ecc errors, controller will trigger a\n-\t * ECC_TRANSACTION_DONE interrupt, so here just wait for\n-\t * a while for this interrupt\n+\t * Once handle all ECC errors, controller will trigger an\n+\t * ECC_TRANSACTION_DONE interrupt.\n \t */\n \tirq_status = denali_wait_for_irq(denali, INTR__ECC_TRANSACTION_DONE);\n \tif (!(irq_status & INTR__ECC_TRANSACTION_DONE))\n@@ -613,7 +603,6 @@ static int denali_dma_xfer(struct denali_nand_info *denali, void *buf,\n \tdenali_reset_irq(denali);\n \tdenali_setup_dma(denali, dma_addr, page, write);\n \n-\t/* wait for operation to complete */\n \tirq_status = denali_wait_for_irq(denali, irq_mask);\n \tif (!(irq_status & INTR__DMA_CMD_COMP))\n \t\tret = -EIO;\n@@ -1185,22 +1174,6 @@ static const struct mtd_ooblayout_ops denali_ooblayout_ops = {\n \t.free = denali_ooblayout_free,\n };\n \n-/* initialize driver data structures */\n-static void denali_drv_init(struct denali_nand_info *denali)\n-{\n-\t/*\n-\t * the completion object will be used to notify\n-\t * the callee that the interrupt is done\n-\t */\n-\tinit_completion(&denali->complete);\n-\n-\t/*\n-\t * the spinlock will be used to synchronize the ISR with any\n-\t * element that might be access shared data (interrupt status)\n-\t */\n-\tspin_lock_init(&denali->irq_lock);\n-}\n-\n static int denali_multidev_fixup(struct denali_nand_info *denali)\n {\n \tstruct nand_chip *chip = &denali->nand;\n@@ -1260,11 +1233,12 @@ int denali_init(struct denali_nand_info *denali)\n \n \tmtd->dev.parent = denali->dev;\n \tdenali_hw_init(denali);\n-\tdenali_drv_init(denali);\n+\n+\tinit_completion(&denali->complete);\n+\tspin_lock_init(&denali->irq_lock);\n \n \tdenali_clear_irq_all(denali);\n \n-\t/* Request IRQ after all the hardware initialization is finished */\n \tret = devm_request_irq(denali->dev, denali->irq, denali_isr,\n \t\t\t       IRQF_SHARED, DENALI_NAND_NAME, denali);\n \tif (ret) {\n@@ -1282,7 +1256,6 @@ int denali_init(struct denali_nand_info *denali)\n \tif (!mtd->name)\n \t\tmtd->name = \"denali-nand\";\n \n-\t/* register the driver with the NAND core subsystem */\n \tchip->select_chip = denali_select_chip;\n \tchip->read_byte = denali_read_byte;\n \tchip->write_byte = denali_write_byte;\n@@ -1295,11 +1268,6 @@ int denali_init(struct denali_nand_info *denali)\n \tif (denali->clk_x_rate)\n \t\tchip->setup_data_interface = denali_setup_data_interface;\n \n-\t/*\n-\t * scan for NAND devices attached to the controller\n-\t * this is the first stage in a two step process to register\n-\t * with the nand subsystem\n-\t */\n \tret = nand_scan_ident(mtd, denali->max_banks, NULL);\n \tif (ret)\n \t\tgoto disable_irq;\n@@ -1323,18 +1291,9 @@ int denali_init(struct denali_nand_info *denali)\n \t\tchip->buf_align = 16;\n \t}\n \n-\t/*\n-\t * second stage of the NAND scan\n-\t * this stage requires information regarding ECC and\n-\t * bad block management.\n-\t */\n-\n \tchip->bbt_options |= NAND_BBT_USE_FLASH;\n \tchip->bbt_options |= NAND_BBT_NO_OOB;\n-\n \tchip->ecc.mode = NAND_ECC_HW_SYNDROME;\n-\n-\t/* no subpage writes on denali */\n \tchip->options |= NAND_NO_SUBPAGE_WRITE;\n \n \tret = denali_ecc_setup(mtd, chip, denali);\n@@ -1418,7 +1377,6 @@ int denali_init(struct denali_nand_info *denali)\n }\n EXPORT_SYMBOL(denali_init);\n \n-/* driver exit point */\n void denali_remove(struct denali_nand_info *denali)\n {\n \tstruct mtd_info *mtd = nand_to_mtd(&denali->nand);\ndiff --git a/drivers/mtd/nand/denali.h b/drivers/mtd/nand/denali.h\nindex 73aad3a..f55ee10 100644\n--- a/drivers/mtd/nand/denali.h\n+++ b/drivers/mtd/nand/denali.h\n@@ -10,11 +10,6 @@\n  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\n  * more details.\n- *\n- * You should have received a copy of the GNU General Public License along with\n- * this program; if not, write to the Free Software Foundation, Inc.,\n- * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.\n- *\n  */\n \n #ifndef __DENALI_H__\n@@ -310,22 +305,19 @@ struct denali_nand_info {\n \tstruct device *dev;\n \tvoid __iomem *reg;\t\t/* Register Interface */\n \tvoid __iomem *host;\t\t/* Host Data/Command Interface */\n-\n-\t/* elements used by ISR */\n \tstruct completion complete;\n-\tspinlock_t irq_lock;\n-\tuint32_t irq_mask;\n-\tuint32_t irq_status;\n+\tspinlock_t irq_lock;\t\t/* protect irq_mask and irq_status */\n+\tu32 irq_mask;\t\t\t/* interrupts we are waiting for */\n+\tu32 irq_status;\t\t\t/* interrupts that have happened */\n \tint irq;\n-\n-\tvoid *buf;\n+\tvoid *buf;\t\t\t/* for syndrome layout conversion */\n \tdma_addr_t dma_addr;\n-\tint dma_avail;\n+\tint dma_avail;\t\t\t/* can support DMA? */\n \tint devs_per_cs;\t\t/* devices connected in parallel */\n-\tint oob_skip_bytes;\n+\tint oob_skip_bytes;\t\t/* number of bytes reserved for BBM */\n \tint max_banks;\n-\tunsigned int revision;\n-\tunsigned int caps;\n+\tunsigned int revision;\t\t/* IP revision */\n+\tunsigned int caps;\t\t/* IP capability (or quirk) */\n \tconst struct nand_ecc_caps *ecc_caps;\n };\n \ndiff --git a/drivers/mtd/nand/denali_dt.c b/drivers/mtd/nand/denali_dt.c\nindex 01e0100..cfd33e6 100644\n--- a/drivers/mtd/nand/denali_dt.c\n+++ b/drivers/mtd/nand/denali_dt.c\n@@ -156,7 +156,6 @@ static struct platform_driver denali_dt_driver = {\n \t\t.of_match_table\t= denali_nand_dt_ids,\n \t},\n };\n-\n module_platform_driver(denali_dt_driver);\n \n MODULE_LICENSE(\"GPL\");\ndiff --git a/drivers/mtd/nand/denali_pci.c b/drivers/mtd/nand/denali_pci.c\nindex 7d5600b..57fb7ae 100644\n--- a/drivers/mtd/nand/denali_pci.c\n+++ b/drivers/mtd/nand/denali_pci.c\n@@ -109,7 +109,6 @@ static int denali_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)\n \treturn ret;\n }\n \n-/* driver exit point */\n static void denali_pci_remove(struct pci_dev *dev)\n {\n \tstruct denali_nand_info *denali = pci_get_drvdata(dev);\n@@ -125,5 +124,4 @@ static struct pci_driver denali_pci_driver = {\n \t.probe = denali_pci_probe,\n \t.remove = denali_pci_remove,\n };\n-\n module_pci_driver(denali_pci_driver);\n","prefixes":["v2","08/12"]}