ppc64-diag/ppc64-diag-2.7.9-utilize-trim_trail_space-in-event_fru_callout.patch
Than Ngo e86f2df64a - Enable light path diagnostics for RTAS events
- Handle multiple platform dumps
  Resolves: RHEL-11454
2023-12-10 22:23:29 +01:00

38 lines
1.4 KiB
Diff

commit 476b0af7516b86c4d98cfa229fb0c6b856eea31d
Author: Sathvika Vasireddy <sv@linux.ibm.com>
Date: Fri Sep 8 12:35:13 2023 +0530
ppc64-diag/lp_diag: Utilize trim_trail_space() function in event_fru_callout()
Update the event_fru_callout() function to use the trim_trail_space()
function to be able to remove any trailing spaces from the location code.
This change aims to address an issue where the presence of trailing spaces
in the location code results in failure to find an indicator for the given
location code. Use trim_trail_space() on the location to ensure that the
device location code is properly compared with the indicator list.
Signed-off-by: Sathvika Vasireddy <sv@linux.ibm.com>
Signed-off-by: Mahesh Salgaonkar <mahesh@linux.ibm.com>
diff --git a/lpd/lp_diag.c b/lpd/lp_diag.c
index 988a021..e6f5d3c 100644
--- a/lpd/lp_diag.c
+++ b/lpd/lp_diag.c
@@ -35,6 +35,7 @@
#include "servicelog.h"
#include "indicator.h"
#include "lp_util.h"
+#include "utils.h"
/* FRU callout priority as defined in PAPR+
*
@@ -344,6 +345,8 @@ event_fru_callout(struct sl_callout *callouts, struct loc_code *list,
/* get FRUs nearest fault indicator */
strncpy(location, callout->location, LOCATION_LENGTH);
location[LOCATION_LENGTH - 1] = '\0';
+ trim_trail_space(location);
+
loc_led = get_fru_indicator(list, location, &truncated);
if (!loc_led) { /* No indicator found for the given loc code */
*attn_on = 1;