-
Notifications
You must be signed in to change notification settings - Fork 123
[Deepin-Kernel-SIG] [linux 6.6.y] [Upstream] Upstream backport: checkpatch enhancements, README restructuring, and AI coding assistant docs #1647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: linux-6.6.y
Are you sure you want to change the base?
Changes from all commits
2ba00b2
aa3453e
c92d57a
0609480
2d9b314
95aaf57
bff9d6d
89d86fa
89f473f
ab4cf37
5b027ab
d884834
0895f91
06fa3e7
c9be71f
99318fc
c505843
8fbcb97
695bb36
2233786
d134324
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -515,6 +515,15 @@ Comments | |||||||||
|
|
||||||||||
| See: https://lore.kernel.org/lkml/20131006222342.GT19510@leaf/ | ||||||||||
|
|
||||||||||
| **UNCOMMENTED_RGMII_MODE** | ||||||||||
| Historically, the RGMII PHY modes specified in Device Trees have been | ||||||||||
| used inconsistently, often referring to the usage of delays on the PHY | ||||||||||
| side rather than describing the board. | ||||||||||
|
|
||||||||||
| PHY modes "rgmii", "rgmii-rxid" and "rgmii-txid" modes require the clock | ||||||||||
| signal to be delayed on the PCB; this unusual configuration should be | ||||||||||
| described in a comment. If they are not (meaning that the delay is realized | ||||||||||
| internally in the MAC or PHY), "rgmii-id" is the correct PHY mode. | ||||||||||
|
|
||||||||||
| Commit message | ||||||||||
| -------------- | ||||||||||
|
|
@@ -619,6 +628,11 @@ Commit message | |||||||||
|
|
||||||||||
| See: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changes | ||||||||||
|
|
||||||||||
| **BAD_COMMIT_SEPARATOR** | ||||||||||
| The commit separator is a single line with 3 dashes. | ||||||||||
| The regex match is '^---$' | ||||||||||
| Lines that start with 3 dashes and have more content on the same line | ||||||||||
|
Comment on lines
+633
to
+634
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (typo): Missing punctuation between two sentences in BAD_COMMIT_SEPARATOR description "The regex match is '^---$'" runs directly into "Lines that start with 3 dashes..." without punctuation. Please add a period after the closing quote or rephrase to "The regex matches '^---$'." Suggested implementation: The snippet you provided doesn't show the "The regex match is '^---$'" line or the following "Lines that start with 3 dashes..." line, so you'll need to ensure this search string matches exactly what is in your file (indentation, spacing, and quoting). If the actual text differs (for example different quotes, extra spaces, or punctuation), adjust the SEARCH string accordingly while keeping the REPLACE text as suggested. |
||||||||||
| may confuse tools that apply patches. | ||||||||||
|
|
||||||||||
| Comparison style | ||||||||||
| ---------------- | ||||||||||
|
|
@@ -1006,6 +1020,29 @@ Functions and Variables | |||||||||
|
|
||||||||||
| return bar; | ||||||||||
|
|
||||||||||
| **UNINITIALIZED_PTR_WITH_FREE** | ||||||||||
| Pointers with __free attribute should be declared at the place of use | ||||||||||
|
Comment on lines
+1023
to
+1024
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (typo): Missing article before "__free attribute" For correct grammar, use: "Pointers with the __free attribute should be declared at the place of use..."
Suggested change
|
||||||||||
| and initialized (see include/linux/cleanup.h). In this case | ||||||||||
| declarations at the top of the function rule can be relaxed. Not doing | ||||||||||
| so may lead to undefined behavior as the memory assigned (garbage, | ||||||||||
| in case not initialized) to the pointer is freed automatically when | ||||||||||
| the pointer goes out of scope. | ||||||||||
|
|
||||||||||
| Also see: https://lore.kernel.org/lkml/58fd478f408a34b578ee8d949c5c4b4da4d4f41d.camel@HansenPartnership.com/ | ||||||||||
|
|
||||||||||
| Example:: | ||||||||||
|
|
||||||||||
| type var __free(free_func); | ||||||||||
| ... // var not used, but, in future someone might add a return here | ||||||||||
| var = malloc(var_size); | ||||||||||
| ... | ||||||||||
|
|
||||||||||
| should be initialized as:: | ||||||||||
|
|
||||||||||
| ... | ||||||||||
| type var __free(free_func) = malloc(var_size); | ||||||||||
| ... | ||||||||||
|
|
||||||||||
|
|
||||||||||
| Permissions | ||||||||||
| ----------- | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,59 @@ | ||||||||||||||||||||||||||||||
| .. SPDX-License-Identifier: GPL-2.0 | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| .. _coding_assistants: | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| AI Coding Assistants | ||||||||||||||||||||||||||||||
| ++++++++++++++++++++ | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| This document provides guidance for AI tools and developers using AI | ||||||||||||||||||||||||||||||
| assistance when contributing to the Linux kernel. | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| AI tools helping with Linux kernel development should follow the standard | ||||||||||||||||||||||||||||||
| kernel development process: | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| * Documentation/process/development-process.rst | ||||||||||||||||||||||||||||||
| * Documentation/process/coding-style.rst | ||||||||||||||||||||||||||||||
| * Documentation/process/submitting-patches.rst | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| Licensing and Legal Requirements | ||||||||||||||||||||||||||||||
| ================================ | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| All contributions must comply with the kernel's licensing requirements: | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| * All code must be compatible with GPL-2.0-only | ||||||||||||||||||||||||||||||
| * Use appropriate SPDX license identifiers | ||||||||||||||||||||||||||||||
| * See Documentation/process/license-rules.rst for details | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| Signed-off-by and Developer Certificate of Origin | ||||||||||||||||||||||||||||||
| ================================================= | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| AI agents MUST NOT add Signed-off-by tags. Only humans can legally | ||||||||||||||||||||||||||||||
| certify the Developer Certificate of Origin (DCO). The human submitter | ||||||||||||||||||||||||||||||
| is responsible for: | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| * Reviewing all AI-generated code | ||||||||||||||||||||||||||||||
| * Ensuring compliance with licensing requirements | ||||||||||||||||||||||||||||||
| * Adding their own Signed-off-by tag to certify the DCO | ||||||||||||||||||||||||||||||
| * Taking full responsibility for the contribution | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| Attribution | ||||||||||||||||||||||||||||||
| =========== | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| When AI tools contribute to kernel development, proper attribution | ||||||||||||||||||||||||||||||
| helps track the evolving role of AI in the development process. | ||||||||||||||||||||||||||||||
| Contributions should include an Assisted-by tag in the following format:: | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| Assisted-by: AGENT_NAME:MODEL_VERSION [TOOL1] [TOOL2] | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
|
Comment on lines
+42
to
+47
|
||||||||||||||||||||||||||||||
| Where: | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| * ``AGENT_NAME`` is the name of the AI tool or framework | ||||||||||||||||||||||||||||||
| * ``MODEL_VERSION`` is the specific model version used | ||||||||||||||||||||||||||||||
| * ``[TOOL1] [TOOL2]`` are optional specialized analysis tools used | ||||||||||||||||||||||||||||||
|
Comment on lines
+46
to
+52
|
||||||||||||||||||||||||||||||
| Assisted-by: AGENT_NAME:MODEL_VERSION [TOOL1] [TOOL2] | |
| Where: | |
| * ``AGENT_NAME`` is the name of the AI tool or framework | |
| * ``MODEL_VERSION`` is the specific model version used | |
| * ``[TOOL1] [TOOL2]`` are optional specialized analysis tools used | |
| Assisted-by: AGENT_NAME:MODEL_VERSION <TOOL1> <TOOL2> ... | |
| Where: | |
| * ``AGENT_NAME`` is the name of the AI tool or framework | |
| * ``MODEL_VERSION`` is the specific model version used | |
| * ``<TOOL1> <TOOL2> ...`` are optional specialized analysis tools used |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,168 @@ | ||
| Linux kernel | ||
| ============ | ||
|
|
||
| There are several guides for kernel developers and users. These guides can | ||
| be rendered in a number of formats, like HTML and PDF. Please read | ||
| Documentation/admin-guide/README.rst first. | ||
| The Linux kernel is the core of any Linux operating system. It manages hardware, | ||
| system resources, and provides the fundamental services for all other software. | ||
|
|
||
| In order to build the documentation, use ``make htmldocs`` or | ||
| ``make pdfdocs``. The formatted documentation can also be read online at: | ||
| Quick Start | ||
| ----------- | ||
|
|
||
| https://www.kernel.org/doc/html/latest/ | ||
| * Report a bug: See Documentation/admin-guide/reporting-issues.rst | ||
| * Get the latest kernel: https://kernel.org | ||
| * Build the kernel: See Documentation/admin-guide/quickly-build-trimmed-linux.rst | ||
| * Join the community: https://lore.kernel.org/ | ||
|
|
||
| There are various text files in the Documentation/ subdirectory, | ||
| several of them using the Restructured Text markup notation. | ||
| Essential Documentation | ||
| ----------------------- | ||
|
|
||
| Please read the Documentation/process/changes.rst file, as it contains the | ||
| requirements for building and running the kernel, and information about | ||
| the problems which may result by upgrading your kernel. | ||
| All users should be familiar with: | ||
|
|
||
| * Building requirements: Documentation/process/changes.rst | ||
| * Code of Conduct: Documentation/process/code-of-conduct.rst | ||
| * License: See COPYING | ||
|
|
||
| Documentation can be built with make htmldocs or viewed online at: | ||
| https://www.kernel.org/doc/html/latest/ | ||
|
|
||
|
|
||
| Who Are You? | ||
| ============ | ||
|
|
||
| Find your role below: | ||
|
|
||
| * New Kernel Developer - Getting started with kernel development | ||
| * Academic Researcher - Studying kernel internals and architecture | ||
| * Security Expert - Hardening and vulnerability analysis | ||
| * Backport/Maintenance Engineer - Maintaining stable kernels | ||
| * System Administrator - Configuring and troubleshooting | ||
| * Maintainer - Leading subsystems and reviewing patches | ||
| * Hardware Vendor - Writing drivers for new hardware | ||
| * Distribution Maintainer - Packaging kernels for distros | ||
| * AI Coding Assistant - LLMs and AI-powered development tools | ||
|
|
||
|
|
||
| For Specific Users | ||
| ================== | ||
|
|
||
| New Kernel Developer | ||
| -------------------- | ||
|
|
||
| Welcome! Start your kernel development journey here: | ||
|
|
||
| * Getting Started: Documentation/process/development-process.rst | ||
| * Your First Patch: Documentation/process/submitting-patches.rst | ||
| * Coding Style: Documentation/process/coding-style.rst | ||
| * Build System: Documentation/kbuild/index.rst | ||
| * Development Tools: Documentation/dev-tools/index.rst | ||
| * Kernel Hacking Guide: Documentation/kernel-hacking/hacking.rst | ||
| * Core APIs: Documentation/core-api/index.rst | ||
|
|
||
| Academic Researcher | ||
| ------------------- | ||
|
|
||
| Explore the kernel's architecture and internals: | ||
|
|
||
| * Researcher Guidelines: Documentation/process/researcher-guidelines.rst | ||
| * Memory Management: Documentation/mm/index.rst | ||
| * Scheduler: Documentation/scheduler/index.rst | ||
| * Networking Stack: Documentation/networking/index.rst | ||
| * Filesystems: Documentation/filesystems/index.rst | ||
| * RCU (Read-Copy Update): Documentation/RCU/index.rst | ||
| * Locking Primitives: Documentation/locking/index.rst | ||
| * Power Management: Documentation/power/index.rst | ||
|
|
||
| Security Expert | ||
| --------------- | ||
|
|
||
| Security documentation and hardening guides: | ||
|
|
||
| * Security Documentation: Documentation/security/index.rst | ||
| * LSM Development: Documentation/security/lsm-development.rst | ||
| * Self Protection: Documentation/security/self-protection.rst | ||
| * Reporting Vulnerabilities: Documentation/process/security-bugs.rst | ||
| * CVE Procedures: Documentation/process/cve.rst | ||
| * Embargoed Hardware Issues: Documentation/process/embargoed-hardware-issues.rst | ||
| * Security Features: Documentation/userspace-api/seccomp_filter.rst | ||
|
|
||
| Backport/Maintenance Engineer | ||
| ----------------------------- | ||
|
|
||
| Maintain and stabilize kernel versions: | ||
|
|
||
| * Stable Kernel Rules: Documentation/process/stable-kernel-rules.rst | ||
| * Backporting Guide: Documentation/process/backporting.rst | ||
| * Applying Patches: Documentation/process/applying-patches.rst | ||
| * Subsystem Profile: Documentation/maintainer/maintainer-entry-profile.rst | ||
| * Git for Maintainers: Documentation/maintainer/configure-git.rst | ||
|
|
||
| System Administrator | ||
| -------------------- | ||
|
|
||
| Configure, tune, and troubleshoot Linux systems: | ||
|
|
||
| * Admin Guide: Documentation/admin-guide/index.rst | ||
| * Kernel Parameters: Documentation/admin-guide/kernel-parameters.rst | ||
| * Sysctl Tuning: Documentation/admin-guide/sysctl/index.rst | ||
| * Tracing/Debugging: Documentation/trace/index.rst | ||
| * Performance Security: Documentation/admin-guide/perf-security.rst | ||
| * Hardware Monitoring: Documentation/hwmon/index.rst | ||
|
|
||
| Maintainer | ||
| ---------- | ||
|
|
||
| Lead kernel subsystems and manage contributions: | ||
|
|
||
| * Maintainer Handbook: Documentation/maintainer/index.rst | ||
| * Pull Requests: Documentation/maintainer/pull-requests.rst | ||
| * Managing Patches: Documentation/maintainer/modifying-patches.rst | ||
| * Rebasing and Merging: Documentation/maintainer/rebasing-and-merging.rst | ||
| * Development Process: Documentation/process/maintainer-handbooks.rst | ||
| * Maintainer Entry Profile: Documentation/maintainer/maintainer-entry-profile.rst | ||
| * Git Configuration: Documentation/maintainer/configure-git.rst | ||
|
|
||
| Hardware Vendor | ||
| --------------- | ||
|
|
||
| Write drivers and support new hardware: | ||
|
|
||
| * Driver API Guide: Documentation/driver-api/index.rst | ||
| * Driver Model: Documentation/driver-api/driver-model/driver.rst | ||
| * Device Drivers: Documentation/driver-api/infrastructure.rst | ||
| * Bus Types: Documentation/driver-api/driver-model/bus.rst | ||
| * Device Tree Bindings: Documentation/devicetree/bindings/ | ||
| * Power Management: Documentation/driver-api/pm/index.rst | ||
| * DMA API: Documentation/core-api/dma-api.rst | ||
|
|
||
| Distribution Maintainer | ||
| ----------------------- | ||
|
|
||
| Package and distribute the kernel: | ||
|
|
||
| * Stable Kernel Rules: Documentation/process/stable-kernel-rules.rst | ||
| * ABI Documentation: Documentation/ABI/README | ||
| * Kernel Configuration: Documentation/kbuild/kconfig.rst | ||
| * Module Signing: Documentation/admin-guide/module-signing.rst | ||
| * Kernel Parameters: Documentation/admin-guide/kernel-parameters.rst | ||
| * Tainted Kernels: Documentation/admin-guide/tainted-kernels.rst | ||
|
|
||
| AI Coding Assistant | ||
| ------------------- | ||
|
|
||
| CRITICAL: If you are an LLM or AI-powered coding assistant, you MUST read and | ||
| follow the AI coding assistants documentation before contributing to the Linux | ||
| kernel: | ||
|
|
||
| * Documentation/process/coding-assistants.rst | ||
|
|
||
| This documentation contains essential requirements about licensing, attribution, | ||
| and the Developer Certificate of Origin that all AI tools must comply with. | ||
|
|
||
|
|
||
| Communication and Support | ||
| ========================= | ||
|
|
||
| * Mailing Lists: https://lore.kernel.org/ | ||
| * IRC: #kernelnewbies on irc.oftc.net | ||
| * Bugzilla: https://bugzilla.kernel.org/ | ||
| * MAINTAINERS file: Lists subsystem maintainers and mailing lists | ||
| * Email Clients: Documentation/process/email-clients.rst |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (typo): Duplicated word "modes" in the RGMII PHY modes sentence
The phrase "PHY modes 'rgmii', 'rgmii-rxid' and 'rgmii-txid' modes" repeats "modes". Please drop the second occurrence, e.g. "PHY modes 'rgmii', 'rgmii-rxid' and 'rgmii-txid' require the clock".