Nathan Chancellor 66d21c005d drm/i915: Avoid bitwise vs logical OR warning in snb_wm_latency_quirk()
commit 2e70570656adfe1c5d9a29940faa348d5f132199 upstream.

A new warning in clang points out a place in this file where a bitwise
OR is being used with boolean types:

drivers/gpu/drm/i915/intel_pm.c:3066:12: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]
        changed = ilk_increase_wm_latency(dev_priv, dev_priv->wm.pri_latency, 12) |
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This construct is intentional, as it allows every one of the calls to
ilk_increase_wm_latency() to occur (instead of short circuiting with
logical OR) while still caring about the result of each call.

To make this clearer to the compiler, use the '|=' operator to assign
the result of each ilk_increase_wm_latency() call to changed, which
keeps the meaning of the code the same but makes it obvious that every
one of these calls is expected to happen.

Link: https://github.com/ClangBuiltLinux/linux/issues/1473
Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Suggested-by: Dávid Bolvanský <david.bolvansky@gmail.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211014211916.3550122-1-nathan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-16 09:14:24 +01:00
..
2021-07-19 09:44:58 +02:00
2020-09-23 09:52:24 +10:00
2020-08-11 11:58:31 +10:00
2020-09-08 14:41:40 +10:00
2020-08-06 14:27:31 -07:00
2020-09-08 14:41:40 +10:00
2021-05-14 09:50:22 +02:00
2021-11-26 10:39:20 +01:00
2020-09-11 10:47:19 +02:00
2021-05-11 14:47:26 +02:00
2020-05-27 14:31:42 +03:00
2020-08-25 11:00:02 +02:00
2020-09-21 10:45:08 +02:00
2020-09-21 10:45:08 +02:00
2020-05-29 12:58:11 +02:00
2020-09-21 10:45:08 +02:00
2020-08-11 11:58:31 +10:00
2020-08-25 11:00:02 +02:00
2020-06-24 15:45:51 +10:00
2021-03-30 14:31:51 +02:00