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
This commit is contained in:
Wen Xiong 2012-10-24 09:56:21 -05:00
commit eea97da1c4

View file

@ -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;