diff options
| author | James Clark <james.clark@linaro.org> | 2025-10-30 14:05:27 +0000 |
|---|---|---|
| committer | Marek Szyprowski <m.szyprowski@samsung.com> | 2025-11-05 13:43:41 +0100 |
| commit | a50f7456f853ec3a6f07cbe1d16ad8a8b2501320 (patch) | |
| tree | bdc54ebed8990c62178852a15fe5ac962c7ca643 /net/unix/af_unix.c | |
| parent | 23ee8a2563a0f24cf4964685ced23c32be444ab8 (diff) | |
dma-mapping: Allow use of DMA_BIT_MASK(64) in global scope
Clang doesn't like that (1ULL<<(64)) overflows when initializing a
global scope variable, even if that part of the ternary isn't used when
n = 64. The same initialization can be done without warnings in function
scopes, and GCC doesn't mind either way.
The build failure that highlighted this was already fixed in a different
way [1], which also has detailed links to the Clang issues. However it's
not going to be long before the same thing happens again, so it's better
to fix the root cause.
Fix it by using GENMASK_ULL() which does exactly the same thing, is much
more readable anyway, and doesn't have a shift that overflows.
[1]: https://lore.kernel.org/all/20250918-mmp-pdma-simplify-dma-addressing-v1-1-5c2be2b85696@riscstar.com/
Signed-off-by: James Clark <james.clark@linaro.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Link: https://lore.kernel.org/r/20251030-james-fix-dma_bit_mask-v1-1-ad1ce7cfab6e@linaro.org
Diffstat (limited to 'net/unix/af_unix.c')
0 files changed, 0 insertions, 0 deletions
