{"id":809416,"url":"http://patchwork.ozlabs.org/api/1.2/patches/809416/?format=json","web_url":"http://patchwork.ozlabs.org/project/netfilter-devel/patch/1504478435-13160-1-git-send-email-pablo@netfilter.org/","project":{"id":26,"url":"http://patchwork.ozlabs.org/api/1.2/projects/26/?format=json","name":"Netfilter Development","link_name":"netfilter-devel","list_id":"netfilter-devel.vger.kernel.org","list_email":"netfilter-devel@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<1504478435-13160-1-git-send-email-pablo@netfilter.org>","list_archive_url":null,"date":"2017-09-03T22:40:11","name":"[23/47] netfilter: constify nf_loginfo structures","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"1ba905ec8220145fa9bbf08b7131bd3c42dadb26","submitter":{"id":1315,"url":"http://patchwork.ozlabs.org/api/1.2/people/1315/?format=json","name":"Pablo Neira Ayuso","email":"pablo@netfilter.org"},"delegate":{"id":6139,"url":"http://patchwork.ozlabs.org/api/1.2/users/6139/?format=json","username":"pablo","first_name":"Pablo","last_name":"Neira","email":"pablo@netfilter.org"},"mbox":"http://patchwork.ozlabs.org/project/netfilter-devel/patch/1504478435-13160-1-git-send-email-pablo@netfilter.org/mbox/","series":[{"id":1282,"url":"http://patchwork.ozlabs.org/api/1.2/series/1282/?format=json","web_url":"http://patchwork.ozlabs.org/project/netfilter-devel/list/?series=1282","date":"2017-09-03T22:40:11","name":null,"version":1,"mbox":"http://patchwork.ozlabs.org/series/1282/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/809416/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/809416/checks/","tags":{},"related":[],"headers":{"Return-Path":"<netfilter-devel-owner@vger.kernel.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netfilter-devel-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xlnxt6VSZz9s06\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon,  4 Sep 2017 08:40:50 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1753219AbdICWkt (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tSun, 3 Sep 2017 18:40:49 -0400","from mail.us.es ([193.147.175.20]:52682 \"EHLO mail.us.es\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1753168AbdICWkt (ORCPT <rfc822; netfilter-devel@vger.kernel.org>);\n\tSun, 3 Sep 2017 18:40:49 -0400","from antivirus1-rhel7.int (unknown [192.168.2.11])\n\tby mail.us.es (Postfix) with ESMTP id 3902C190F62\n\tfor <netfilter-devel@vger.kernel.org>;\n\tMon,  4 Sep 2017 00:40:22 +0200 (CEST)","from antivirus1-rhel7.int (localhost [127.0.0.1])\n\tby antivirus1-rhel7.int (Postfix) with ESMTP id 2BCE1DA56C\n\tfor <netfilter-devel@vger.kernel.org>;\n\tMon,  4 Sep 2017 00:40:22 +0200 (CEST)","by antivirus1-rhel7.int (Postfix, from userid 99)\n\tid 21873B5028; Mon,  4 Sep 2017 00:40:22 +0200 (CEST)","from antivirus1-rhel7.int (localhost [127.0.0.1])\n\tby antivirus1-rhel7.int (Postfix) with ESMTP id 044D6B5024;\n\tMon,  4 Sep 2017 00:40:20 +0200 (CEST)","from 192.168.1.97 (192.168.1.97) by antivirus1-rhel7.int\n\t(F-Secure/fsigk_smtp/550/antivirus1-rhel7.int); \n\tMon, 04 Sep 2017 00:40:20 +0200 (CEST)","from salvia.here (unknown [31.4.193.113])\n\t(Authenticated sender: 1984lsi)\n\tby entrada.int (Postfix) with ESMTPA id 881964265A20;\n\tMon,  4 Sep 2017 00:40:17 +0200 (CEST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.1 (2015-04-28) on\n\tantivirus1-rhel7.int","X-Spam-Level":"","X-Spam-Status":"No, score=-108.2 required=7.5 tests=ALL_TRUSTED,BAYES_50,\n\tSMTPAUTH_US2,USER_IN_WHITELIST autolearn=disabled version=3.4.1","X-Virus-Status":"clean(F-Secure/fsigk_smtp/550/antivirus1-rhel7.int)","X-SMTPAUTHUS":"auth mail.us.es","From":"Pablo Neira Ayuso <pablo@netfilter.org>","To":"netfilter-devel@vger.kernel.org","Cc":"davem@davemloft.net, netdev@vger.kernel.org","Subject":"[PATCH 23/47] netfilter: constify nf_loginfo structures","Date":"Mon,  4 Sep 2017 00:40:11 +0200","Message-Id":"<1504478435-13160-1-git-send-email-pablo@netfilter.org>","X-Mailer":"git-send-email 2.1.4","X-Virus-Scanned":"ClamAV using ClamSMTP","Sender":"netfilter-devel-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netfilter-devel.vger.kernel.org>","X-Mailing-List":"netfilter-devel@vger.kernel.org"},"content":"From: Julia Lawall <julia.lawall@lip6.fr>\n\nThe nf_loginfo structures are only passed as the seventh argument to\nnf_log_trace, which is declared as const or stored in a local const\nvariable.  Thus the nf_loginfo 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 nf_loginfo i@p = { ... };\n\n@ok1@\nidentifier r.i;\nexpression list[6] es;\nposition p;\n@@\n nf_log_trace(es,&i@p,...)\n\n@ok2@\nidentifier r.i;\nconst struct nf_loginfo *e;\nposition p;\n@@\n e = &i@p\n\n@bad@\nposition p != {r.p,ok1.p,ok2.p};\nidentifier r.i;\nstruct nf_loginfo e;\n@@\ne@i@p\n\n@depends on !bad disable optional_qualifier@\nidentifier r.i;\n@@\nstatic\n+const\n struct nf_loginfo i = { ... };\n// </smpl>\n\nSigned-off-by: Julia Lawall <Julia.Lawall@lip6.fr>\nSigned-off-by: Pablo Neira Ayuso <pablo@netfilter.org>\n---\n net/ipv4/netfilter/ip_tables.c   | 2 +-\n net/ipv4/netfilter/nf_log_arp.c  | 2 +-\n net/ipv4/netfilter/nf_log_ipv4.c | 2 +-\n net/ipv6/netfilter/ip6_tables.c  | 2 +-\n net/ipv6/netfilter/nf_log_ipv6.c | 2 +-\n net/netfilter/nf_tables_core.c   | 2 +-\n net/netfilter/nfnetlink_log.c    | 2 +-\n 7 files changed, 7 insertions(+), 7 deletions(-)","diff":"diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c\nindex f47e8dad5e95..2aea896f5708 100644\n--- a/net/ipv4/netfilter/ip_tables.c\n+++ b/net/ipv4/netfilter/ip_tables.c\n@@ -151,7 +151,7 @@ static const char *const comments[] = {\n \t[NF_IP_TRACE_COMMENT_POLICY]\t= \"policy\",\n };\n \n-static struct nf_loginfo trace_loginfo = {\n+static const struct nf_loginfo trace_loginfo = {\n \t.type = NF_LOG_TYPE_LOG,\n \t.u = {\n \t\t.log = {\ndiff --git a/net/ipv4/netfilter/nf_log_arp.c b/net/ipv4/netfilter/nf_log_arp.c\nindex 2f3895ddc275..df5c2a2061a4 100644\n--- a/net/ipv4/netfilter/nf_log_arp.c\n+++ b/net/ipv4/netfilter/nf_log_arp.c\n@@ -25,7 +25,7 @@\n #include <linux/netfilter/xt_LOG.h>\n #include <net/netfilter/nf_log.h>\n \n-static struct nf_loginfo default_loginfo = {\n+static const struct nf_loginfo default_loginfo = {\n \t.type\t= NF_LOG_TYPE_LOG,\n \t.u = {\n \t\t.log = {\ndiff --git a/net/ipv4/netfilter/nf_log_ipv4.c b/net/ipv4/netfilter/nf_log_ipv4.c\nindex c83a9963269b..4388de0e5380 100644\n--- a/net/ipv4/netfilter/nf_log_ipv4.c\n+++ b/net/ipv4/netfilter/nf_log_ipv4.c\n@@ -24,7 +24,7 @@\n #include <linux/netfilter/xt_LOG.h>\n #include <net/netfilter/nf_log.h>\n \n-static struct nf_loginfo default_loginfo = {\n+static const struct nf_loginfo default_loginfo = {\n \t.type\t= NF_LOG_TYPE_LOG,\n \t.u = {\n \t\t.log = {\ndiff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c\nindex 1f90644056ac..9f6644958e5e 100644\n--- a/net/ipv6/netfilter/ip6_tables.c\n+++ b/net/ipv6/netfilter/ip6_tables.c\n@@ -176,7 +176,7 @@ static const char *const comments[] = {\n \t[NF_IP6_TRACE_COMMENT_POLICY]\t= \"policy\",\n };\n \n-static struct nf_loginfo trace_loginfo = {\n+static const struct nf_loginfo trace_loginfo = {\n \t.type = NF_LOG_TYPE_LOG,\n \t.u = {\n \t\t.log = {\ndiff --git a/net/ipv6/netfilter/nf_log_ipv6.c b/net/ipv6/netfilter/nf_log_ipv6.c\nindex 97c724224da7..b397a8fe88b9 100644\n--- a/net/ipv6/netfilter/nf_log_ipv6.c\n+++ b/net/ipv6/netfilter/nf_log_ipv6.c\n@@ -25,7 +25,7 @@\n #include <linux/netfilter/xt_LOG.h>\n #include <net/netfilter/nf_log.h>\n \n-static struct nf_loginfo default_loginfo = {\n+static const struct nf_loginfo default_loginfo = {\n \t.type\t= NF_LOG_TYPE_LOG,\n \t.u = {\n \t\t.log = {\ndiff --git a/net/netfilter/nf_tables_core.c b/net/netfilter/nf_tables_core.c\nindex c5bab08b0d73..dfd0bf3810d2 100644\n--- a/net/netfilter/nf_tables_core.c\n+++ b/net/netfilter/nf_tables_core.c\n@@ -29,7 +29,7 @@ static const char *const comments[__NFT_TRACETYPE_MAX] = {\n \t[NFT_TRACETYPE_RULE]\t= \"rule\",\n };\n \n-static struct nf_loginfo trace_loginfo = {\n+static const struct nf_loginfo trace_loginfo = {\n \t.type = NF_LOG_TYPE_LOG,\n \t.u = {\n \t\t.log = {\ndiff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c\nindex c684ba95dbb4..cad6498f10b0 100644\n--- a/net/netfilter/nfnetlink_log.c\n+++ b/net/netfilter/nfnetlink_log.c\n@@ -606,7 +606,7 @@ __build_packet_message(struct nfnl_log_net *log,\n \treturn -1;\n }\n \n-static struct nf_loginfo default_loginfo = {\n+static const struct nf_loginfo default_loginfo = {\n \t.type =\t\tNF_LOG_TYPE_ULOG,\n \t.u = {\n \t\t.ulog = {\n","prefixes":["23/47"]}