Skip to content
This repository has been archived by the owner on Jan 31, 2023. It is now read-only.

Commit

Permalink
auto-adjust loop threshold to changes in the array size
Browse files Browse the repository at this point in the history
Signed-off-by: Guenter Roeck <[email protected]>
  • Loading branch information
airbjorn authored and hannesha committed Sep 18, 2018
1 parent 1ec80f4 commit 3d486e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion it87.c
Original file line number Diff line number Diff line change
Expand Up @@ -1977,7 +1977,7 @@ static ssize_t set_pwm_freq(struct device *dev, struct device_attribute *attr,
val *= has_newer_autopwm(data) ? 256 : 128;

/* Search for the nearest available frequency */
for (i = 0; i < 7; i++) {
for (i = 0; i < ARRAY_SIZE(pwm_freq) - 1; i++) {
if (val > (pwm_freq[i] + pwm_freq[i + 1]) / 2)
break;
}
Expand Down

0 comments on commit 3d486e8

Please sign in to comment.