[PATCH] netfilter: nf_tables: fix odd_ptr_err.cocci warnings

2018-01-11 Thread Julia Lawall
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: b4464bcab38d3f7fe995a7cb960eeac6889bec08 commit: 3b49e2e94e6ebb8b23d0955d9e898254455734f8 [8286/9035] netfilter: nf_tables: add flow table netlink frontend The following is a 0-day report generated by Coccinel

Re: [Outreachy kernel] [PATCH] src: buffer is not null terminated

2017-10-08 Thread Julia Lawall
The subject line is not very clear. Apparently, some buffer (which one?) is not null terminated (but what will you do about it?). It would be better to say what is done inthe subject line, eg Use snprintf rather than strncpy, and then as you already do explain why the change is desirable in the c

[PATCH nf-next] netfilter: constify nf_loginfo structures

2017-08-01 Thread Julia Lawall
@@ e@i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct nf_loginfo i = { ... }; // Signed-off-by: Julia Lawall --- net/ipv4/netfilter/ip_tables.c |2 +- net/ipv4/netfilter/nf_log_arp.c |2 +- net/ipv4/netfilter/nf_log_ipv4.c |2 +- net/ipv6/n

[PATCH 1/1 v3 nf-next] netfilter: constify nf_conntrack_l3/4proto parameters

2017-08-01 Thread Julia Lawall
making some nf_conntrack_l3/4proto structures const subsequently. Done with the help of Coccinelle. Signed-off-by: Julia Lawall --- v3: Rebased against nf-next. Some functions, such as nf_ct_l3proto_pernet_register, are no longer defined, so they are no longer updated. include/net/netfilter

[PATCH 0/1 v3 nf-next] constify nf_conntrack_l3/4proto parameters

2017-08-01 Thread Julia Lawall
When a nf_conntrack_l3/4proto parameter is not on the left hand side of an assignment, its address is not taken, and it is not passed to a function that may modify its fields, then it can be declared as const. This change is useful from a documentation point of view, and can possibly facilitate ma

[PATCH 0/1 v2] constify nf_conntrack_l3/4proto parameters

2017-07-30 Thread Julia Lawall
When a nf_conntrack_l3/4proto parameter is not on the left hand side of an assignment, its address is not taken, and it is not passed to a function that may modify its fields, then it can be declared as const. This change is useful from a documentation point of view, and can possibly facilitate ma

[PATCH 1/1 v2] netfilter: constify nf_conntrack_l3/4proto parameters

2017-07-30 Thread Julia Lawall
making some nf_conntrack_l3/4proto structures const subsequently. Done with the help of Coccinelle. Some spacing adjusted to fit within 80 characters. Signed-off-by: Julia Lawall --- v2: Added consideration of array parameters. This adds transformation of nf_ct_l4proto_pernet_register and

Re: [PATCH 1/1] netfilter: constify nf_conntrack_l3/4proto parameters

2017-07-29 Thread Julia Lawall
On Sat, 29 Jul 2017, Florian Westphal wrote: > Julia Lawall wrote: > > When a nf_conntrack_l3/4proto parameter is not on the left hand side > > of an assignment, its address is not taken, and it is not passed to a > > function that may modify its fields, then it can

[PATCH 0/1] constify nf_conntrack_l3/4proto parameters

2017-07-29 Thread Julia Lawall
When a nf_conntrack_l3/4proto parameter is not on the left hand side of an assignment, its address is not taken, and it is not passed to a function that may modify its fields, then it can be declared as const. This change is useful from a documentation point of view, and can possibly facilitate ma

[PATCH 1/1] netfilter: constify nf_conntrack_l3/4proto parameters

2017-07-29 Thread Julia Lawall
making some nf_conntrack_l3/4proto structures const subsequently. Done with the help of Coccinelle. Some spacing adjusted to fit within 80 characters. Signed-off-by: Julia Lawall --- include/net/netfilter/nf_conntrack_l3proto.h |6 +++--- include/net/netfilter/nf_conntrack_l4proto.h |8

Re: [PATCH 0/2] constify nf_hook_ops structures

2017-07-29 Thread Julia Lawall
On Sat, 29 Jul 2017, Florian Westphal wrote: > Julia Lawall wrote: > > On Sat, 29 Jul 2017, Florian Westphal wrote: > > > From a quick glance I don't see why we can't e.g. constify > > > nf_conntrack_l3/4_proto too. It is not going to be as simple > >

Re: [PATCH 0/2] constify nf_hook_ops structures

2017-07-29 Thread Julia Lawall
On Sat, 29 Jul 2017, Florian Westphal wrote: > Julia Lawall wrote: > > > > > > On Sat, 29 Jul 2017, Florian Westphal wrote: > > > > > Julia Lawall wrote: > > > > The nf_hook_ops structure is only passed as the second argument to > > >

Re: [PATCH 0/2] constify nf_hook_ops structures

2017-07-29 Thread Julia Lawall
On Sat, 29 Jul 2017, Florian Westphal wrote: > Julia Lawall wrote: > > The nf_hook_ops structure is only passed as the second argument to > > nf_register_net_hook or nf_unregister_net_hook, both of which are > > declared as const. Thus the nf_hook_ops structure it

[PATCH 2/2] netfilter: ipt_CLUSTERIP: constify nf_hook_ops structures

2017-07-29 Thread Julia Lawall
r.i; @@ static +const struct nf_hook_ops i = { ... }; // Signed-off-by: Julia Lawall --- net/ipv4/netfilter/ipt_CLUSTERIP.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c index efaa04d..17b4ca5 10

[PATCH 1/2] decnet: dn_rtmsg: constify nf_hook_ops structures

2017-07-29 Thread Julia Lawall
r.i; @@ static +const struct nf_hook_ops i = { ... }; // Signed-off-by: Julia Lawall --- net/decnet/netfilter/dn_rtmsg.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/decnet/netfilter/dn_rtmsg.c b/net/decnet/netfilter/dn_rtmsg.c index aa8ffec..ab395e5 100644 --- a

[PATCH 0/2] constify nf_hook_ops structures

2017-07-29 Thread Julia Lawall
The nf_hook_ops structure is only passed as the second argument to nf_register_net_hook or nf_unregister_net_hook, both of which are declared as const. Thus the nf_hook_ops structure itself can be const. Done with the help of Coccinelle. --- net/decnet/netfilter/dn_rtmsg.c|2 +- net/ip

Re: [Outreachy kernel] [PATCH] net: netfilter: remove unused variable

2017-03-29 Thread Julia Lawall
On Wed, 29 Mar 2017, Arushi Singhal wrote: > This patch uses the following coccinelle script to remove > a variable that was simply used to store the return > value of a function call before returning it: > > @@ > identifier len,f; > @@ > > -int len; > ... when != len > when strict > -len

Re: [Outreachy kernel] [PATCH] net: Remove unnecessary cast on void pointer

2017-03-28 Thread Julia Lawall
On Tue, 28 Mar 2017, simran singhal wrote: > The following Coccinelle script was used to detect this: > @r@ > expression x; > void* e; > type T; > identifier f; > @@ > ( > *((T *)e) > | > ((T *)x)[...] > | > ((T*)x)->f > | > > - (T*) > e > ) > > Signed-off-by: simran singhal > --- > ne

Re: [Outreachy kernel] Re: [PATCH] iptables: Constify option struct

2017-03-27 Thread Julia Lawall
On Tue, 28 Mar 2017, Gargi Sharma wrote: > On Tue, Mar 28, 2017 at 12:45 AM, Gargi Sharma wrote: > > On Tue, Mar 28, 2017 at 12:42 AM, Pablo Neira Ayuso > > wrote: > >> > >> On Tue, Mar 28, 2017 at 12:40:15AM +0530, Gargi Sharma wrote: > >> > The struct of the type option is only used to ini

Re: [PATCH V2] audit: normalize NETFILTER_PKT (fwd)

2017-02-22 Thread Julia Lawall
-- Date: Thu, 23 Feb 2017 12:43:05 +0800 From: kbuild test robot To: kbu...@01.org Cc: Julia Lawall Subject: Re: [PATCH V2] audit: normalize NETFILTER_PKT CC: kbuild-...@01.org In-Reply-To: <9504740e9333a0b7074abe0dddfc487aeeae6cff.1487813996.git@redhat.com> Hi Richard, [auto buil

[PATCH] netfilter: x_tables: simplify IS_ERR_OR_NULL to NULL test

2016-11-11 Thread Julia Lawall
... when != t=e - IS_ERR_OR_NULL(t) + !t @@ expression t,e,e1; @@ t = \(xt_find_table_lock(...)\| try_then_request_module(xt_find_table_lock(...),...)\) ... when != t=e ?- t ? PTR_ERR(t) : e1 + e1 ... when any // Signed-off-by: Julia Lawall --- net/ipv4/netfilter/arp_

Re: question about xt_find_table_lock

2016-11-11 Thread Julia Lawall
On Fri, 11 Nov 2016, Florian Westphal wrote: > Julia Lawall wrote: > > The function xt_find_table_lock defined in net/netfilter/x_tables.c is > > preceeded by a comment that says that it returns ERR_PTR() on error. But > > looking at the definition, I only see occurrenc

question about xt_find_table_lock

2016-11-11 Thread Julia Lawall
The function xt_find_table_lock defined in net/netfilter/x_tables.c is preceeded by a comment that says that it returns ERR_PTR() on error. But looking at the definition, I only see occurrences of return NULL and returns of pointers that have previously been dereferenced. Is it the code or the do

Re: unused code in net/netfilter/ipset/ip_set_bitmap_ipmac.c

2016-02-29 Thread Julia Lawall
On Mon, 29 Feb 2016, Jozsef Kadlecsik wrote: > Hi, > > On Mon, 29 Feb 2016, Julia Lawall wrote: > > > The file net/netfilter/ipset/ip_set_bitmap_ipmac.c seems to contain a lot > > of static functions that are not used in the file: > > > > bitmap_ipmac

unused code in net/netfilter/ipset/ip_set_bitmap_ipmac.c

2016-02-29 Thread Julia Lawall
The file net/netfilter/ipset/ip_set_bitmap_ipmac.c seems to contain a lot of static functions that are not used in the file: bitmap_ipmac_add_timeout bitmap_ipmac_do_add bitmap_ipmac_do_del bitmap_ipmac_do_head bitmap_ipmac_do_list bitmap_ipmac_do_test bitmap_ipmac_gc_test bitmap_ipmac_is_filled b