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 Apr 30, 2024
1 parent 8cb67fd commit 4a7f8bb
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 @@ -3031,6 +3031,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 @@ -3042,6 +3045,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 4a7f8bb

Please sign in to comment.