lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4BEBFC84.5020707@trash.net>
Date:	Thu, 13 May 2010 15:20:04 +0200
From:	Patrick McHardy <kaber@...sh.net>
To:	Joe Perches <joe@...ches.com>
CC:	"David S. Miller" <davem@...emloft.net>,
	netdev <netdev@...r.kernel.org>, netfilter-devel@...r.kernel.org
Subject: Re: [PATCH net-next] net/: (netfilter related) Remove unnecessary
 returns from void function()s

Joe Perches wrote:
> This patch removes from net/ netfilter files
> all the unnecessary return; statements that precede the
> last closing brace of void functions.
> 
> It does not remove the returns that are immediately
> preceded by a label as gcc doesn't like that.
> 
> Done via:
> $ grep -rP --include=*.[ch] -l "return;\n}" net/ | \
>   xargs perl -i -e 'local $/ ; while (<>) { s/\n[ \t\n]+return;\n}/\n}/g; print; }'
> 

Applied, but I changed the patch to keep the two return statements
below in otherwise empty function bodies since I consider that more
aesthetically pleasing.

> --- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
> +++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
> @@ -452,6 +452,5 @@ module_exit(nf_conntrack_l3proto_ipv4_fini);
>  
>  void need_ipv4_conntrack(void)
>  {
> -	return;
>  }
>  EXPORT_SYMBOL_GPL(need_ipv4_conntrack);
> diff --git a/net/ipv4/netfilter/nf_nat_proto_gre.c b/net/ipv4/netfilter/nf_nat_proto_gre.c
> index d7e8920..39efbe6 100644
> --- a/net/ipv4/netfilter/nf_nat_proto_gre.c
> +++ b/net/ipv4/netfilter/nf_nat_proto_gre.c
> @@ -144,6 +144,5 @@ module_exit(nf_nat_proto_gre_fini);
>  
>  void nf_nat_need_gre(void)
>  {
> -	return;
>  }
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ