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: <alpine.DEB.2.02.1402132327480.1967@localhost6.localdomain6>
Date:	Thu, 13 Feb 2014 23:28:27 +0100 (CET)
From:	Julia Lawall <julia.lawall@...6.fr>
To:	Dave Jones <davej@...hat.com>
cc:	Julia Lawall <julia.lawall@...6.fr>, Joe Perches <joe@...ches.com>,
	Stephen Hemminger <stephen@...workplumber.org>,
	David Miller <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [PATCH net-next] net: remove unnecessary return's



On Thu, 13 Feb 2014, Dave Jones wrote:

> On Thu, Feb 13, 2014 at 10:55:23PM +0100, Julia Lawall wrote:
> 
>  > The patch below converts label: return; } to label: ; }.  I have only 
>  > scanned through the patches, not patched the code and looked at the 
>  > results, so I am not sure that it is completely correct.  On the other 
>  > hand, I'm also not sure that label: ; } is better than label: return; }, 
>  > either.  If people think it is, then I can cheack the results in more 
>  > detail.
> 
> Why not delete the label, and just replace the goto with a return if
> the label is at the end of the function ?

Here is an example.  Perhaps the uniformity of the if ... goto pattern is 
valuable, though?

julia

diff -u -p a/drivers/mfd/ab3100-core.c b/drivers/mfd/ab3100-core.c
--- a/drivers/mfd/ab3100-core.c
+++ b/drivers/mfd/ab3100-core.c
@@ -586,7 +586,7 @@ static void ab3100_setup_debugfs(struct
 
 	ab3100_dir = debugfs_create_dir("ab3100", NULL);
 	if (!ab3100_dir)
-		goto exit_no_debugfs;
+		return;
 
 	ab3100_reg_file = debugfs_create_file("registers",
 				S_IRUGO, ab3100_dir, ab3100,
@@ -623,7 +623,6 @@ static void ab3100_setup_debugfs(struct
 	debugfs_remove(ab3100_reg_file);
  exit_destroy_dir:
 	debugfs_remove(ab3100_dir);
- exit_no_debugfs:
 	return;
 }
 static inline void ab3100_remove_debugfs(void)
--
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