[PATCH 4/6] staging: unisys: visorbus: git rid of gotos in register_devmajorminor_attributes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Gotos are not needed in register_devmajorminor_attributes, get rid of them.

Signed-off-by: David Kershner <david.kershner@xxxxxxxxxx>
Signed-off-by: Timothy Sell <timothy.sell@xxxxxxxxxx>
---
 drivers/staging/unisys/visorbus/visorbus_main.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c
index 37a60ec..26e0374 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -374,22 +374,19 @@ static struct kobj_type devmajorminor_kobj_type = {
 static int
 register_devmajorminor_attributes(struct visor_device *dev)
 {
-	int rc = 0, x = 0;
+	int x;
 
 	if (dev->kobjdevmajorminor.parent)
-		goto away;	/* already registered */
+		return 0;	/* already registered */
 	x = kobject_init_and_add(&dev->kobjdevmajorminor,
 				 &devmajorminor_kobj_type, &dev->device.kobj,
 				 "devmajorminor");
-	if (x < 0) {
-		rc = x;
-		goto away;
-	}
+	if (x < 0)
+		return x;
 
 	kobject_uevent(&dev->kobjdevmajorminor, KOBJ_ADD);
 
-away:
-	return rc;
+	return 0;
 }
 
 static void
-- 
1.9.1

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux