{"id":688839,"url":"http://patchwork.ozlabs.org/api/patches/688839/?format=json","web_url":"http://patchwork.ozlabs.org/project/linuxppc-dev/patch/1477769829-22230-9-git-send-email-Julia.Lawall@lip6.fr/","project":{"id":2,"url":"http://patchwork.ozlabs.org/api/projects/2/?format=json","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":"<1477769829-22230-9-git-send-email-Julia.Lawall@lip6.fr>","list_archive_url":"https://lore.kernel.org/linuxppc-dev/1477769829-22230-9-git-send-email-Julia.Lawall@lip6.fr/","date":"2016-10-29T19:37:02","name":"[08/15] powerpc/iommu: use permission-specific DEVICE_ATTR variants","commit_ref":"8a7aef2cb3dafd2e8560750f4e5ad2cc2d9b1d17","pull_url":null,"state":"accepted","archived":false,"hash":"6223b33c676cf144266375924de2252318be6175","submitter":{"id":10041,"url":"http://patchwork.ozlabs.org/api/people/10041/?format=json","name":"Julia Lawall","email":"julia.lawall@lip6.fr"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linuxppc-dev/patch/1477769829-22230-9-git-send-email-Julia.Lawall@lip6.fr/mbox/","series":[],"comments":"http://patchwork.ozlabs.org/api/patches/688839/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/688839/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 [103.22.144.68])\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 3t5s2G0DPMz9srZ\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSun, 30 Oct 2016 07:01:10 +1100 (AEDT)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3t5s2F559pzDvY9\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSun, 30 Oct 2016 07:01:09 +1100 (AEDT)","from mail2-relais-roc.national.inria.fr\n\t(mail2-relais-roc.national.inria.fr [192.134.164.83])\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 3t5rws4BNyzDvSw\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tSun, 30 Oct 2016 06:56:29 +1100 (AEDT)","from palace.lip6.fr (HELO localhost.localdomain)\n\t([132.227.105.202])\n\tby mail2-relais-roc.national.inria.fr with ESMTP/TLS/AES128-SHA256;\n\t29 Oct 2016 21:56:19 +0200"],"X-IronPort-AV":"E=Sophos;i=\"5.31,565,1473112800\"; d=\"scan'208\";a=\"242872224\"","From":"Julia Lawall <Julia.Lawall@lip6.fr>","To":"Benjamin Herrenschmidt <benh@kernel.crashing.org>","Subject":"[PATCH 08/15] powerpc/iommu: use permission-specific DEVICE_ATTR\n\tvariants","Date":"Sat, 29 Oct 2016 21:37:02 +0200","Message-Id":"<1477769829-22230-9-git-send-email-Julia.Lawall@lip6.fr>","X-Mailer":"git-send-email 1.9.1","In-Reply-To":"<1477769829-22230-1-git-send-email-Julia.Lawall@lip6.fr>","References":"<1477769829-22230-1-git-send-email-Julia.Lawall@lip6.fr>","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.23","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":"Paul Mackerras <paulus@samba.org>, kernel-janitors@vger.kernel.org,\n\tlinuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.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":"Use DEVICE_ATTR_RW for read-write attributes.  This simplifies the\nsource code, improves readbility, and reduces the chance of\ninconsistencies.\n\nThe semantic patch that makes this change is as follows:\n(http://coccinelle.lip6.fr/)\n\n// <smpl>\n@rw@\ndeclarer name DEVICE_ATTR;\nidentifier x,x_show,x_store;\n@@\n\nDEVICE_ATTR(x, \\(0644\\|S_IRUGO|S_IWUSR\\), x_show, x_store);\n\n@script:ocaml@\nx << rw.x;\nx_show << rw.x_show;\nx_store << rw.x_store;\n@@\n\nif not (x^\"_show\" = x_show && x^\"_store\" = x_store)\nthen Coccilib.include_match false\n\n@@\ndeclarer name DEVICE_ATTR_RW;\nidentifier rw.x,rw.x_show,rw.x_store;\n@@\n\n- DEVICE_ATTR(x, \\(0644\\|S_IRUGO|S_IWUSR\\), x_show, x_store);\n+ DEVICE_ATTR_RW(x);\n// </smpl>\n\nSigned-off-by: Julia Lawall <Julia.Lawall@lip6.fr>\n\n---\n arch/powerpc/kernel/iommu.c |    3 +--\n 1 file changed, 1 insertion(+), 2 deletions(-)","diff":"diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c\nindex 5f202a5..32f18b5 100644\n--- a/arch/powerpc/kernel/iommu.c\n+++ b/arch/powerpc/kernel/iommu.c\n@@ -127,8 +127,7 @@ static ssize_t fail_iommu_store(struct device *dev,\n \treturn count;\n }\n \n-static DEVICE_ATTR(fail_iommu, S_IRUGO|S_IWUSR, fail_iommu_show,\n-\t\t   fail_iommu_store);\n+static DEVICE_ATTR_RW(fail_iommu);\n \n static int fail_iommu_bus_notify(struct notifier_block *nb,\n \t\t\t\t unsigned long action, void *data)\n","prefixes":["08/15"]}