Commit ab15755b authored by Stefan Tauner's avatar Stefan Tauner
Browse files

Settings: use existing dep_ref parameter instead of determing its value again

parent 3f1749ce
......@@ -559,11 +559,6 @@ sub validate_value {
if (defined($map_ref->{$k}->{'type'})) {
my $orig = ${$v_ref};
# @FIXME: check if the constant is depending on another constant, that needs to be enabled.
# my $dependency = @{$map_ref->{$k}->{'depends_on'}};
# if (defined($dependency) && defined(@{$map_ref->{$dependency}->{'value'}}
# }
if ($map_ref->{$k}->{'type'} eq 'net') {
return "Netlist not available" if !defined($nl_ref);
......@@ -636,11 +631,6 @@ sub validate_value {
if (defined($map_ref->{$k}->{'values'})) {
my $values_ref = $map_ref->{$k}->{'values'};
my $dep_val;
if (defined($map_ref->{$k}->{'depends_on'})) {
$dep_val = $consts_ref->{$map_ref->{$k}->{'depends_on'}};
}
if (ref($values_ref) eq 'ARRAY') {
# Look for given value in allowed values
......@@ -648,7 +638,7 @@ sub validate_value {
return "${$v_ref} is not allowed. Allowed values are: " . join(", ", @{$map_ref->{$k}->{'values'}});
}
} elsif (ref($values_ref) eq 'CODE') {
if (!$values_ref->(${$v_ref}, $consts_ref->{$k}, $dep_val)) {
if (!$values_ref->(${$v_ref}, $consts_ref->{$k}, $map_ref, $consts_ref, $$dep_ref)) {
return "${$v_ref} is not allowed";
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment