mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 19:26:25 +00:00
dme1737: Keep index within pwm_config[]
The static code scanner "Parfait" reported this because pwm_config is only 3 bytes - pwm_config[3] is out of range. Since this code path is never called with ix == 3 (the device has no PWM4 output) this doesn't change anything in practice. But to encourage testing with Parfait, lets make the warning go away... Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
54fdade1c3
commit
912e837aef
1 changed files with 1 additions and 1 deletions
|
@ -1134,7 +1134,7 @@ static ssize_t show_pwm(struct device *dev, struct device_attribute *attr,
|
||||||
res = PWM_FREQ_FROM_REG(data->pwm_freq[ix]);
|
res = PWM_FREQ_FROM_REG(data->pwm_freq[ix]);
|
||||||
break;
|
break;
|
||||||
case SYS_PWM_ENABLE:
|
case SYS_PWM_ENABLE:
|
||||||
if (ix > 3) {
|
if (ix >= 3) {
|
||||||
res = 1; /* pwm[5-6] hard-wired to manual mode */
|
res = 1; /* pwm[5-6] hard-wired to manual mode */
|
||||||
} else {
|
} else {
|
||||||
res = PWM_EN_FROM_REG(data->pwm_config[ix]);
|
res = PWM_EN_FROM_REG(data->pwm_config[ix]);
|
||||||
|
|
Loading…
Reference in a new issue