[{"id":1761696,"web_url":"http://patchwork.ozlabs.org/comment/1761696/","msgid":"<3xkKq244Czz9t3F@ozlabs.org>","date":"2017-09-01T13:29:50","subject":"Re: powerpc/macintosh: constify wf_sensor_ops structures","submitter":{"id":69509,"url":"http://patchwork.ozlabs.org/api/people/69509/","name":"Michael Ellerman","email":"patch-notifications@ellerman.id.au"},"content":"On Wed, 2017-08-02 at 21:01:45 UTC, Julia Lawall wrote:\n> The wf_sensor_ops structures are only stored in the ops field of a\n> wf_sensor structure, which is declared as const.  Thus the\n> wf_sensor_ops structures themselves can be const.\n> \n> Done with the help of Coccinelle.\n> \n> // <smpl>\n> @r disable optional_qualifier@\n> identifier i;\n> position p;\n> @@\n> static struct wf_sensor_ops i@p = { ... };\n> \n> @ok1@\n> identifier r.i;\n> struct wf_sensor s;\n> position p;\n> @@\n> s.ops = &i@p\n> \n> @ok2@\n> identifier r.i;\n> struct wf_sat_sensor s;\n> position p;\n> @@\n> s.sens.ops = &i@p\n> \n> @bad@\n> position p != {r.p,ok1.p,ok2.p};\n> identifier r.i;\n> struct wf_sensor_ops e;\n> @@\n> e@i@p\n> \n> @depends on !bad disable optional_qualifier@\n> identifier r.i;\n> @@\n> static\n> +const\n>  struct wf_sensor_ops i = { ... };\n> // </smpl>\n> \n> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>\n\nApplied to powerpc next, thanks.\n\nhttps://git.kernel.org/powerpc/c/de854e54d79bc0ad5c45c5be50821b\n\ncheers","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 [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xkL256P3mz9sRV\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri,  1 Sep 2017 23:39:25 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xkL255QJWzDr33\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri,  1 Sep 2017 23:39:25 +1000 (AEST)","from ozlabs.org (bilbo.ozlabs.org [103.22.144.67])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xkKq25bFXzDqkb\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tFri,  1 Sep 2017 23:29:50 +1000 (AEST)","by ozlabs.org (Postfix, from userid 1034)\n\tid 3xkKq244Czz9t3F; Fri,  1 Sep 2017 23:29:50 +1000 (AEST)"],"X-powerpc-patch-notification":"thanks","X-powerpc-patch-commit":"de854e54d79bc0ad5c45c5be50821b1c0639cb75","In-Reply-To":"<1501707705-32425-1-git-send-email-Julia.Lawall@lip6.fr>","To":"Julia Lawall <Julia.Lawall@lip6.fr>,\n\tBenjamin Herrenschmidt <benh@kernel.crashing.org>","From":"Michael Ellerman <patch-notifications@ellerman.id.au>","Subject":"Re: powerpc/macintosh: constify wf_sensor_ops structures","Message-Id":"<3xkKq244Czz9t3F@ozlabs.org>","Date":"Fri,  1 Sep 2017 23:29:50 +1000 (AEST)","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":"kernel-janitors@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,\n\tlinux-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>"}}]