@@ -61,7 +61,7 @@ int main(int argc, char *const argv[])
fprintf(stderr, "Warning: invalid waveform: duty_length = %llu > period_length = %llu\n",
(unsigned long long)wf.duty_length_ns, (unsigned long long)wf.period_length_ns);
- if (wf.duty_offset_ns >= wf.period_length_ns)
+ if (wf.period_length_ns && wf.duty_offset_ns >= wf.period_length_ns)
fprintf(stderr, "Warning: invalid waveform: duty_offset = %llu >= period_length = %llu\n",
(unsigned long long)wf.duty_offset_ns, (unsigned long long)wf.period_length_ns);
@@ -69,7 +69,7 @@ int main(int argc, char *const argv[])
fprintf(stderr, "Warning: invalid waveform: duty_length = %llu > period_length = %llu\n",
(unsigned long long)wf.duty_length_ns, (unsigned long long)wf.period_length_ns);
- if (wf.duty_offset_ns >= wf.period_length_ns)
+ if (wf.period_length_ns && wf.duty_offset_ns >= wf.period_length_ns)
fprintf(stderr, "Warning: invalid waveform: duty_offset = %llu >= period_length = %llu\n",
(unsigned long long)wf.duty_offset_ns, (unsigned long long)wf.period_length_ns);
.period_length_ns == .duty_offset_ns == 0 is a valid waveform that shouldn't trigger a warning. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> --- pwmround.c | 2 +- pwmset.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) base-commit: 3a9a9d36d95e8aa5ed563590d53c1715285a5ffb