HomeFreeBSD

pwm(8): fix potential duty overflow, use unsigneds for period and duty

Description

pwm(8): fix potential duty overflow, use unsigneds for period and duty

For a long period value and the duty specified as a percentage,
there could be an overflow.
Using unsigned integers aligns the code with struct pwm_state and allows
to safely use periods up to 4 seconds where supported by drivers.

MFC after: 2 weeks

Details

Provenance
avgAuthored on Sep 25 2020, 7:55 AM
Parents
rG31b0753da3b2: pwm(8): do not exit with failure after successfully reading configuration
Branches
Unknown
Tags
Unknown

Event Timeline