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]
Date:	Tue, 7 Aug 2012 08:32:12 +0000
From:	"Kim, Milo" <Milo.Kim@...com>
To:	Jingoo Han <jg1.han@...sung.com>
CC:	"'Richard Purdie'" <rpurdie@...ys.net>,
	"'Andrew Morton'" <akpm@...ux-foundation.org>,
	"'LKML'" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 3/3] backlight: lp855x: remove goto err_dev

> This patch removes goto err_dev, which makes code a bit smaller.

Thanks !
IMO, goto statements are meaningful on _probe().
However, 'goto err_sysfs' also can be removed if the size of code is critical.

drivers/video/backlight/lp855x_bl.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/video/backlight/lp855x_bl.c b/drivers/video/backlight/lp855x_bl.c
index 72a0e0c..7e4198c 100644
--- a/drivers/video/backlight/lp855x_bl.c
+++ b/drivers/video/backlight/lp855x_bl.c
@@ -268,29 +268,25 @@ static int lp855x_probe(struct i2c_client *cl, const struct i2c_device_id *id)
 	if (ret) {
 		dev_err(lp->dev, "i2c communication err: %d", ret);
 		if (mode == REGISTER_BASED)
-			goto err_dev;
+			return ret;
 	}
 
 	ret = lp855x_backlight_register(lp);
 	if (ret) {
 		dev_err(lp->dev,
 			"failed to register backlight. err: %d\n", ret);
-		goto err_dev;
+		return ret;
 	}
 
 	ret = sysfs_create_group(&lp->dev->kobj, &lp855x_attr_group);
 	if (ret) {
 		dev_err(lp->dev, "failed to register sysfs. err: %d\n", ret);
-		goto err_sysfs;
+		lp855x_backlight_unregister(lp);
+		return ret;
 	}
 
 	backlight_update_status(lp->bl);
 	return 0;
-
-err_sysfs:
-	lp855x_backlight_unregister(lp);
-err_dev:
-	return ret;
 }
 
 static int __devexit lp855x_remove(struct i2c_client *cl)
-- 
1.7.2.5

Best Regards,
Milo


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists