Skip to content

Commit

Permalink
Disable unused expensive code in addVirtualTarget
Browse files Browse the repository at this point in the history
The code to enable all hardware targets before creating virtual ones
becomes more expensive as the target count climbs.
  • Loading branch information
bmeagherix committed Jan 24, 2024
1 parent cba6f08 commit b20f10b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scstadmin/scstadmin.sysfs/scstadmin
Original file line number Diff line number Diff line change
Expand Up @@ -3029,6 +3029,9 @@ sub addVirtualTarget {
my $errorString;
my $targets;

# Disable this code. Never used but gets expensive as the
# target count climbs.
if (0) {
# Enable all hardware targets before creating virtual ones
($targets, $errorString) = $SCST->targets($driver);
foreach my $_target (@{$targets}) {
Expand All @@ -3040,6 +3043,7 @@ sub addVirtualTarget {
enableTarget($driver, $_target);
}
}
}

print "\t-> Creating target '$target' for driver '$driver': ";
my $rc = $SCST->addVirtualTarget($driver, $target, $attributes);
Expand Down

0 comments on commit b20f10b

Please sign in to comment.