mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-25 11:04:51 +03:00
gpu: nvgpu: fix MISRA 10.1 violation in nvgpu.common.mm.as
Below MISRA 10.1 violation is reported in nvgpu.common.mm.as
${TEGRA_TOP}/kernel/nvgpu/drivers/gpu/nvgpu/common/mm/as.c:69:
misra_violation: The expression "({...})" of non-boolean essential
type is being interpreted as a boolean value for the operator "!".
Fix this by adding an explicit cast to bool in is_power_of_2
macro.
Jira NVGPU-3333
Change-Id: I81e0110a6cd66088a5a39c63521efa41cbd90f48
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2117018
Reviewed-by: Philip Elcan <pelcan@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
340cb4fcc7
commit
9b2f6925ca
@@ -31,7 +31,7 @@
|
||||
#define rounddown_pow_of_two(x) (1UL << (fls(x) - 1UL))
|
||||
|
||||
#define is_power_of_2(x) \
|
||||
({ \
|
||||
(bool)({ \
|
||||
typeof(x) __x__ = (x); \
|
||||
(__x__ != 0U && ((__x__ & (__x__ - 1U)) == 0U));\
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user