Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/796889/?format=api
{ "id": 796889, "url": "http://patchwork.ozlabs.org/api/patches/796889/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/1501707705-32425-1-git-send-email-Julia.Lawall@lip6.fr/", "project": { "id": 2, "url": "http://patchwork.ozlabs.org/api/projects/2/?format=api", "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": "<1501707705-32425-1-git-send-email-Julia.Lawall@lip6.fr>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/1501707705-32425-1-git-send-email-Julia.Lawall@lip6.fr/", "date": "2017-08-02T21:01:45", "name": "powerpc/macintosh: constify wf_sensor_ops structures", "commit_ref": "de854e54d79bc0ad5c45c5be50821b1c0639cb75", "pull_url": null, "state": "accepted", "archived": false, "hash": "b372559f97b1278d34bd40ed5feadcfd52e0d1e8", "submitter": { "id": 10041, "url": "http://patchwork.ozlabs.org/api/people/10041/?format=api", "name": "Julia Lawall", "email": "julia.lawall@lip6.fr" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/1501707705-32425-1-git-send-email-Julia.Lawall@lip6.fr/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/796889/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/796889/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 ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xN5sJ12rpz9rxl\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 3 Aug 2017 07:28:36 +1000 (AEST)", "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xN5sJ07HkzDqty\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 3 Aug 2017 07:28:36 +1000 (AEST)", "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 3xN5qm5pghzDqfm\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tThu, 3 Aug 2017 07:27:13 +1000 (AEST)", "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\t02 Aug 2017 23:27:08 +0200" ], "X-IronPort-AV": "E=Sophos;i=\"5.41,313,1498514400\"; d=\"scan'208\";a=\"285883633\"", "From": "Julia Lawall <Julia.Lawall@lip6.fr>", "To": "Benjamin Herrenschmidt <benh@kernel.crashing.org>", "Subject": "[PATCH] powerpc/macintosh: constify wf_sensor_ops structures", "Date": "Wed, 2 Aug 2017 23:01:45 +0200", "Message-Id": "<1501707705-32425-1-git-send-email-Julia.Lawall@lip6.fr>", "X-Mailer": "git-send-email 1.9.1", "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": "linuxppc-dev@lists.ozlabs.org, kernel-janitors@vger.kernel.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>" }, "content": "The wf_sensor_ops structures are only stored in the ops field of a\nwf_sensor structure, which is declared as const. Thus the\nwf_sensor_ops structures themselves can be const.\n\nDone with the help of Coccinelle.\n\n// <smpl>\n@r disable optional_qualifier@\nidentifier i;\nposition p;\n@@\nstatic struct wf_sensor_ops i@p = { ... };\n\n@ok1@\nidentifier r.i;\nstruct wf_sensor s;\nposition p;\n@@\ns.ops = &i@p\n\n@ok2@\nidentifier r.i;\nstruct wf_sat_sensor s;\nposition p;\n@@\ns.sens.ops = &i@p\n\n@bad@\nposition p != {r.p,ok1.p,ok2.p};\nidentifier r.i;\nstruct wf_sensor_ops e;\n@@\ne@i@p\n\n@depends on !bad disable optional_qualifier@\nidentifier r.i;\n@@\nstatic\n+const\n struct wf_sensor_ops i = { ... };\n// </smpl>\n\nSigned-off-by: Julia Lawall <Julia.Lawall@lip6.fr>\n\n---\n drivers/macintosh/windfarm_lm75_sensor.c | 2 +-\n drivers/macintosh/windfarm_lm87_sensor.c | 2 +-\n drivers/macintosh/windfarm_max6690_sensor.c | 2 +-\n drivers/macintosh/windfarm_smu_sat.c | 2 +-\n drivers/macintosh/windfarm_smu_sensors.c | 10 +++++-----\n 5 files changed, 9 insertions(+), 9 deletions(-)", "diff": "diff --git a/drivers/macintosh/windfarm_lm75_sensor.c b/drivers/macintosh/windfarm_lm75_sensor.c\nindex 590214b..6cdfe71 100644\n--- a/drivers/macintosh/windfarm_lm75_sensor.c\n+++ b/drivers/macintosh/windfarm_lm75_sensor.c\n@@ -82,7 +82,7 @@ static void wf_lm75_release(struct wf_sensor *sr)\n \tkfree(lm);\n }\n \n-static struct wf_sensor_ops wf_lm75_ops = {\n+static const struct wf_sensor_ops wf_lm75_ops = {\n \t.get_value\t= wf_lm75_get,\n \t.release\t= wf_lm75_release,\n \t.owner\t\t= THIS_MODULE,\ndiff --git a/drivers/macintosh/windfarm_lm87_sensor.c b/drivers/macintosh/windfarm_lm87_sensor.c\nindex c071aab..273d7d4 100644\n--- a/drivers/macintosh/windfarm_lm87_sensor.c\n+++ b/drivers/macintosh/windfarm_lm87_sensor.c\n@@ -91,7 +91,7 @@ static void wf_lm87_release(struct wf_sensor *sr)\n \tkfree(lm);\n }\n \n-static struct wf_sensor_ops wf_lm87_ops = {\n+static const struct wf_sensor_ops wf_lm87_ops = {\n \t.get_value\t= wf_lm87_get,\n \t.release\t= wf_lm87_release,\n \t.owner\t\t= THIS_MODULE,\ndiff --git a/drivers/macintosh/windfarm_max6690_sensor.c b/drivers/macintosh/windfarm_max6690_sensor.c\nindex 87e439b..6ad035e 100644\n--- a/drivers/macintosh/windfarm_max6690_sensor.c\n+++ b/drivers/macintosh/windfarm_max6690_sensor.c\n@@ -55,7 +55,7 @@ static void wf_max6690_release(struct wf_sensor *sr)\n \tkfree(max);\n }\n \n-static struct wf_sensor_ops wf_max6690_ops = {\n+static const struct wf_sensor_ops wf_max6690_ops = {\n \t.get_value\t= wf_max6690_get,\n \t.release\t= wf_max6690_release,\n \t.owner\t\t= THIS_MODULE,\ndiff --git a/drivers/macintosh/windfarm_smu_sat.c b/drivers/macintosh/windfarm_smu_sat.c\nindex ad6223e..5a58fc2 100644\n--- a/drivers/macintosh/windfarm_smu_sat.c\n+++ b/drivers/macintosh/windfarm_smu_sat.c\n@@ -195,7 +195,7 @@ static void wf_sat_sensor_release(struct wf_sensor *sr)\n \tkref_put(&sat->ref, wf_sat_release);\n }\n \n-static struct wf_sensor_ops wf_sat_ops = {\n+static const struct wf_sensor_ops wf_sat_ops = {\n \t.get_value\t= wf_sat_sensor_get,\n \t.release\t= wf_sat_sensor_release,\n \t.owner\t\t= THIS_MODULE,\ndiff --git a/drivers/macintosh/windfarm_smu_sensors.c b/drivers/macintosh/windfarm_smu_sensors.c\nindex 1cc4e49..172fd26 100644\n--- a/drivers/macintosh/windfarm_smu_sensors.c\n+++ b/drivers/macintosh/windfarm_smu_sensors.c\n@@ -172,22 +172,22 @@ static int smu_slotspow_get(struct wf_sensor *sr, s32 *value)\n }\n \n \n-static struct wf_sensor_ops smu_cputemp_ops = {\n+static const struct wf_sensor_ops smu_cputemp_ops = {\n \t.get_value\t= smu_cputemp_get,\n \t.release\t= smu_ads_release,\n \t.owner\t\t= THIS_MODULE,\n };\n-static struct wf_sensor_ops smu_cpuamp_ops = {\n+static const struct wf_sensor_ops smu_cpuamp_ops = {\n \t.get_value\t= smu_cpuamp_get,\n \t.release\t= smu_ads_release,\n \t.owner\t\t= THIS_MODULE,\n };\n-static struct wf_sensor_ops smu_cpuvolt_ops = {\n+static const struct wf_sensor_ops smu_cpuvolt_ops = {\n \t.get_value\t= smu_cpuvolt_get,\n \t.release\t= smu_ads_release,\n \t.owner\t\t= THIS_MODULE,\n };\n-static struct wf_sensor_ops smu_slotspow_ops = {\n+static const struct wf_sensor_ops smu_slotspow_ops = {\n \t.get_value\t= smu_slotspow_get,\n \t.release\t= smu_ads_release,\n \t.owner\t\t= THIS_MODULE,\n@@ -327,7 +327,7 @@ static int smu_cpu_power_get(struct wf_sensor *sr, s32 *value)\n \treturn 0;\n }\n \n-static struct wf_sensor_ops smu_cpu_power_ops = {\n+static const struct wf_sensor_ops smu_cpu_power_ops = {\n \t.get_value\t= smu_cpu_power_get,\n \t.release\t= smu_cpu_power_release,\n \t.owner\t\t= THIS_MODULE,\n", "prefixes": [] }