]> git.baikalelectronics.ru Git - kernel.git/commit
drm/nouveau/bios: set info only when the return is not 0
authorTom Rix <trix@redhat.com>
Sat, 2 Jul 2022 15:39:04 +0000 (11:39 -0400)
committerLyude Paul <lyude@redhat.com>
Fri, 15 Jul 2022 19:12:22 +0000 (15:12 -0400)
commit763f45b759c245bd14250a85f6aa5addab250d47
tree21d10c6649f5a89aedd0d462ec9263da64fe3f45
parent2529373e8e88cfe368f19231c10375a82407ac36
drm/nouveau/bios: set info only when the return is not 0

clang static analysis reports
drivers/gpu/drm/nouveau/nvkm/subdev/bios/pmu.c:68:17: warning: The right operand of '*' is a garbage value [core.UndefinedBinaryOperatorResult]
        switch (!!data * *ver) {
                       ^ ~~~~
A switch statement with only a default should be reduced to an if.

If nvbios_pmuEp() returns 0, via the data variable, the output info parameter
is not used.  So set info only when data is not 0.

The struct nvbios_pmuE only has the type and data elements.  Since both of these
are explicitly set, memset is not needed.  So remove it.

Signed-off-by: Tom Rix <trix@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220702153904.1696595-1-trix@redhat.com
drivers/gpu/drm/nouveau/nvkm/subdev/bios/pmu.c