From: Mauro Carvalho Chehab Date: Tue, 11 Jun 2024 10:01:40 +0000 (+0200) Subject: Do a coding style cleanup with regards to tabs and white spaces X-Git-Tag: v0.8.1~18 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=91d46e8e1b02f15f7826c21825646b825f915722;p=users%2Fmchehab%2Frasdaemon.git Do a coding style cleanup with regards to tabs and white spaces Use tabs instead of spaces and remove blank ending whitespaces. No functional changes. Signed-off-by: Mauro Carvalho Chehab --- diff --git a/labels/supermicro b/labels/supermicro index dda9a0b..2d77fae 100644 --- a/labels/supermicro +++ b/labels/supermicro @@ -64,7 +64,7 @@ Vendor: Supermicro P1_DIMM4B: 1.1.1; P2_DIMM4B: 2.0.1; P2_DIMM4B: 2.1.1; - + Model: X11DPH-i, X11DPH-T, X11DPH-TQ P1-DIMMA1: 0.0.0; P1-DIMMA2: 0.0.1; P1-DIMMB1: 0.1.0; @@ -78,7 +78,7 @@ Vendor: Supermicro P2-DIMMD1: 3.0.0; P2-DIMMD2: 3.0.1; P2-DIMME1: 3.1.0; P2-DIMMF1: 3.2.0; - + Model: X10DRI, X10DRI-T P1-DIMMA1: 0.0.0; P1-DIMMA2: 0.0.1; P1-DIMMB1: 0.1.0; P1-DIMMB2: 0.1.1; @@ -98,7 +98,7 @@ Vendor: Supermicro P2-DIMMF1: 1.1.0; P2-DIMMG1: 1.2.0; P2-DIMMH1: 1.3.0; - + Model: X11DDW-NT, X11DDW-L P1-DIMMA1: 0.0.0; P1-DIMMB1: 0.1.0; @@ -138,7 +138,7 @@ Vendor: Supermicro DIMMD1: 1.0.0; DIMME1: 1.1.0; DIMMF1: 1.2.0; - + Model: B1DRi P1_DIMMA1: 0.0.0; P1_DIMMB1: 0.1.0; @@ -148,17 +148,17 @@ Vendor: Supermicro P2_DIMMF1: 1.1.0; P2_DIMMG1: 1.2.0; P2_DIMMH1: 1.3.0; - + Model: X11SCA, X11SCA-F DIMMA1: 0.0.0, 0.1.0; DIMMA2: 0.2.0, 0.3.0; DIMMB1: 0.0.1, 0.1.1; DIMMB2: 0.2.1, 0.3.1; - + Model: X11SCW-F DIMMA1: 0.1.0; DIMMA2: 0.0.0; DIMMB1: 0.1.1; DIMMB2: 0.0.1; - + # Intel Ice Lake-SP # Intel 3rd Generation Xeon Scalable CPU: 4 integrated Memory Controllers (iMC), 8 memory channels, and 16 DIMM slots diff --git a/util/ras-mc-ctl.in b/util/ras-mc-ctl.in index f9328b2..d53a12b 100755 --- a/util/ras-mc-ctl.in +++ b/util/ras-mc-ctl.in @@ -113,25 +113,25 @@ if ( $conf{opt}{mainboard} || $conf{opt}{print_labels} get_mainboard_info(); if ($conf{opt}{mainboard} eq "report") { - print "$prog: mainboard: ", - "$conf{mainboard}{vendor} model $conf{mainboard}{model}\n"; + print "$prog: mainboard: ", + "$conf{mainboard}{vendor} model $conf{mainboard}{model}\n"; } if ($conf{opt}{print_labels}) { - print_dimm_labels (); + print_dimm_labels (); } if ($conf{opt}{register_labels}) { - register_dimm_labels (); + register_dimm_labels (); } if ($conf{opt}{display_memory_layout}) { - display_memory_layout (); + display_memory_layout (); } if ($conf{opt}{guess_dimm_label}) { - guess_dimm_label (); + guess_dimm_label (); } if ($conf{opt}{error_count}) { - display_error_count (); + display_error_count (); } } @@ -185,39 +185,39 @@ sub parse_cmdline Getopt::Long::Configure ("bundling"); my $rc = GetOptions ("mainboard:s" => sub { $$mref = $_[1]||"report" }, - "help" => sub {usage (0)}, - "quiet" => \$conf{opt}{quiet}, - "print-labels" => \$conf{opt}{print_labels}, - "guess-labels" => \$conf{opt}{guess_dimm_label}, - "register-labels" => \$conf{opt}{register_labels}, - "delay:s" => \$conf{opt}{delay}, - "labeldb=s" => \$conf{labeldb}, - "status" => \$conf{opt}{status}, - "layout" => \$conf{opt}{display_memory_layout}, - "summary" => \$conf{opt}{summary}, - "errors" => \$conf{opt}{errors}, - "error-count" => \$conf{opt}{error_count}, - "vendor-errors-summary" => \$conf{opt}{vendor_errors_summary}, - "vendor-errors" => \$conf{opt}{vendor_errors}, - "since=s" => \$conf{opt}{since}, - "vendor-platforms" => \$conf{opt}{vendor_platforms}, - ); + "help" => sub {usage (0)}, + "quiet" => \$conf{opt}{quiet}, + "print-labels" => \$conf{opt}{print_labels}, + "guess-labels" => \$conf{opt}{guess_dimm_label}, + "register-labels" => \$conf{opt}{register_labels}, + "delay:s" => \$conf{opt}{delay}, + "labeldb=s" => \$conf{labeldb}, + "status" => \$conf{opt}{status}, + "layout" => \$conf{opt}{display_memory_layout}, + "summary" => \$conf{opt}{summary}, + "errors" => \$conf{opt}{errors}, + "error-count" => \$conf{opt}{error_count}, + "vendor-errors-summary" => \$conf{opt}{vendor_errors_summary}, + "vendor-errors" => \$conf{opt}{vendor_errors}, + "since=s" => \$conf{opt}{since}, + "vendor-platforms" => \$conf{opt}{vendor_platforms}, + ); usage(1) if !$rc; usage (0) if !grep $conf{opt}{$_}, keys %{$conf{opt}}; if ($conf{opt}{delay} && !$conf{opt}{register_labels}) { - log_error ("Only use --delay with --register-labels\n"); - exit (1); + log_error ("Only use --delay with --register-labels\n"); + exit (1); } if ($conf{opt}{since}) { - if ($conf{opt}{since} !~ /^20\d\d-[01]\d-[0-3]\d/) { - log_error ("--since requires a date like yyyy-mm-dd where yyyy is the year, mm the month, and dd the day\n"); - exit (1); - } - $conf{opt}{since} = " where timestamp>='$conf{opt}{since}'"; + if ($conf{opt}{since} !~ /^20\d\d-[01]\d-[0-3]\d/) { + log_error ("--since requires a date like yyyy-mm-dd where yyyy is the year, mm the month, and dd the day\n"); + exit (1); + } + $conf{opt}{since} = " where timestamp>='$conf{opt}{since}'"; } } @@ -240,14 +240,14 @@ sub print_status { my $status = 0; open (MODULES, "/proc/modules") - or die "Unable to open /proc/modules: $!\n"; + or die "Unable to open /proc/modules: $!\n"; while () { $status = 1 if /_edac/; } print "$prog: drivers ", ($status ? "are" : "not"), " loaded.\n" - unless $conf{opt}{quiet}; + unless $conf{opt}{quiet}; return ($status); } @@ -257,118 +257,118 @@ sub parse_dimm_nodes my $file = $File::Find::name; if (($file =~ /max_location$/)) { - open IN, $file; - my $location = ; - $location =~ s/\s+$//; - close IN; - my @temp = split(/ /, $location); - - $layers[0] = "mc"; - - if (m,/mc/mc(\d+),) { - $max_pos[0] = $1 if (!exists($max_pos[0]) || $1 > $max_pos[0]); - } else { - $max_pos[0] = 0 if (!exists($max_pos[0])); - } - for (my $i = 0; $i < scalar(@temp); $i += 2) { - $layers[$i / 2 + 1] = $temp[$i]; - $max_pos[$i / 2 + 1] = $temp[$i + 1]; - } - - return; + open IN, $file; + my $location = ; + $location =~ s/\s+$//; + close IN; + my @temp = split(/ /, $location); + + $layers[0] = "mc"; + + if (m,/mc/mc(\d+),) { + $max_pos[0] = $1 if (!exists($max_pos[0]) || $1 > $max_pos[0]); + } else { + $max_pos[0] = 0 if (!exists($max_pos[0])); + } + for (my $i = 0; $i < scalar(@temp); $i += 2) { + $layers[$i / 2 + 1] = $temp[$i]; + $max_pos[$i / 2 + 1] = $temp[$i + 1]; + } + + return; } if ($file =~ /size_mb$/) { - my $mc = $file; - $mc =~ s,.*mc(\d+).*,$1,; + my $mc = $file; + $mc =~ s,.*mc(\d+).*,$1,; - my $csrow = $file; - $csrow =~ s,.*csrow(\d+).*,$1,; + my $csrow = $file; + $csrow =~ s,.*csrow(\d+).*,$1,; - open IN, $file; - my $size = ; - close IN; + open IN, $file; + my $size = ; + close IN; - my $str_loc = join(':', $mc, $csrow); - $csrow_size{$str_loc} = $size; + my $str_loc = join(':', $mc, $csrow); + $csrow_size{$str_loc} = $size; - return; + return; } if ($file =~ /location$/) { - my $mc = $file; - $mc =~ s,.*mc(\d+).*,$1,; - - my $dimm = $file; - $dimm =~ s,.*(rank|dimm)(\d+).*,$2,; - - open IN, $file; - my $location = ; - $location =~ s/\s+$//; - close IN; - - my @pos; - - # Get the name of the hierarchy labels - if (!@layers) { - my @temp = split(/ /, $location); - $max_pos[0] = 0; - $layers[0] = "mc"; - for (my $i = 0; $i < scalar(@temp); $i += 2) { - $layers[$i / 2 + 1] = $temp[$i]; - $max_pos[$i / 2 + 1] = 0; - } - } - - my @temp = split(/ /, $location); - for (my $i = 1; $i < scalar(@temp); $i += 2) { - $pos[$i / 2] = $temp[$i]; - - if ($pos[$i / 2] > $max_pos[$i / 2 + 1]) { - $max_pos[$i / 2 + 1] = $pos[$i / 2]; - } - } - if ($mc > $max_pos[0]) { - $max_pos[0] = $mc; - } - - # Get DIMM size - - $file =~ s/dimm_location/size/; - open IN, $file; - my $size = ; - close IN; - - my $str_loc = join(':', $mc, @pos); - $dimm_size{$str_loc} = $size; - $dimm_node{$str_loc} = $dimm; - $file =~ s/size/dimm_label/; - $dimm_label_file{$str_loc} = $file; - $dimm_location{$str_loc} = $location; - - my $count; - - $file =~s/dimm_label/dimm_ce_count/; - if (-e $file) { - open IN, $file; - chomp($count = ); - close IN; - } else { - log_error ("dimm_ce_count not found in sysfs. Old kernel?\n"); - exit -1; - } - $dimm_ce_count{$str_loc} = $count; - - $file =~s/dimm_ce_count/dimm_ue_count/; - if (-e $file) { - open IN, $file; - chomp($count = ); - close IN; - } else { - log_error ("dimm_ue_count not found in sysfs. Old kernel?\n"); - exit -1; - } - $dimm_ue_count{$str_loc} = $count; - - return; + my $mc = $file; + $mc =~ s,.*mc(\d+).*,$1,; + + my $dimm = $file; + $dimm =~ s,.*(rank|dimm)(\d+).*,$2,; + + open IN, $file; + my $location = ; + $location =~ s/\s+$//; + close IN; + + my @pos; + + # Get the name of the hierarchy labels + if (!@layers) { + my @temp = split(/ /, $location); + $max_pos[0] = 0; + $layers[0] = "mc"; + for (my $i = 0; $i < scalar(@temp); $i += 2) { + $layers[$i / 2 + 1] = $temp[$i]; + $max_pos[$i / 2 + 1] = 0; + } + } + + my @temp = split(/ /, $location); + for (my $i = 1; $i < scalar(@temp); $i += 2) { + $pos[$i / 2] = $temp[$i]; + + if ($pos[$i / 2] > $max_pos[$i / 2 + 1]) { + $max_pos[$i / 2 + 1] = $pos[$i / 2]; + } + } + if ($mc > $max_pos[0]) { + $max_pos[0] = $mc; + } + + # Get DIMM size + + $file =~ s/dimm_location/size/; + open IN, $file; + my $size = ; + close IN; + + my $str_loc = join(':', $mc, @pos); + $dimm_size{$str_loc} = $size; + $dimm_node{$str_loc} = $dimm; + $file =~ s/size/dimm_label/; + $dimm_label_file{$str_loc} = $file; + $dimm_location{$str_loc} = $location; + + my $count; + + $file =~s/dimm_label/dimm_ce_count/; + if (-e $file) { + open IN, $file; + chomp($count = ); + close IN; + } else { + log_error ("dimm_ce_count not found in sysfs. Old kernel?\n"); + exit -1; + } + $dimm_ce_count{$str_loc} = $count; + + $file =~s/dimm_ce_count/dimm_ue_count/; + if (-e $file) { + open IN, $file; + chomp($count = ); + close IN; + } else { + log_error ("dimm_ue_count not found in sysfs. Old kernel?\n"); + exit -1; + } + $dimm_ue_count{$str_loc} = $count; + + return; } } @@ -377,14 +377,14 @@ sub guess_product { my $pname = undef; if (open (VENDOR, "/sys/class/dmi/id/product_vendor")) { - $pvendor = ; - close VENDOR; - chomp($pvendor); + $pvendor = ; + close VENDOR; + chomp($pvendor); } if (open (NAME, "/sys/class/dmi/id/product_name")) { - $pname = ; - close NAME; - chomp($pname); + $pname = ; + close NAME; + chomp($pname); } return ($pvendor, $pname); @@ -395,11 +395,11 @@ sub get_mainboard_info { my ($pvendor, $pname); if ($conf{opt}{mainboard} && $conf{opt}{mainboard} ne "report") { - ($vendor, $model) = split (/[: ]/, $conf{opt}{mainboard}, 2); + ($vendor, $model) = split (/[: ]/, $conf{opt}{mainboard}, 2); } if (!$vendor || !$model) { - ($vendor, $model) = guess_vendor_model (); + ($vendor, $model) = guess_vendor_model (); } $conf{mainboard}{vendor} = $vendor; @@ -408,9 +408,9 @@ sub get_mainboard_info { ($pvendor, $pname) = guess_product (); # since product vendor is rare, use mainboard's vendor if ($pvendor) { - $conf{mainboard}{product_vendor} = $pvendor; + $conf{mainboard}{product_vendor} = $pvendor; } else { - $conf{mainboard}{product_vendor} = $vendor; + $conf{mainboard}{product_vendor} = $vendor; } $conf{mainboard}{product_name} = $pname if $pname; } @@ -428,25 +428,25 @@ sub guess_vendor_model_dmidecode { LINE: while () { - $line++; + $line++; - /^(\s*)(board|base board|system) information/i || next LINE; - my $indent = $1; + /^(\s*)(board|base board|system) information/i || next LINE; + my $indent = $1; my $type = $2; - while ( ) { - /^(\s*)/; - $1 lt $indent && last LINE; - $indent = $1; - if ($type eq "system") { - /(?:manufacturer|vendor):\s*(.*\S)\s*/i && ( $system_vendor = $1 ); - /product(?: name)?:\s*(.*\S)\s*/i && ( $system_model = $1 ); - } else { - /(?:manufacturer|vendor):\s*(.*\S)\s*/i && ( $vendor = $1 ); - /product(?: name)?:\s*(.*\S)\s*/i && ( $model = $1 ); - } - last LINE if ($vendor && $model); - } + while ( ) { + /^(\s*)/; + $1 lt $indent && last LINE; + $indent = $1; + if ($type eq "system") { + /(?:manufacturer|vendor):\s*(.*\S)\s*/i && ( $system_vendor = $1 ); + /product(?: name)?:\s*(.*\S)\s*/i && ( $system_model = $1 ); + } else { + /(?:manufacturer|vendor):\s*(.*\S)\s*/i && ( $vendor = $1 ); + /product(?: name)?:\s*(.*\S)\s*/i && ( $model = $1 ); + } + last LINE if ($vendor && $model); + } } close (DMI); @@ -484,18 +484,18 @@ sub parse_mainboard_config open (CFG, "$file") or die "Failed to read mainboard config: $file: $!\n"; while () { - $line++; - chomp; # remove newline - s/^((?:[^'"#]*(?:(['"])[^\2]*\2)*)*)#.*/$1/; # remove comments - s/^\s+//; # remove leading space - s/\s+$//; # remove trailing space - next unless length; # skip blank lines - if (my ($key, $val) = /^\s*([-\w]+)\s*=\s*(.*)/) { - $hash{$key}{val} = $val; - $hash{$key}{line} = $line; - next; - } - return undef; + $line++; + chomp; # remove newline + s/^((?:[^'"#]*(?:(['"])[^\2]*\2)*)*)#.*/$1/; # remove comments + s/^\s+//; # remove leading space + s/\s+$//; # remove trailing space + next unless length; # skip blank lines + if (my ($key, $val) = /^\s*([-\w]+)\s*=\s*(.*)/) { + $hash{$key}{val} = $val; + $hash{$key}{line} = $line; + next; + } + return undef; } close (CFG) or &log_error ("close $file: $!\n"); return \%hash; @@ -508,16 +508,16 @@ sub guess_vendor_model { # to get the vendor and model information. # if (-f $conf{mbconfig} ) { - my $cfg = &parse_mainboard_config ($conf{mbconfig}); + my $cfg = &parse_mainboard_config ($conf{mbconfig}); - # If mainboard config file specified a script, then try to - # run the specified script or executable: - # - if ($cfg->{"script"}) { - $cfg = &parse_mainboard_config ("$cfg->{script}{val} |"); - die "Failed to run mainboard script\n" if (!$cfg); - } - return ($cfg->{vendor}{val}, $cfg->{model}{val}); + # If mainboard config file specified a script, then try to + # run the specified script or executable: + # + if ($cfg->{"script"}) { + $cfg = &parse_mainboard_config ("$cfg->{script}{val} |"); + die "Failed to run mainboard script\n" if (!$cfg); + } + return ($cfg->{vendor}{val}, $cfg->{model}{val}); } ($vendor, $model) = &guess_vendor_model_sysfs (); @@ -532,10 +532,10 @@ sub guess_dimm_label { LINE: while () { - /^(\s*)memory device$/i || next LINE; + /^(\s*)memory device$/i || next LINE; my ($dimm_label, $dimm_addr); - while () { + while () { if (/^\s*(locator|bank locator)/i) { my $indent = $1; $indent =~ tr/A-Z/a-z/; @@ -553,7 +553,7 @@ sub guess_dimm_label { next LINE; } next LINE if (/^\s*\n/); - } + } } close (DMI); @@ -569,84 +569,84 @@ sub parse_dimm_labels_file my $num; open (LABELS, "$file") - or die "Unable to open label database: $file: $!\n"; + or die "Unable to open label database: $file: $!\n"; while () { - $line++; - next if /^#/; - chomp; - s/^\s+//; - s/\s+$//; - next unless length; - - if (/vendor\s*:\s*(.*\S)\s*/i) { - $vendor = lc $1; - @models = (); - @products = (); - $num = 0; - next; - } - if (/(model|board)\s*:\s*(.*)$/i) { - !$vendor && die "$file: line $line: MB model without vendor\n"; - @models = grep { s/\s*(.*)\s*$/$1/ } split(/[,;]+/, $2); - @products = (); - $num = 0; - next; - } - if (/(product)\s*:\s*(.*)$/i) { - !$vendor && die "$file: line $line: product without vendor\n"; - @models = (); - @products = grep { s/\s*(.*)\s*$/$1/ } split(/[,;]+/, $2); - $num = 0; - next; - } - - # Allow multiple labels to be specified on a single line, - # separated by ; - for my $str (split /;/) { - $str =~ s/^\s*(.*)\s*$/$1/; - - next unless (my ($label, $info) = ($str =~ /^(.*)\s*:\s*(.*)$/i)); - - unless ($info =~ /\d+(?:[\.\:]\d+)*/) { - log_error ("$file: $line: Invalid syntax, ignoring: \"$_\"\n"); - next; - } - - for my $target (split (/[, ]+/, $info)) { - my $n; - my ($mc, $top, $mid, $low, $extra) = ($target =~ /(\d+)(?:[\.\:](\d+)){0,1}(?:[\.\:](\d+)){0,1}(?:[\.\:](\d+)){0,1}(?:[\.\:](\d+)){0,1}/); - - if (defined($extra)) { - die ("Error: Only up to 3 layers are currently supported on label db \"$file\"\n"); - return; - } elsif (!defined($top)) { - die ("Error: The label db \"$file\" is defining a zero-layers machine\n"); - return; - } else { - $n = 3; - if (!defined($low)) { - $low = 0; - $n--; - } - if (!defined($mid)) { - $mid = 0; - $n--; - } - map { $lh->{$vendor}{lc $_}{$mc}{$top}{$mid}{$low} = $label } - @models; - map { $lh_prod->{$vendor}{lc $_}{$mc}{$top}{$mid}{$low} = $label } - @products; - } - if (!$num) { - $num = $n; - map { $num_layers->{$vendor}{lc $_} = $num } @models; - map { $num_layers_prod->{$vendor}{lc $_} = $num } @products; - } elsif ($num != $n) { - die ("Error: Inconsistent number of layers at label db \"$file\"\n"); - } - } - } + $line++; + next if /^#/; + chomp; + s/^\s+//; + s/\s+$//; + next unless length; + + if (/vendor\s*:\s*(.*\S)\s*/i) { + $vendor = lc $1; + @models = (); + @products = (); + $num = 0; + next; + } + if (/(model|board)\s*:\s*(.*)$/i) { + !$vendor && die "$file: line $line: MB model without vendor\n"; + @models = grep { s/\s*(.*)\s*$/$1/ } split(/[,;]+/, $2); + @products = (); + $num = 0; + next; + } + if (/(product)\s*:\s*(.*)$/i) { + !$vendor && die "$file: line $line: product without vendor\n"; + @models = (); + @products = grep { s/\s*(.*)\s*$/$1/ } split(/[,;]+/, $2); + $num = 0; + next; + } + + # Allow multiple labels to be specified on a single line, + # separated by ; + for my $str (split /;/) { + $str =~ s/^\s*(.*)\s*$/$1/; + + next unless (my ($label, $info) = ($str =~ /^(.*)\s*:\s*(.*)$/i)); + + unless ($info =~ /\d+(?:[\.\:]\d+)*/) { + log_error ("$file: $line: Invalid syntax, ignoring: \"$_\"\n"); + next; + } + + for my $target (split (/[, ]+/, $info)) { + my $n; + my ($mc, $top, $mid, $low, $extra) = ($target =~ /(\d+)(?:[\.\:](\d+)){0,1}(?:[\.\:](\d+)){0,1}(?:[\.\:](\d+)){0,1}(?:[\.\:](\d+)){0,1}/); + + if (defined($extra)) { + die ("Error: Only up to 3 layers are currently supported on label db \"$file\"\n"); + return; + } elsif (!defined($top)) { + die ("Error: The label db \"$file\" is defining a zero-layers machine\n"); + return; + } else { + $n = 3; + if (!defined($low)) { + $low = 0; + $n--; + } + if (!defined($mid)) { + $mid = 0; + $n--; + } + map { $lh->{$vendor}{lc $_}{$mc}{$top}{$mid}{$low} = $label } + @models; + map { $lh_prod->{$vendor}{lc $_}{$mc}{$top}{$mid}{$low} = $label } + @products; + } + if (!$num) { + $num = $n; + map { $num_layers->{$vendor}{lc $_} = $num } @models; + map { $num_layers_prod->{$vendor}{lc $_} = $num } @products; + } elsif ($num != $n) { + die ("Error: Inconsistent number of layers at label db \"$file\"\n"); + } + } + } } close (LABELS) or die "Error from label db \"$file\" : $!\n"; @@ -664,8 +664,8 @@ sub parse_dimm_labels # well as any files under the labels dir # for my $file ($conf{labeldb}, <$conf{labeldir}/*>) { - next unless -r $file; - parse_dimm_labels_file (\%labels, \%num_layers, \%labels_prod, \%num_layers_prod, $file); + next unless -r $file; + parse_dimm_labels_file (\%labels, \%num_layers, \%labels_prod, \%num_layers_prod, $file); } return (\%labels, \%num_layers, \%labels_prod, \%num_layers_prod); @@ -682,9 +682,9 @@ sub read_dimm_label $pos = "$mc:$top" if ($num_layers == 1); if (!defined($dimm_node{$pos})) { - my $label = "$pos missing"; - $pos = ""; - return ($label, $pos); + my $label = "$pos missing"; + $pos = ""; + return ($label, $pos); } my $dimm = $dimm_node{$pos}; @@ -696,8 +696,8 @@ sub read_dimm_label return ("label missing", "$pos missing") unless -f $dimm_label_file; if (!open (LABEL, "$dimm_label_file")) { - warn "Failed to open $dimm_label_file: $!\n"; - return ("Error"); + warn "Failed to open $dimm_label_file: $!\n"; + return ("Error"); } chomp (my $label =