]> git.baikalelectronics.ru Git - kernel.git/commit
drm/vc4: Fix bitwise OR versus ternary operator in vc4_plane_mode_set
authorNathan Chancellor <natechancellor@gmail.com>
Thu, 10 Sep 2020 17:18:32 +0000 (10:18 -0700)
committerMaxime Ripard <maxime@cerno.tech>
Fri, 11 Sep 2020 09:30:20 +0000 (11:30 +0200)
commitbf7e18b9f768730ef6477406083b2c3e2ad47eed
tree0065c6d3ec29d168becc39c3b876709c3b2a97ad
parentb7fd1c08ad2309f8db4ab91198abe72e916edf9a
drm/vc4: Fix bitwise OR versus ternary operator in vc4_plane_mode_set

Clang warns:

drivers/gpu/drm/vc4/vc4_plane.c:901:27: warning: operator '?:' has lower
precedence than '|'; '|' will be evaluated first
[-Wbitwise-conditional-parentheses]
                                fb->format->has_alpha ?
                                ~~~~~~~~~~~~~~~~~~~~~ ^
drivers/gpu/drm/vc4/vc4_plane.c:901:27: note: place parentheses around
the '|' expression to silence this warning
                                fb->format->has_alpha ?
                                ~~~~~~~~~~~~~~~~~~~~~ ^
drivers/gpu/drm/vc4/vc4_plane.c:901:27: note: place parentheses around
the '?:' expression to evaluate it first
                                fb->format->has_alpha ?
                                ~~~~~~~~~~~~~~~~~~~~~~^
1 warning generated.

Add the parentheses as that was clearly intended, otherwise
SCALER5_CTL2_ALPHA_PREMULT won't be added to the list.

Fixes: b4653a973d96 ("drm/vc4: Add support for the BCM2711 HVS5")
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Link: https://github.com/ClangBuiltLinux/linux/issues/1150
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20200910171831.4112580-1-natechancellor@gmail.com
drivers/gpu/drm/vc4/vc4_plane.c