mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zdev: Handle special case in if-case
As preparation for a following commit reorder the path logic in function zfcp_lun_st_get_active_attrib_path(). This then allows to handle subsequent special cases more easily. Additionally it also enhances the readability of the expression. Signed-off-by: Jens Remus <jremus@linux.ibm.com> Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com> Reviewed-by: Fedor Loshakov <loshakov@linux.ibm.com> Reviewed-by: Benjamin Block <bblock@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
+4
-4
@@ -761,10 +761,8 @@ static char *zfcp_lun_st_get_active_attrib_path(struct subtype *st,
|
||||
char *hctl, *devpath, *path;
|
||||
size_t len = strlen(SCSI_ATTR_PREFIX);
|
||||
|
||||
if (!starts_with(name, SCSI_ATTR_PREFIX) ||
|
||||
!(name[len] == 0 || name[len] == '/' ))
|
||||
devpath = path_get_zfcp_lun_dev(dev->devid);
|
||||
else {
|
||||
if (starts_with(name, SCSI_ATTR_PREFIX) &&
|
||||
(name[len] == 0 || name[len] == '/')) {
|
||||
hctl = scsi_hctl_from_zfcp_lun_devid(dev->devid);
|
||||
if (!hctl)
|
||||
return NULL;
|
||||
@@ -772,6 +770,8 @@ static char *zfcp_lun_st_get_active_attrib_path(struct subtype *st,
|
||||
free(hctl);
|
||||
|
||||
name += strlen(SCSI_ATTR_PREFIX);
|
||||
} else {
|
||||
devpath = path_get_zfcp_lun_dev(dev->devid);
|
||||
}
|
||||
|
||||
while (*name == '/')
|
||||
|
||||
Reference in New Issue
Block a user