Skip to content

tools: run coding-style checks via codingsty_check.sh#1503

Open
NishadSaraf wants to merge 3 commits into
amd:mainfrom
NishadSaraf:cp
Open

tools: run coding-style checks via codingsty_check.sh#1503
NishadSaraf wants to merge 3 commits into
amd:mainfrom
NishadSaraf:cp

Conversation

@NishadSaraf

Copy link
Copy Markdown
Member

codingsty_check.sh now accepts one or more files or directories and returns a non-zero exit status when checkpatch reports any error or warning, so it can gate CI and the pre-commit hook.

Point the pre-commit hook at codingsty_check.sh instead of the host-kernel checkpatch.pl, so local commits use the same latest-mainline checkpatch as CI.

@NishadSaraf NishadSaraf self-assigned this Jul 16, 2026
Copilot AI review requested due to automatic review settings July 16, 2026 23:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI review requested due to automatic review settings July 16, 2026 23:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

maxzhen
maxzhen previously approved these changes Jul 16, 2026
@amd-gevadlam

Copy link
Copy Markdown
Collaborator

retest this please

Copilot AI review requested due to automatic review settings July 17, 2026 00:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

Comment thread tools/pre-commit
Comment thread tools/pre-commit
Comment thread tools/codingsty_check.sh Outdated
Comment thread test/scripts/test_fw_dpt_xrt_smi.sh
Copilot AI review requested due to automatic review settings July 17, 2026 01:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread tools/codingsty_check.sh
codingsty_check.sh now accepts one or more files or directories and returns a
non-zero exit status when checkpatch reports any error or warning, so it can
gate CI and the pre-commit hook.

Point the pre-commit hook at codingsty_check.sh instead of the host-kernel
checkpatch.pl, so local commits use the same latest-mainline checkpatch as CI.

Signed-off-by: Nishad Saraf <nishads@amd.com>
checkpatch flags the sizeof-based kzalloc calls in amdxdna_cma_buf.c:

  WARNING: Prefer kzalloc_obj over kzalloc with sizeof

Convert the sg_table and cmabuf_priv allocations to kzalloc_obj(), matching
the type-aware allocation style already used across the accel/amdxdna driver.

Signed-off-by: Nishad Saraf <nishads@amd.com>
The fw_log/fw_trace multi-watcher tests launch three xrt-smi --watch
consumers, kill them, then snapshot each captured file and assert all
three hold the identical set of entries. A killed xrt-smi --watch child
flushes its final poll batch to stdout asynchronously, so 'wait'
returning does not guarantee the redirected file is complete: a
single-shot snapshot can catch one capture a few entries short and
report a spurious 'total-set equality violated' even though every
watcher received the identical ring content.

Reproduced on a Strix Halo/npu5 board: ~40% of runs failed, and in the
failing runs the three raw captures were byte-identical multisets while
one .sorted snapshot was computed microseconds before that file received
its final flush.

Compare the deduped sets with a bounded convergence retry
(watchers_converge): recompute the sort -u sets until all three match or
a ~5s timeout elapses. Because the data provably converges, this clears
the false failure; a genuine divergence never converges within the
timeout, so the assertion keeps its teeth. Validated 0/20 failures after
the change (was ~6/15 before).

Signed-off-by: Nishad Saraf <nishads@amd.com>
Copilot AI review requested due to automatic review settings July 17, 2026 01:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread tools/codingsty_check.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants