NVIDIA / NVIDIA/open-gpu-kernel-modules
src/nvidia/src/kernel/gpu/mem_mgr/heap.c:1607: unclear coding ?
Open
Nobody has claimed this yet.
cosmetic-postponed
- Dominant language
- C
- Stars
- 17.4k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
Static analyser cppcheck says:
src/nvidia/src/kernel/gpu/mem_mgr/heap.c:1607:69: style: Clarify calculation precedence for '&' and '?'. [clarifyCalculation]
Source code is
currentBankInfo = (currentBankInfo & BANK_MEM_GROW_DOWN ? MEM_GROW_DOWN : MEM_GROW_UP);
Presumably
currentBankInfo = (currentBankInfo & BANK_MEM_GROW_DOWN) ? MEM_GROW_DOWN : MEM_GROW_UP;
was intended.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect src/nvidia/src/kernel/gpu/mem_mgr/heap.c at line 1607 and review the cppcheck clarifyCalculation warning about '&' and '?'. Confirm the intended precedence from the issue text, make the expression unambiguous, and rerun cppcheck or the relevant validation to confirm the warning is resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- operating-systems
- Issue type
- Refactor
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 50/100