Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/813159/?format=api
{ "id": 813159, "url": "http://patchwork.ozlabs.org/api/patches/813159/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/patch/1505280046-16608-8-git-send-email-yamada.masahiro@socionext.com/", "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": "<1505280046-16608-8-git-send-email-yamada.masahiro@socionext.com>", "list_archive_url": null, "date": "2017-09-13T05:20:44", "name": "[7/9] mtd: nand: denali: use more FIELD_PREP / FIELD_GET where appropriate", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "1876af344ae237f3f7dd0d11a36629f8f28b68b0", "submitter": { "id": 65882, "url": "http://patchwork.ozlabs.org/api/people/65882/?format=api", "name": "Masahiro Yamada", "email": "yamada.masahiro@socionext.com" }, "delegate": { "id": 58324, "url": "http://patchwork.ozlabs.org/api/users/58324/?format=api", "username": "bbrezillon", "first_name": "Boris", "last_name": "Brezillon", "email": "boris.brezillon@free-electrons.com" }, "mbox": "http://patchwork.ozlabs.org/project/linux-mtd/patch/1505280046-16608-8-git-send-email-yamada.masahiro@socionext.com/mbox/", "series": [ { "id": 2809, "url": "http://patchwork.ozlabs.org/api/series/2809/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/list/?series=2809", "date": "2017-09-13T05:20:39", "name": "mtd: nand: denali: more clean-ups", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/2809/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/813159/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/813159/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=\"IxUeL2vj\"; \n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=nifty.com header.i=@nifty.com\n\theader.b=\"z254Um2x\"; 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 3xsVTM4n07z9sMN\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 13 Sep 2017 15:24:23 +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 1ds09a-0008K7-OL; Wed, 13 Sep 2017 05:24:02 +0000", "from conuserg-12.nifty.com ([210.131.2.79])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1ds07J-0006Xn-NM\n\tfor linux-mtd@lists.infradead.org; Wed, 13 Sep 2017 05:21:51 +0000", "from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp\n\t[153.142.97.92]) (authenticated)\n\tby conuserg-12.nifty.com with ESMTP id v8D5Kpx6010397;\n\tWed, 13 Sep 2017 14:20:57 +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=Epam2lsJmwkMfAqMrzIj3jhcn2jPNxA3ymOAr8JTDLY=;\n\tb=IxUeL2vjHSXkNMyr/FxdSYzkFj\n\tZ0KjovaOJP80NtN/SJD1CGUD+SNSidOGTgY296STfxs+68RTZZUPuAUi6K73yLqjlgFSgrWpZixwx\n\tjTYVK5NAYRvlN+mL5h49CStTn/TRW1fwSztcScI5ECzzwKEKVJ/u9eip9OLnMMOkpvJkPAeNGDw7Y\n\tm2NOkyIjZy+5eOil8veefiWHHBAOT7MpDyksCqXac6mLv9XhAgC5IfMFtpV8fwI0kYgs5NNHZKFl9\n\tqgDU3/WNU1PGaq4uf/mWTStFLfbPnW1izqyC9CnWcX8mfIoLsiFKRjeMedx/g+smyzWj1QoJXlTEV\n\twNuyxLuA==;", "v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com;\n\ts=dec2015msa; t=1505280057;\n\tbh=7Wo3Jfxi3nNtoxkLx7hG8rEGbq39a8jyMr1IRBQZVTQ=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=z254Um2xSoMTvxbWPGyX2Vvn3S+9xbc74vwp2Ji1BJBzgignx5efajX4juSzJccOK\n\te5EVPORvrSPw1Ebk/Qa8MSFEeLSHSVEs2GabdY2C5sPQU/1gRFlOYJNseXYdsFfJ/m\n\t62VDYAYfO2+dUNKSRCGK5TMUD2nX8jUiBAr3z97OFEwSaTNUQSQwdzYRpg/le/C0ep\n\tKpdNPBenxqJQdFofnXfHg8TyfhQyrh/5Giaon8WxbIBcfQEmRJ7iLK4YpQEcejA3HD\n\tHo6hjU59/RbRxotq8BWL34HmFAuZ/04wsVGaLzUODWcXAGAU7yIG8Wfc69r5BUH13F\n\teYGH6T1gHm91w==" ], "DKIM-Filter": "OpenDKIM Filter v2.10.3 conuserg-12.nifty.com v8D5Kpx6010397", "X-Nifty-SrcIP": "[153.142.97.92]", "From": "Masahiro Yamada <yamada.masahiro@socionext.com>", "To": "linux-mtd@lists.infradead.org", "Subject": "[PATCH 7/9] mtd: nand: denali: use more FIELD_PREP / FIELD_GET where\n\tappropriate", "Date": "Wed, 13 Sep 2017 14:20:44 +0900", "Message-Id": "<1505280046-16608-8-git-send-email-yamada.masahiro@socionext.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1505280046-16608-1-git-send-email-yamada.masahiro@socionext.com>", "References": "<1505280046-16608-1-git-send-email-yamada.masahiro@socionext.com>", "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ", "X-CRM114-CacheID": "sfid-20170912_222142_289553_9036FA2C ", "X-CRM114-Status": "GOOD ( 10.81 )", "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": "In several places in this driver, the register fields are retrieved\nas follows:\n\n val = reg & FOO_MASK;\n\nThen, modified as follows:\n\n reg &= ~FOO_MASK;\n reg |= val;\n\nThis code relies on its shift is 0, which we will never know until\nwe check the definition of FOO_MASK. Use FIELD_PREP / FIELD_GET\nwhere appropriate.\n\nSigned-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>\n---\n\n drivers/mtd/nand/denali.c | 22 +++++++++++-----------\n 1 file changed, 11 insertions(+), 11 deletions(-)", "diff": "diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c\nindex 1525c4e..ca98015 100644\n--- a/drivers/mtd/nand/denali.c\n+++ b/drivers/mtd/nand/denali.c\n@@ -88,7 +88,7 @@ static void denali_detect_max_banks(struct denali_nand_info *denali)\n {\n \tuint32_t features = ioread32(denali->reg + FEATURES);\n \n-\tdenali->max_banks = 1 << (features & FEATURES__N_BANKS);\n+\tdenali->max_banks = 1 << FIELD_GET(FEATURES__N_BANKS, features);\n \n \t/* the encoding changed from rev 5.0 to 5.1 */\n \tif (denali->revision < 0x0501)\n@@ -374,7 +374,7 @@ static int denali_hw_ecc_fixup(struct mtd_info *mtd,\n \t\treturn 0;\n \t}\n \n-\tmax_bitflips = ecc_cor & ECC_COR_INFO__MAX_ERRORS;\n+\tmax_bitflips = FIELD_GET(ECC_COR_INFO__MAX_ERRORS, ecc_cor);\n \n \t/*\n \t * The register holds the maximum of per-sector corrected bitflips.\n@@ -985,7 +985,7 @@ static int denali_setup_data_interface(struct mtd_info *mtd, int chipnr,\n \n \ttmp = ioread32(denali->reg + ACC_CLKS);\n \ttmp &= ~ACC_CLKS__VALUE;\n-\ttmp |= acc_clks;\n+\ttmp |= FIELD_PREP(ACC_CLKS__VALUE, acc_clks);\n \tiowrite32(tmp, denali->reg + ACC_CLKS);\n \n \t/* tRWH -> RE_2_WE */\n@@ -994,7 +994,7 @@ static int denali_setup_data_interface(struct mtd_info *mtd, int chipnr,\n \n \ttmp = ioread32(denali->reg + RE_2_WE);\n \ttmp &= ~RE_2_WE__VALUE;\n-\ttmp |= re_2_we;\n+\ttmp |= FIELD_PREP(RE_2_WE__VALUE, re_2_we);\n \tiowrite32(tmp, denali->reg + RE_2_WE);\n \n \t/* tRHZ -> RE_2_RE */\n@@ -1003,7 +1003,7 @@ static int denali_setup_data_interface(struct mtd_info *mtd, int chipnr,\n \n \ttmp = ioread32(denali->reg + RE_2_RE);\n \ttmp &= ~RE_2_RE__VALUE;\n-\ttmp |= re_2_re;\n+\ttmp |= FIELD_PREP(RE_2_RE__VALUE, re_2_re);\n \tiowrite32(tmp, denali->reg + RE_2_RE);\n \n \t/* tWHR -> WE_2_RE */\n@@ -1012,7 +1012,7 @@ static int denali_setup_data_interface(struct mtd_info *mtd, int chipnr,\n \n \ttmp = ioread32(denali->reg + TWHR2_AND_WE_2_RE);\n \ttmp &= ~TWHR2_AND_WE_2_RE__WE_2_RE;\n-\ttmp |= we_2_re;\n+\ttmp |= FIELD_PREP(TWHR2_AND_WE_2_RE__WE_2_RE, we_2_re);\n \tiowrite32(tmp, denali->reg + TWHR2_AND_WE_2_RE);\n \n \t/* tADL -> ADDR_2_DATA */\n@@ -1026,8 +1026,8 @@ static int denali_setup_data_interface(struct mtd_info *mtd, int chipnr,\n \taddr_2_data = min_t(int, addr_2_data, addr_2_data_mask);\n \n \ttmp = ioread32(denali->reg + TCWAW_AND_ADDR_2_DATA);\n-\ttmp &= ~addr_2_data_mask;\n-\ttmp |= addr_2_data;\n+\ttmp &= ~TCWAW_AND_ADDR_2_DATA__ADDR_2_DATA;\n+\ttmp |= FIELD_PREP(TCWAW_AND_ADDR_2_DATA__ADDR_2_DATA, addr_2_data);\n \tiowrite32(tmp, denali->reg + TCWAW_AND_ADDR_2_DATA);\n \n \t/* tREH, tWH -> RDWR_EN_HI_CNT */\n@@ -1037,7 +1037,7 @@ static int denali_setup_data_interface(struct mtd_info *mtd, int chipnr,\n \n \ttmp = ioread32(denali->reg + RDWR_EN_HI_CNT);\n \ttmp &= ~RDWR_EN_HI_CNT__VALUE;\n-\ttmp |= rdwr_en_hi;\n+\ttmp |= FIELD_PREP(RDWR_EN_HI_CNT__VALUE, rdwr_en_hi);\n \tiowrite32(tmp, denali->reg + RDWR_EN_HI_CNT);\n \n \t/* tRP, tWP -> RDWR_EN_LO_CNT */\n@@ -1051,7 +1051,7 @@ static int denali_setup_data_interface(struct mtd_info *mtd, int chipnr,\n \n \ttmp = ioread32(denali->reg + RDWR_EN_LO_CNT);\n \ttmp &= ~RDWR_EN_LO_CNT__VALUE;\n-\ttmp |= rdwr_en_lo;\n+\ttmp |= FIELD_PREP(RDWR_EN_LO_CNT__VALUE, rdwr_en_lo);\n \tiowrite32(tmp, denali->reg + RDWR_EN_LO_CNT);\n \n \t/* tCS, tCEA -> CS_SETUP_CNT */\n@@ -1062,7 +1062,7 @@ static int denali_setup_data_interface(struct mtd_info *mtd, int chipnr,\n \n \ttmp = ioread32(denali->reg + CS_SETUP_CNT);\n \ttmp &= ~CS_SETUP_CNT__VALUE;\n-\ttmp |= cs_setup;\n+\ttmp |= FIELD_PREP(CS_SETUP_CNT__VALUE, cs_setup);\n \tiowrite32(tmp, denali->reg + CS_SETUP_CNT);\n \n \treturn 0;\n", "prefixes": [ "7/9" ] }