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.

(cherry picked from commit b1425b5)
  • Loading branch information
bmeagherix authored and bugclerk committed Jan 25, 2024
1 parent 259d4d7 commit 071045e
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 @@ -3024,6 +3024,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 @@ -3035,6 +3038,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 071045e

Please sign in to comment.