From eea97da1c42e379e824cd89590db88c8dfa1c647 Mon Sep 17 00:00:00 2001 From: Wen Xiong Date: Wed, 24 Oct 2012 09:56:21 -0500 Subject: [PATCH] iprutils: fix_for_lsvpd_disk_location This patch fixes the platform location for hard disk. Now platform location for hard disk is combined location of ses and physical location slot number. signed-off-by: wenxiong@linux.vnet.ibm.com --- iprconfig.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/iprconfig.c b/iprconfig.c index 6d721e8..8c9133b 100644 --- a/iprconfig.c +++ b/iprconfig.c @@ -2501,19 +2501,23 @@ int get_drive_phy_loc_with_ses_phy_loc(struct ipr_dev *ses, struct drive_elem_de char unit_phy_loc[PHYSICAL_LOCATION_LENGTH+1]; ipr_strncpy_0(buffer, (char *)drive_data->dev_elem[slot_id].disk_physical_loc, DISK_PHY_LOC_LENGTH); - if (strlen(ses->physical_location) && !strlen(buffer)) { + if (strlen(ses->physical_location)) { + if (strlen(buffer)) { ipr_strncpy_0(unit_phy_loc, ses->physical_location, PHYSICAL_LOCATION_LENGTH); first_hyphen = strchr(unit_phy_loc, '-'); *first_hyphen = '\0'; sprintf(buf, "%s-%s", unit_phy_loc, buffer); } + else + sprintf(buf, "%s", "\0"); + } else if (strlen(buffer)) { ipr_strncpy_0(unit_phy_loc, ses->ioa->physical_location, PHYSICAL_LOCATION_LENGTH); first_hyphen = strchr(unit_phy_loc, '-'); *first_hyphen = '\0'; sprintf(buf, "%s-%s", unit_phy_loc, buffer); } - else + else sprintf(buf, "%s", "\0"); return 0;