diff options
author | Luca Coelho <luciano.coelho@intel.com> | 2025-08-27 13:12:06 +0300 |
---|---|---|
committer | Luca Coelho <luciano.coelho@intel.com> | 2025-09-04 13:36:43 +0300 |
commit | a304609be24ec94ddb9b18a5cf6357e58466ac5e (patch) | |
tree | bb27e5947173ac6a3530a3e983c0fd478e113100 /rust/helpers/build_assert.c | |
parent | e9a1d54ed9233b73737052c42115fe593f82ef84 (diff) |
drm/i915: use REG_BIT on FW_BLC_SELF_* macros
Use REG_BIT() instead of open coding the shift in the FW_BLC_SELF_*
macro definitions to avoid potentially typing them as 'int'.
For example, this happens when we pass them to _MASKED_BIT_ENABLE(),
because of the typeof() construct there. When we pass 1 << 15 (the
FW_BLC_SELF_EN macro), we get typeof(1 << 15), which is 'int'. Then
the value becomes negative (-2147450880) and we try to assign it to a
'u32'.
In practice this is not a problem though, because when we try to
assign -2147450880 to the u32, that becomes 0x80008000, which was the
intended result.
Link: https://lore.kernel.org/intel-gfx/20250827111109.401604-1-luciano.coelho@intel.com/
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'rust/helpers/build_assert.c')
0 files changed, 0 insertions, 0 deletions