trunk/src/nvidia/src/kernel/gpu/ce/arch/pascal/kernel_ce_gp100.c:137: unclear coding ?

Open Beginner friendly
#112 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
c

Research direction

Open trunk/src/nvidia/src/kernel/gpu/ce/arch/pascal/kernel_ce_gp100.c at line 137 and review the return expression reported by cppcheck. Confirm the intended precedence of '&' and '?' against the surrounding code, then rerun cppcheck or the relevant checks to verify the warning is resolved.

Written by the indexing model from the issue text.

Description

bug

Static analyser cppcheck says:

src/nvidia/src/kernel/gpu/ce/arch/pascal/kernel_ce_gp100.c:137:53: style: Clarify calculation precedence for '&' and '?'. [clarifyCalculation]

Source code is

return (NVBIT(pKCe->publicID) & nvlinkP2PCeMask ? NV_TRUE : NV_FALSE);

Presumably

return (NVBIT(pKCe->publicID) & nvlinkP2PCeMask) ? NV_TRUE : NV_FALSE;

was intended ?

Dominant language
C
Stars
17.4k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NVIDIA/open-gpu-kernel-modules

All issues in NVIDIA/open-gpu-kernel-modules

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.