Blame SOURCES/rasdaemon-ras-mc-ctl-Fix-script-to-parse-dimm-sizes.patch

81d547
From: Muralidhara M K <muralimk@amd.com>
81d547
81d547
This patch removes trailing spaces at the end of a line from
81d547
file location and fixes --layout option to parse dimm nodes
81d547
to get the size from ras-mc-ctl.
81d547
81d547
Issue is reported https://github.com/mchehab/rasdaemon/issues/43
81d547
Where '> ras-mc-ctl --layout' reports all 0s
81d547
81d547
With this change the layout prints the correct dimm sizes
81d547
> sudo ras-mc-ctl --layout
81d547
          +-----------------------------------------------+
81d547
          |                      mc0                      |
81d547
          |  csrow0   |  csrow1   |  csrow2   |  csrow3   |
81d547
----------+-----------------------------------------------+
81d547
...
81d547
channel7: |  16384 MB  |     0 MB  |     0 MB  |     0 MB |
81d547
channel6: |  16384 MB  |     0 MB  |     0 MB  |     0 MB |
81d547
...
81d547
----------+-----------------------------------------------+
81d547
81d547
Signed-off-by: Muralidhara M K <muralimk@amd.com>
81d547
Signed-off-by: Naveen Krishna Chatradhi <nchatrad@amd.com>
81d547
---
81d547
 util/ras-mc-ctl.in | 2 ++
81d547
 1 file changed, 2 insertions(+)
81d547
81d547
diff --git a/util/ras-mc-ctl.in b/util/ras-mc-ctl.in
81d547
index 1e3aeb7..b22dd60 100755
81d547
--- a/util/ras-mc-ctl.in
81d547
+++ b/util/ras-mc-ctl.in
81d547
@@ -246,6 +246,7 @@ sub parse_dimm_nodes
81d547
     if (($file =~ /max_location$/)) {
81d547
         open IN, $file;
81d547
         my $location = <IN>;
81d547
+        $location =~ s/\s+$//;
81d547
         close IN;
81d547
         my @temp = split(/ /, $location);
81d547
 
81d547
@@ -288,6 +289,7 @@ sub parse_dimm_nodes
81d547
 
81d547
         open IN, $file;
81d547
         my $location = <IN>;
81d547
+        $location =~ s/\s+$//;
81d547
         close IN;
81d547
 
81d547
         my @pos;