[<prev] [next>] [day] [month] [year] [list]
Message-ID: <Pine.GSO.4.63.1208200438530.6655@stinky-local.trash.net>
Date: Mon, 20 Aug 2012 04:43:53 +0200 (MEST)
From: Patrick McHardy <kaber@...sh.net>
To: Jean Sacren <sakiwit@...il.com>
cc: netfilter-devel@...r.kernel.org, netdev@...r.kernel.org
Subject: [PATCH net-next] ipv4/netfilter: remove unnecessary goto statement
for error recovery
> Usually it's a good practice to use goto statement for error recovery
> when initializing the module. This approach could be an overkill if:
>
> 1) there is only one fail case;
> 2) success and failure use the same return statement.
>
> For a cleaner approach, remove the unnecessary goto statement and
> directly implement error recovery.
We have tons of similar cases. And this is much better than directly
adding rollback since it doesn't require changing unrelated code if
anything new is added to the initialization code. Additionally its
usually directly comparable to the cleanup code.
--
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