Multiple checkpatch issues.
cover Multiple checkpatch issues.
Solved the multiple checkpatch issues.
Arushi Singhal (4):
iptables: iptables: Add blank line after declaration
iptables: iptables: Remove assignment in if condition
iptables: iptables: Indent the code.
iptables: iptables: switch and case should be at the same indent
iptables/getethertype.c | 4 ++- iptables/ip6tables-restore.c | 62 ++++++++++++++++++++++---------------------- iptables/nft-arp.c | 3 ++- iptables/xtables-arp.c | 4 +-- iptables/xtables-eb.c | 4 +-- 5 files changed, 40 insertions(+), 37 deletions(-)
Signature · 1 line
2.11.0
PATCH 1/4 iptables: iptables: Add blank line after declaration
Add blank line after the declaration of variable to follow kernel coding style.
--- iptables/getethertype.c | 1 + 1 file changed, 1 insertion(+)
iptables/getethertype.c +1 -0
@@ -75,6 +75,7 @@ struct ethertypeent *getethertypeent(void) {char *e;char *endptr; + registerchar *cp, **q; if (etherf == NULL
Signature · 1 line
2.11.0
Pablo Neira Ayuso
maintainerRe: [PATCH 1/4] iptables: iptables: Add blank line after declaration
Quoted 13 lines · Arushi Singhal
Add blank line after the declaration of variable to follow kernel coding style.
Signed-off-by Arushi Singhal <[email protected]>--- iptables/getethertype.c | 1 + 1 file changed, 1 insertion(+)iptables/getethertype.c +0
-0
iptables/getethertype.c struct ethertypeent *getethertypeent(void) · line 79
Quoted 5 lines
iptables/getethertype.c +1
-0@@ -75,6 +75,7 @@ struct ethertypeent *getethertypeent(void) {char *e;char *endptr; + registerchar *cp, **q;
I don't see any need for this new empty line.
PATCH 2/4 iptables: iptables: Remove assignment in if condition
In reply to Arushi SinghalRemove the assignment from if condition to follow kernel coding style and make the code more clear and readable.
--- iptables/getethertype.c | 3 ++- iptables/nft-arp.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
iptables/getethertype.c +2 -1
@@ -84,7 +84,8 @@ struct ethertypeent *getethertypeent(void) } again: -if ((e =fgets (line,BUFSIZ , etherf)) ==NULL ) { + e =fgets (line,BUFSIZ , etherf); +if (!e) {return (NULL ); }if (*e =='#' )
iptables/nft-arp.c +2 -1
@@ -70,7 +70,8 @@ addr_to_network(const struct in_addr *addr) {struct netent *net; -if ((net =getnetbyaddr ((long )ntohl (addr->s_addr),AF_INET )) !=NULL ) + net =getnetbyaddr ((long )ntohl (addr->s_addr),AF_INET ); +if (net)return (char *) net->n_name;return (char *)NULL ;
Signature · 1 line
2.11.0
PATCH 3/4 iptables: iptables: Indent the code.
In reply to Arushi SinghalIdent the code.
--- iptables/xtables-arp.c | 4 ++-- iptables/xtables-eb.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
iptables/xtables-arp.c +2 -2
@@ -481,8 +481,8 @@ exit_printhelp(void)" --set-counters PKTS BYTES set the counter during insert/append\n" "[!] --version -V print package version.\n");printf (" opcode strings: \n" ); -for (i =0 ; i <NUMOPCODES ; i++) -printf (" %d = %s\n" , i +1 , opcodes[i]); +for (i =0 ; i <NUMOPCODES ; i++) +printf (" %d = %s\n" , i +1 , opcodes[i]);printf (" hardware type string: 1 = Ethernet\n" " protocol type string: 0x800 = IPv4\n" );
iptables/xtables-eb.c +2 -2
@@ -327,9 +327,9 @@ static void ebt_list_extensions(const struct xtables_target *t,printf ("%s v%s\n" , prog_name, prog_vers);printf ("Loaded userspace extensions:\n" );/*printf("\nLoaded tables:\n"); -while (tbl) { +while (tbl) { printf("%s\n", tbl->name); -tbl = tbl->next; +tbl = tbl->next; }*/ printf ("\nLoaded targets:\n" );for (t = xtables_targets; t; t = t->next) {
Signature · 1 line
2.11.0
PATCH 4/4 iptables: iptables: switch and case should be at the same indent
In reply to Arushi SinghalAs per kernel coding style switch and case should be at the same identation.
--- iptables/ip6tables-restore.c | 62 ++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 31 deletions(-)
iptables/ip6tables-restore.c +31 -31
@@ -215,37 +215,37 @@ int ip6tables_restore_main(int argc, char *argv[])while ((c =getopt_long (argc, argv,"bcvthnwWM:T:" , options,NULL )) !=-1 ) {switch (c) { -case 'b' : -fprintf (stderr,"-b/--binary option is not implemented\n" ); -break ; -case 'c' : - counters =1 ; -break ; -case 'v' : - verbose =1 ; -break ; -case 't' : - testing =1 ; -break ; -case 'h' : -print_usage ("ip6tables-restore" , -IPTABLES_VERSION ); -break ; -case 'n' : - noflush =1 ; -break ; -case 'w' : - wait =parse_wait_time (argc, argv); -break ; -case 'W' : -parse_wait_interval (argc, argv, &wait_interval); -break ; -case 'M' : - xtables_modprobe_program = optarg; -break ; -case 'T' : - tablename = optarg; -break ; +case 'b' : +fprintf (stderr,"-b/--binary option is not implemented\n" ); +break ; +case 'c' : + counters =1 ; +break ; +case 'v' : + verbose =1 ; +break ; +case 't' : + testing =1 ; +break ; +case 'h' : +print_usage ("ip6tables-restore" , +IPTABLES_VERSION ); +break ; +case 'n' : + noflush =1 ; +break ; +case 'w' : + wait =parse_wait_time (argc, argv); +break ; +case 'W' : +parse_wait_interval (argc, argv, &wait_interval); +break ; +case 'M' : + xtables_modprobe_program = optarg; +break ; +case 'T' : + tablename = optarg; +break ; } }
Signature · 1 line
2.11.0