On Thu, 11 Mar 2021 at 18:09, Hao Wu <wuhao...@google.com> wrote: > > This patch adds testing of PWM fan RPMs in the existing npcm7xx pwm > test. It tests whether the MFT module can measure correct fan values > for a PWM fan in NPCM7XX boards. > > Reviewed-by: Doug Evans <d...@google.com> > Reviewed-by: Tyrone Ting <kft...@nuvoton.com> > Signed-off-by: Hao Wu <wuhao...@google.com> > Reviewed-by: Peter Maydell <peter.mayd...@linaro.org>
> +static void mft_verify_rpm(QTestState *qts, const TestData *td, uint64_t > duty) > +{ > + int index = mft_compute_index(td); > + uint16_t cnt, cr; > + uint32_t rpm = DEFAULT_RPM * duty / MAX_DUTY; > + uint64_t clk = read_pclk(qts, true); > + int32_t expected_cnt = mft_compute_cnt(rpm, clk); > + > + qtest_irq_intercept_in(qts, "/machine/soc/a9mpcore/gic"); > + g_test_message( > + "verifying rpm for mft[%d]: clk: %lu, duty: %lu, rpm: %u, cnt: %d", > + index, clk, duty, rpm, expected_cnt); Hi -- this won't build on 32-bit hosts (or on OSX, and it warns on OpenBSD), because uint64_t and 'long' aren't the same thing. You need to use the PRIu64 etc macros when printing uint64_t values, so the argument type and the format string match. I've fixed this up in the pullreq. thanks -- PMM