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