kernel: handle with_intel_runtime_pm() macros better
commite9a96dd3cb9f513ea587eccbf46de695f88b295a
authorDan Carpenter <dan.carpenter@linaro.org>
Wed, 14 Jun 2023 08:10:34 +0000 (14 11:10 +0300)
committerDan Carpenter <dan.carpenter@linaro.org>
Wed, 14 Jun 2023 08:10:34 +0000 (14 11:10 +0300)
tree7b068f68dce2a569056316b7d872387f6edeea05
parent54fbf34102a8652a3ac2a3673d4d2d37af9b6a27
kernel: handle with_intel_runtime_pm() macros better

The with_intel_runtime_pm() macros look like this:

#define with_intel_runtime_pm(rpm, wf) \
        for ((wf) = intel_runtime_pm_get(rpm); (wf); \
             intel_runtime_pm_put((rpm), (wf)), (wf) = 0)

Smatch doesn't assume that the first call to intel_runtime_pm_get()
will succeed.  So it creates a lot of uninitialized variable warnings
where we do stuff like:

        u32 val;

        with_intel_runtime_pm(gt->uncore->rpm, wakeref)
                val = intel_uncore_read(gt->uncore, reg32);

        return val;

Smatch complains that "val" can be uninitialized.  These are all false
positives.  We always enter the loop.  Silence the false positives.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
check_kernel.c
smatch.h
smatch_flow.c