Browse code

Fixed redundant else in GetDeviceStatus

Signed-off-by: Anes Hasicic <anes.hasicic@gmail.com>

Anes Hasicic authored on 2015/03/25 17:53:04
Showing 1 changed files
... ...
@@ -1549,14 +1549,16 @@ func (devices *DeviceSet) GetDeviceStatus(hash string) (*DevStatus, error) {
1549 1549
 		return nil, fmt.Errorf("Error activating devmapper device for '%s': %s", hash, err)
1550 1550
 	}
1551 1551
 
1552
-	if sizeInSectors, mappedSectors, highestMappedSector, err := devices.deviceStatus(info.DevName()); err != nil {
1552
+	sizeInSectors, mappedSectors, highestMappedSector, err := devices.deviceStatus(info.DevName())
1553
+
1554
+	if err != nil {
1553 1555
 		return nil, err
1554
-	} else {
1555
-		status.SizeInSectors = sizeInSectors
1556
-		status.MappedSectors = mappedSectors
1557
-		status.HighestMappedSector = highestMappedSector
1558 1556
 	}
1559 1557
 
1558
+	status.SizeInSectors = sizeInSectors
1559
+	status.MappedSectors = mappedSectors
1560
+	status.HighestMappedSector = highestMappedSector
1561
+
1560 1562
 	return status, nil
1561 1563
 }
1562 1564