mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
gpu: nvgpu: whitelist MISRA 14.3 bugs
Whitelist MISRA Rule 14.3 violations that are due to a bug in the Coverity scanner documented in nvbug 2615925. JIRA NVGPU-4031 Change-Id: Ib8e03641578f27a774b05758cb292236f720c3ba Signed-off-by: Philip Elcan <pelcan@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2198904 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Alex Waterman
parent
039ec0b3da
commit
4874324ee5
@@ -95,6 +95,7 @@ static u64 nvgpu_bitmap_balloc_fixed(struct nvgpu_allocator *na,
|
||||
|
||||
a->bytes_alloced = nvgpu_safe_add_u64(a->bytes_alloced,
|
||||
nvgpu_safe_mult_u64(blks, a->blk_size));
|
||||
NVGPU_COV_WHITELIST(false_positive, NVGPU_MISRA(Rule, 14_3), "Bug 2615925")
|
||||
nvgpu_assert(a->nr_fixed_allocs < U64_MAX);
|
||||
a->nr_fixed_allocs++;
|
||||
alloc_unlock(na);
|
||||
@@ -272,6 +273,7 @@ static u64 nvgpu_bitmap_balloc(struct nvgpu_allocator *na, u64 len)
|
||||
alloc_dbg(na, "Alloc 0x%-10llx 0x%-5llx [bits=0x%x (%u)]",
|
||||
addr, len, blks, blks);
|
||||
|
||||
NVGPU_COV_WHITELIST(false_positive, NVGPU_MISRA(Rule, 14_3), "Bug 2615925")
|
||||
nvgpu_assert(a->nr_allocs < U64_MAX);
|
||||
a->nr_allocs++;
|
||||
a->bytes_alloced = nvgpu_safe_add_u64(a->bytes_alloced,
|
||||
|
||||
@@ -366,6 +366,7 @@ static inline s32 nvgpu_safe_cast_u64_to_s32(u64 ul_a)
|
||||
|
||||
static inline s64 nvgpu_safe_cast_u64_to_s64(u64 ul_a)
|
||||
{
|
||||
NVGPU_COV_WHITELIST(false_positive, NVGPU_MISRA(Rule, 14_3), "Bug 2615925")
|
||||
if (ul_a > LONG_MAX) {
|
||||
BUG();
|
||||
} else {
|
||||
|
||||
@@ -40,6 +40,7 @@ unsigned long nvgpu_posix_ffs(unsigned long word)
|
||||
nvgpu_safe_cast_u64_to_s64(
|
||||
(word & (unsigned long) LONG_MAX)));
|
||||
} else {
|
||||
NVGPU_COV_WHITELIST(false_positive, NVGPU_MISRA(Rule, 14_3), "Bug 2615925")
|
||||
if (word > (unsigned long) LONG_MAX) {
|
||||
ret = (int) 64;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user