[PATCH] net: ipv4: netfilter: Remove unused function nf_nat_need_gre()

2017-04-01 Thread simran singhal
The function nf_nat_need_gre() on being called, simply returns back. The function doesn't have FIXME code around. Hence, nf_nat_need_gre() and its calls have been removed. Signed-off-by: simran singhal <singhalsimr...@gmail.com> --- net/ipv4/netfilter/nf_nat_pptp.c | 2 -- ne

Re: [PATCH v2] netfilter: Clean up tests if NULL returned on failure

2017-03-29 Thread SIMRAN SINGHAL
On Wed, Mar 29, 2017 at 2:19 PM, SIMRAN SINGHAL <singhalsimr...@gmail.com> wrote: > On Wed, Mar 29, 2017 at 12:25 PM, Jan Engelhardt <jeng...@inai.de> wrote: >> >> On Tuesday 2017-03-28 18:23, SIMRAN SINGHAL wrote: >>>On Tue, Mar 28, 2017 at 7:24 PM, Ja

Re: [PATCH v2] netfilter: Clean up tests if NULL returned on failure

2017-03-29 Thread SIMRAN SINGHAL
On Wed, Mar 29, 2017 at 12:25 PM, Jan Engelhardt <jeng...@inai.de> wrote: > > On Tuesday 2017-03-28 18:23, SIMRAN SINGHAL wrote: >>On Tue, Mar 28, 2017 at 7:24 PM, Jan Engelhardt <jeng...@inai.de> wrote: >>> On Tuesday 2017-03-28 15:13, simran singhal wrote: &g

[PATCH] net: netfilter: Use list_{next/prev}_entry instead of list_entry

2017-03-28 Thread simran singhal
This patch replace list_entry with list_prev_entry as it makes the code more clear to read. Signed-off-by: simran singhal <singhalsimr...@gmail.com> --- net/netfilter/nf_tables_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netfilter/nf_tables_api.c b/net/net

[PATCH] net: netfilter: Use seq_puts()/seq_putc() where possible

2017-03-28 Thread simran singhal
For string without format specifiers, use seq_puts(). For seq_printf("\n"), use seq_putc('\n'). Signed-off-by: simran singhal <singhalsimr...@gmail.com> --- net/netfilter/ipvs/ip_vs_ctl.c | 8 net/netfilter/nf_conntrack_expect.c | 4 ++-

[PATCH v2] net: Remove unnecessary cast on void pointer

2017-03-28 Thread simran singhal
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 ) Unnecessary parantheses are also remove. Signed-off-by: simran singhal <singhalsimr...@gmail.com> --- v2:

Re: [PATCH v2] netfilter: Clean up tests if NULL returned on failure

2017-03-28 Thread SIMRAN SINGHAL
On Tue, Mar 28, 2017 at 7:24 PM, Jan Engelhardt <jeng...@inai.de> wrote: > On Tuesday 2017-03-28 15:13, simran singhal wrote: > >>Some functions like kmalloc/kzalloc return NULL on failure. When NULL >>represents failure, !x is commonly used. >> >>@@ -9

[PATCH] netfilter: ipset: Use max macro instead of ternary operator

2017-03-28 Thread simran singhal
This patch replaces ternary operator with macro max as it shorter and thus increases code readability. Macro max return the maximum of the two compared values. Signed-off-by: simran singhal <singhalsimr...@gmail.com> --- net/netfilter/ipset/ip_set_core.c | 2 +- 1 file changed, 1 insertion

[PATCH v2] netfilter: Clean up tests if NULL returned on failure

2017-03-28 Thread simran singhal
Some functions like kmalloc/kzalloc return NULL on failure. When NULL represents failure, !x is commonly used. Signed-off-by: simran singhal <singhalsimr...@gmail.com> --- v2: -squash all the patches of the patch-set. net/netfilter/ipvs/ip_vs_ctl.c | 4 ++-- net/netfilte

[PATCH] net: Remove unnecessary cast on void pointer

2017-03-28 Thread simran singhal
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 <singhalsimr...@gmail.com> --- net/bridge/netfilter/ebtables.c | 2 +-

[PATCH v3] netfilter: Compress return logic

2017-03-28 Thread simran singhal
Simplify function returns by merging assignment and return into one statement. Signed-off-by: simran singhal <singhalsimr...@gmail.com> --- v3: -change commit message. -merge two patches into one. v2: -Change the subject of cover patch net/netfilter/ipset/ip_set_list_set

Re: [PATCH 0/5] netfilter: Clean up tests if NULL returned on failure

2017-03-22 Thread SIMRAN SINGHAL
On Wed, Mar 22, 2017 at 7:08 PM, Pablo Neira Ayuso <pa...@netfilter.org> wrote: > On Tue, Mar 21, 2017 at 02:14:34PM +0530, simran singhal wrote: >> This patch series clean up tests if NULL returned on failure. > > $ git grep "== NULL" net/netfilter/ | wc -l > 461

[PATCH v2 1/2] netfilter: ipset: Compress return logic

2017-03-21 Thread simran singhal
Simplify function returns by merging assignment and return into one command line. Signed-off-by: simran singhal <singhalsimr...@gmail.com> --- --This is my contribution to the netfilter project of Outreachy Round 14. net/netfilter/ipset/ip_set_list_set.c | 5 + 1 file chan

[PATCH v2 2/2] netfilter: ipvs: Compress return logic

2017-03-21 Thread simran singhal
Simplify function returns by merging assignment and return into one command line. Signed-off-by: simran singhal <singhalsimr...@gmail.com> --- --This is my contribution to the netfilter project of Outreachy Round 14. net/netfilter/ipvs/ip_vs_ftp.c | 5 + 1 file changed, 1 ins

[PATCH v2 0/2] netfilter: Compress return logic

2017-03-21 Thread simran singhal
This patch series Simplify function returns by merging assignment and return into one command line. v2: -Change the subject of cover patch simran singhal (2): netfilter: ipset: Compress return logic netfilter: ipvs: Compress return logic net/netfilter/ipset/ip_set_list_set.c | 5

[PATCH 1/2] netfilter: ipset: Compress return logic

2017-03-21 Thread simran singhal
Simplify function returns by merging assignment and return into one command line. Signed-off-by: simran singhal <singhalsimr...@gmail.com> --- --This is my contribution to the netfilter project of Outreachy Round 14. net/netfilter/ipset/ip_set_list_set.c | 5 + 1 file chan

[PATCH 2/2] netfilter: ipvs: Compress return logic

2017-03-21 Thread simran singhal
Simplify function returns by merging assignment and return into one command line. Signed-off-by: simran singhal <singhalsimr...@gmail.com> --- --This is my contribution to the netfilter project of Outreachy Round 14. net/netfilter/ipvs/ip_vs_ftp.c | 5 + 1 file changed, 1 ins

[PATCH 0/2] netfilter: ,netdev@vger.kernel.org

2017-03-21 Thread simran singhal
This patch series Simplify function returns by merging assignment and return into one command line. simran singhal (2): netfilter: ipset: Compress return logic netfilter: ipvs: Compress return logic net/netfilter/ipset/ip_set_list_set.c | 5 + net/netfilter/ipvs/ip_vs_ftp.c| 5

[PATCH 2/2] netfilter: Remove unnecessary cast on void pointer

2017-03-21 Thread simran singhal
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 <singhalsimr...@gmail.com> --- --This is my contribution to the netfilte

[PATCH 0/2] netfilter: Remove unnecessary cast on void pointer

2017-03-21 Thread simran singhal
This patch series remove unnecessary cast on void pointer. simran singhal (2): netfilter: ipset: Remove unnecessary cast on void pointer netfilter: Remove unnecessary cast on void pointer net/netfilter/ipset/ip_set_bitmap_gen.h | 4 ++-- net/netfilter/ipset/ip_set_core.c | 2 +- net

[PATCH 1/2] netfilter: ipset: Remove unnecessary cast on void pointer

2017-03-21 Thread simran singhal
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 <singhalsimr...@gmail.com> --- --This is my contribution to the netfilte

[PATCH 0/5] netfilter: Clean up tests if NULL returned on failure

2017-03-21 Thread simran singhal
This patch series clean up tests if NULL returned on failure. simran singhal (5): netfilter: ipvs: Clean up tests if NULL returned on failure netfilter: Clean up tests if NULL returned on failure netfilter: nf_tables_api: Clean up tests if NULL returned on failure netfilter: nfnetlink

[PATCH 1/5] netfilter: ipvs: Clean up tests if NULL returned on failure

2017-03-21 Thread simran singhal
Some functions like kmalloc/kzalloc return NULL on failure. When NULL represents failure, !x is commonly used. @@ expression *e; identifier l1; @@ e = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\)(...); ... - e == NULL + !e Signed-off-by: simran singhal <singhalsimr...@gmail.

[PATCH 2/5] netfilter: Clean up tests if NULL returned on failure

2017-03-21 Thread simran singhal
Some functions like kmalloc/kzalloc return NULL on failure. When NULL represents failure, !x is commonly used. This was done using Coccinelle: @@ expression *e; identifier l1; @@ e = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\)(...); ... - e == NULL + !e Signed-off-by: simran singhal <singhals

[PATCH 5/5] netfilter: xt_TEE: Clean up tests if NULL returned on failure

2017-03-21 Thread simran singhal
Some functions like kmalloc/kzalloc return NULL on failure. When NULL represents failure, !x is commonly used. This was done using Coccinelle: @@ expression *e; identifier l1; @@ e = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\)(...); ... - e == NULL + !e Signed-off-by: simran singhal <singhals

[PATCH 4/5] netfilter: nfnetlink: Clean up tests if NULL returned on failure

2017-03-21 Thread simran singhal
Some functions like kmalloc/kzalloc return NULL on failure. When NULL represents failure, !x is commonly used. This was done using Coccinelle: @@ expression *e; identifier l1; @@ e = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\)(...); ... - e == NULL + !e Signed-off-by: simran singhal <singhals

[PATCH 3/5] netfilter: nf_tables_api: Clean up tests if NULL returned on failure

2017-03-21 Thread simran singhal
Some functions like kmalloc/kzalloc return NULL on failure. When NULL represents failure, !x is commonly used. This was done using Coccinelle: @@ expression *e; identifier l1; @@ e = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\)(...); ... - e == NULL + !e Signed-off-by: simran singhal <singhals