[PATCH] iptables-compat: homogenize error message

2018-05-27 Thread Arushi Singhal
There is a difference between error messages in iptables and iptables-compat: #sudo iptables-compat -D INPUT 4 iptables: No chain/target/match by that name. #sudo iptables -D INPUT 4 iptables: Index of deletion too big. Now, will show same error message. Signed-off-by: Arushi Singhal

[PATCH] net: netfilter: Merge assignment with return

2018-03-28 Thread Arushi Singhal
Merge assignment with return statement to directly return the value. Signed-off-by: Arushi Singhal --- net/netfilter/nf_conntrack_netlink.c | 5 ++--- net/netfilter/xt_hashlimit.c | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/net/netfilter

[PATCH v2] net: netfilter: Replace printk() with appropriate pr_*() macro

2018-03-11 Thread Arushi Singhal
Using pr_() is more concise than printk(KERN_). Replace printks having a log level with the appropriate pr_*() macros. Signed-off-by: Arushi Singhal --- changes in v2 *in v1 printk() were replaced with netdev_*() net/netfilter/nf_conntrack_acct.c | 2 +- net/netfilter

[PATCH v3] staging: ipx: Replace printk() with appropriate net_*macro_ratelimited()

2018-03-04 Thread Arushi Singhal
Replace printk having a log level with the appropriate net_*macro_ratelimited. It's better to use actual device name as a prefix in error messages. Signed-off-by: Arushi Singhal --- changes in v2 *In v1 printk was changed to pr_*macro(), which is used in kernel instead of calling p

[PATCH v2] staging: Replace printk() with appropriate net_*macro_ratelimited()

2018-03-04 Thread Arushi Singhal
Replace printk having a log level with the appropriate net_*macro_ratelimited. It's better to use actual device name as a prefix in error messages. Indentation is also changed, to fix the checkpatch issue. Signed-off-by: Arushi Singhal --- changes in v2 *In previous version printk was ch

[PATCH] staging: ipx: Replace printk() with appropriate pr_*() macro

2018-03-04 Thread Arushi Singhal
Using pr_() is more concise than printk(KERN_). Replace printks having a log level with the appropriate pr_*() macros. Signed-off-by: Arushi Singhal --- drivers/staging/ipx/af_ipx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ipx/af_ipx.c b/drivers

[PATCH v2] net: ethernet: Drop unnecessary continue

2018-03-03 Thread Arushi Singhal
Continue at the bottom of a loop are removed. Issue found using drop_continue.cocci Coccinelle script. Signed-off-by: Arushi Singhal --- Changes in v2: - Braces is dropped from if with single statement. drivers/net/ethernet/amd/ni65.c | 4 +--- drivers/net/ethernet/neterion

[PATCH] net: ethernet: Drop unnecessary continue

2018-03-03 Thread Arushi Singhal
Continue at the bottom of a loop are removed. Issue found using drop_continue.cocci Coccinelle script. Signed-off-by: Arushi Singhal --- drivers/net/ethernet/amd/ni65.c | 1 - drivers/net/ethernet/neterion/s2io.c | 1 - drivers/net/ethernet/netronome/nfp

[PATCH] net: netfilter: Replace explicit NULL comparisons

2017-04-08 Thread Arushi Singhal
Replace explicit NULL comparison with ! operator to simplify code. Signed-off-by: Arushi Singhal --- net/netfilter/nf_conntrack_broadcast.c | 2 +- net/netfilter/nf_conntrack_core.c | 2 +- net/netfilter/nf_conntrack_ecache.c| 4 +-- net/netfilter/nf_conntrack_helper.c| 4

[PATCH] net: netfilter: ipvs: Replace explicit NULL comparison

2017-04-08 Thread Arushi Singhal
Replace explicit NULL comparison to simplify code. Signed-off-by: Arushi Singhal --- net/netfilter/ipvs/ip_vs_ctl.c | 40 net/netfilter/ipvs/ip_vs_proto.c | 22 +++--- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/net

[PATCH] net: ipv6: Remove unneccessary comments

2017-04-08 Thread Arushi Singhal
This comments are obsolete and should go, as there are no set of rules per CPU anymore. Signed-off-by: Arushi Singhal --- net/ipv6/netfilter/ip6_tables.c | 9 - 1 file changed, 9 deletions(-) diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index

[PATCH 1/2] iptables: extensions: unnecessary cast on void pointer

2017-04-02 Thread Arushi 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: Arushi Singhal --- extensions/libarpt_mangle.c | 2 +- extensions/libip6t_rt.c | 2 +- extensi

[PATCH 2/2] iptables: iptables: unnecessary cast on void pointer

2017-04-02 Thread Arushi 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: Arushi Singhal --- iptables/nft-arp.c | 4 ++-- iptables/xtables-arp.c | 12 ++-- 2 fi

[PATCH] iptables: iptables: Remove exceptional & on function name

2017-04-02 Thread Arushi Singhal
Remove & from function pointers to conform to the style found elsewhere in the file. Done using the following semantic patch // @r@ identifier f; @@ f(...) { ... } @@ identifier r.f; @@ - &f + f // Signed-off-by: Arushi Singhal --- iptables/ip6tables-save.c | 2 +- iptables/iptable

[PATCH 1/4] net: netfilter:Remove exceptional & on function name

2017-04-02 Thread Arushi Singhal
Remove & from function pointers to conform to the style found elsewhere in the file. Done using the following semantic patch // @r@ identifier f; @@ f(...) { ... } @@ identifier r.f; @@ - &f + f // Signed-off-by: Arushi Singhal --- net/netfilter/ipset/ip_set_core.c | 2 +- net/n

[PATCH 2/4] net: bridge: Remove exceptional & on function name

2017-04-02 Thread Arushi Singhal
Remove & from function pointers to conform to the style found elsewhere in the file. Done using the following semantic patch // @r@ identifier f; @@ f(...) { ... } @@ identifier r.f; @@ - &f + f // Signed-off-by: Arushi Singhal --- net/bridge/netfilter/nft_meta_bridge.c | 2 +-

[PATCH 4/4] net: ipv6: Remove exceptional & on function name

2017-04-02 Thread Arushi Singhal
Remove & from function pointers to conform to the style found elsewhere in the file. Done using the following semantic patch // @r@ identifier f; @@ f(...) { ... } @@ identifier r.f; @@ - &f + f // Signed-off-by: Arushi Singhal --- net/ipv6/netfilter/nft_fib_ipv6.c | 2 +- 1 file

[PATCH 3/4] net: ipv4: Remove exceptional & on function name

2017-04-02 Thread Arushi Singhal
Remove & from function pointers to conform to the style found elsewhere in the file. Done using the following semantic patch // @r@ identifier f; @@ f(...) { ... } @@ identifier r.f; @@ - &f + f // Signed-off-by: Arushi Singhal --- net/ipv4/netfilter/nft_fib_ipv4.c | 2 +- 1 file

[PATCH 0/2] Simplify NULL comparisons

2017-04-01 Thread Arushi Singhal
Simplify NULL comparisons to follow kernel coding style. Arushi Singhal (2): ipv4: netfilter: Simplify NULL comparisons ipv6: netfilter: Simplify NULL comparisons net/ipv4/netfilter/arp_tables.c| 3 +-- net/ipv4/netfilter/arptable_filter.c | 2 +- net/ipv4

[PATCH 1/2] ipv4: netfilter: Simplify NULL comparisons

2017-04-01 Thread Arushi Singhal
Remove instances of explicit NULL comparisons for code compaction. Signed-off-by: Arushi Singhal --- net/ipv4/netfilter/arp_tables.c| 3 +-- net/ipv4/netfilter/arptable_filter.c | 2 +- net/ipv4/netfilter/ipt_CLUSTERIP.c | 2 +- net/ipv4/netfilter

[PATCH 2/2] ipv6: netfilter: Simplify NULL comparisons

2017-04-01 Thread Arushi Singhal
Remove instances of explicit NULL comparisons for code compaction. Signed-off-by: Arushi Singhal --- net/ipv6/netfilter/ip6t_SYNPROXY.c | 16 net/ipv6/netfilter/ip6t_ipv6header.c | 2 +- net/ipv6/netfilter/ip6table_filter.c | 2 +- net/ipv6

[PATCH] ipv4: netfilter: Comparison to NULL could be written

2017-04-01 Thread Arushi Singhal
Fixed coding style for null comparisons to be more consistant with the rest of the kernel coding style. Signed-off-by: Arushi Singhal --- net/ipv4/netfilter/arp_tables.c| 2 +- net/ipv4/netfilter/arptable_filter.c | 2 +- net/ipv4/netfilter/ipt_CLUSTERIP.c

[PATCH v2] net: netfilter: remove unused variable

2017-03-29 Thread Arushi Singhal
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 = +return f(...); -return len; Signed-off-by: Arushi

[PATCH] net: netfilter: remove unused variable

2017-03-29 Thread Arushi Singhal
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 = +return f(...); -return len; Signed-off-by: Arushi

[PATCH] net: ipv6: Removed unnecessary parenthesis

2017-03-29 Thread Arushi Singhal
Removed parentheses on the right hand side of assignment, as they are not required. The following coccinelle script was used to fix this issue: @@ local idexpression id; expression e; @@ id = -( e -) Signed-off-by: Arushi Singhal --- net/ipv6/netfilter/nf_conntrack_reasm.c | 4 ++-- 1 file

[PATCH] net: netfilter: Replace explicit NULL comparison with ! operator

2017-03-29 Thread Arushi Singhal
Replace explicit NULL comparison with ! operator to simplify code. Signed-off-by: Arushi Singhal --- net/netfilter/ipvs/ip_vs_ctl.c | 8 ++--- net/netfilter/ipvs/ip_vs_proto.c | 8 ++--- net/netfilter/nf_conntrack_broadcast.c | 2 +- net/netfilter/nf_conntrack_core.c | 2

[PATCH] net: netfilterL: Fix line over 80 characters.

2017-03-29 Thread Arushi Singhal
fix the line over 80 characters as reported by checkpatch.pl Signed-off-by: Arushi Singhal --- net/ipv6/netfilter/ip6_tables.c| 6 -- net/ipv6/netfilter/ip6t_SYNPROXY.c | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6

[PATCH] net: ipv6: Removed unnecessary parenthesis

2017-03-29 Thread Arushi Singhal
Removed parentheses on the right hand side of assignment, as they are not required. The following coccinelle script was used to fix this issue: @@ local idexpression id; expression e; @@ id = -( e -) Signed-off-by: Arushi Singhal --- net/ipv6/netfilter/nf_conntrack_reasm.c | 4 ++-- 1 file

[PATCH] net: ipv6: netfilter: Format block comments.

2017-03-29 Thread Arushi Singhal
Fix checkpatch warnings: WARNING: Block comments use a trailing */ on a separate line WARNING: Block comments use * on subsequent lines Signed-off-by: Arushi Singhal --- net/ipv6/netfilter/ip6_tables.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/net/ipv6

[PATCH] net: netfilter: replace explicit NULL comparison with ! operator

2017-03-28 Thread Arushi Singhal
Replace explicit NULL comparison with ! operator to simplify code. Signed-off-by: Arushi Singhal --- net/netfilter/ipvs/ip_vs_ctl.c | 8 ++--- net/netfilter/ipvs/ip_vs_proto.c | 8 ++--- net/netfilter/nf_conntrack_broadcast.c | 2 +- net/netfilter/nf_conntrack_core.c | 2

[PATCH] net: bridge: netfilter: Comparison to NULL could be written

2017-03-28 Thread Arushi Singhal
Fixed coding style for null comparisons to be more consistant with the rest of the kernel coding style. Signed-off-by: Arushi Singhal --- net/bridge/netfilter/ebt_among.c | 12 ++-- net/bridge/netfilter/ebt_arp.c | 10 +- net/bridge/netfilter/ebt_arpreply.c

[PATCH] net: ipv6: netfilter: replace explicit NULL comparison with ! operator

2017-03-28 Thread Arushi Singhal
Replace explicit NULL comparison with ! operator to simplify code. Signed-off-by: Arushi Singhal --- net/ipv6/netfilter/ip6_tables.c| 4 ++-- net/ipv6/netfilter/ip6t_SYNPROXY.c | 16 net/ipv6/netfilter/ip6t_ah.c | 2 +- net/ipv6

[PATCH] net: netfilter: Remove typedef from "typedef struct bitstr_t".

2017-03-28 Thread Arushi Singhal
This patch removes typedefs from struct and renames it from "typedef struct bitstr_t" to "struct bitstr" as per kernel coding standards." Signed-off-by: Arushi Singhal --- net/netfilter/nf_conntrack_h323_asn1.c | 80 +- 1 file chan

[PATCH v3] net: netfilter: Add nfnl_msg_type() helper function

2017-03-28 Thread Arushi Singhal
To remove complexity of code the function is added in nfnetlink.h to make code more clear and readable. This is opencoded in a way that makes it error prone for future netfilter netlink subsystems. Signed-off-by: Arushi Singhal --- changes in v3 -make the subject more clear. include/linux

[PATCH v2] net: netfilter: add nfnl_msg_type() helper function

2017-03-28 Thread Arushi Singhal
To remove complexity of code the function is added in nfnetlink.h to make code more clear and readable. This is opencoded in a way that makes it error prone for future netfilter netlink subsystems. Signed-off-by: Arushi Singhal --- changes in v2 - make the patch title more relevant - make the

[PATCH] net: netfilters: Remove unnecessary parenthesis

2017-03-28 Thread Arushi Singhal
Rmoved parentheses on the right hand side of assignment, as they are not required. The following coccinelle script was used to fix this issue: @@ local idexpression id; expression e; @@ id = -( e -) Signed-off-by: Arushi Singhal --- net/netfilter/ipvs/ip_vs_proto_tcp.c | 2 +- net/netfilter

[PATCH] net: netfilter: Remove complexity

2017-03-28 Thread Arushi Singhal
To remove complexity of code the function is added in nfnetlink.h to make code more clear and readable. Signed-off-by: Arushi Singhal --- include/linux/netfilter/nfnetlink.h | 6 ++ net/netfilter/nf_conntrack_netlink.c | 12 +++- 2 files changed, 13 insertions(+), 5 deletions

[PATCH v2] net: netfilter: Remove multiple assignment.

2017-03-27 Thread Arushi Singhal
This patch removes multiple assignments to follow the kernel coding style as also reported by checkpatch.pl. Done using coccinelle. @@ identifier i1,i2; constant c; @@ - i1=i2=c; + i1=c; + i2=i1; Signed-off-by: Arushi Singhal --- changes in v2 -Make the commit message more clear and appropriate

[PATCH] net: netfilters: Remove extra parenthesis

2017-03-25 Thread Arushi Singhal
Rmoved parentheses on the right hand side of assignment, as they are not required. The following coccinelle script was used to fix this issue: @@ local idexpression id; expression e; @@ id = -( e -) Signed-off-by: Arushi Singhal --- net/netfilter/ipvs/ip_vs_proto_tcp.c | 2 +- net/netfilter

[PATCH] net: netfilter: Remove multiple assignment.

2017-03-25 Thread Arushi Singhal
This patch removes multiple assignments. Done using coccinelle. @@ identifier i1,i2; constant c; @@ - i1=i2=c; + i1=c; + i2=c; Signed-off-by: Arushi Singhal --- contribution to outreachy netfilter project. net/netfilter/nf_conntrack_proto_sctp.c | 3 ++- 1 file changed, 2 insertions(+), 1

[PATCH 0/2] net: netfilters: Remove typedef

2017-03-25 Thread Arushi Singhal
Remove typedef from struct. Arushi Singhal (2): net: netfilter: Remove typedef from "typedef struct field_t" net: netfilter: Remove typedef from "typedef struct bitstr_t" net/netfilter/nf_conntrack_h323_asn1.c | 98 +- 1 file changed,

[PATCH 2/2] net: netfilter: Remove typedef from "typedef struct bitstr_t"

2017-03-25 Thread Arushi Singhal
This patch removes typedefs from struct and renames it from "typedef struct bitstr_t" to "struct bitstr" as per kernel coding standards." Signed-off-by: Arushi Singhal --- net/netfilter/nf_conntrack_h323_asn1.c | 80 +- 1 file chan

[PATCH 1/2] net: netfilter: Remove typedef from "typedef struct field_t"

2017-03-25 Thread Arushi Singhal
This patch removes typedefs from struct and renames it from "typedef struct field_t" to "struct field" as per kernel coding standards." Signed-off-by: Arushi Singhal --- net/netfilter/nf_conntrack_h323_asn1.c | 68 +- 1 file chan