Skip to content

[Deepin-Kernel-SIG] [linux 6.6.y] [Upstream] Upstream backport: checkpatch enhancements, README restructuring, and AI coding assistant docs #1647

Open
Avenger-285714 wants to merge 21 commits intodeepin-community:linux-6.6.yfrom
Avenger-285714:aidoc-6.6
Open

[Deepin-Kernel-SIG] [linux 6.6.y] [Upstream] Upstream backport: checkpatch enhancements, README restructuring, and AI coding assistant docs #1647
Avenger-285714 wants to merge 21 commits intodeepin-community:linux-6.6.yfrom
Avenger-285714:aidoc-6.6

Conversation

@Avenger-285714
Copy link
Copy Markdown
Member

@Avenger-285714 Avenger-285714 commented Apr 24, 2026

This PR backports upstream improvements to the kernel's patch checking infrastructure,
documentation, and contributor guidelines. All commits are signed-off and rebased.

checkpatch.pl improvements (16 commits)

Enhance the kernel patch style checker with new validations and bug fixes:

  • New checks:

    • Detect unhandled placeholders in cover letters
    • Warn about context_unsafe() without explanatory comment
    • Flag uninitialized pointers with __free attribute
    • Check for missing sentinels in ID device arrays (of_device_id, pci_device_id, etc.)
    • Require comments for RGMII PHY modes in Device Trees
    • Add invalid patch separator test (3 dashes with trailing content)
    • Suggest kmalloc_obj family for sizeof() allocations
    • Add IDR APIs to the deprecated list
  • False positive fixes:

    • Suppress strscpy warnings for userspace tools (tools/, scripts/)
    • Allow HTTP links of any length in commit logs
    • Special-case cacheline group macros to avoid spurious warnings
    • Fix false DT_SPLIT_BINDING_PATCH warnings on deleted files
    • Don't complain on _Generic() use (improve CamelCase detection)
    • Use UTF-8 matching for spell checking (fixes false misspelling on non-ASCII names)
  • Robustness & clarity:

    • Align git commit ID abbreviation guidelines: accept 12+ characters consistently
    • Check return of git_commit_info to avoid undefined variable concatenation
    • Describe --min-conf-desc-length unit explicitly as "lines" with default 4

Documentation (2 commits)

  • Add new Documentation/process/coding-assistants.rst with guidance for AI-assisted
    kernel contributions (licensing, Signed-off-by, attribution format)
  • Restructure README with role-based documentation paths for developers, researchers,
    security experts, and maintainers; add quick-start section

README fixes (1 commit)

  • Fix "ReStructured Text" spelling/capitalization to "reStructuredText"

Files changed: 7
Insertions: 396, Deletions: 38

Summary by Sourcery

Document guidelines for using AI coding assistants in kernel development and surface this guidance from existing documentation entry points.

Enhancements:

  • Backport upstream README updates to resolve conflicts while aligning with the latest documentation structure.

Documentation:

  • Add a new coding-assistants.rst document detailing expectations and requirements for AI-assisted kernel contributions, including licensing, attribution, and Signed-off-by usage.
  • Link the new AI assistant guidelines into the process documentation index for discoverability.
  • Adjust the top-level README to direct AI tools and users to the new coding assistant documentation.

Summary by Sourcery

Backport upstream improvements to the kernel checkpatch script and documentation, including new validations, clearer diagnostics, and guidance for AI-assisted contributions, while updating the top-level README structure.

New Features:

  • Extend checkpatch to detect placeholder text in commit messages, invalid patch separators, missing sentinels in device ID tables, uninitialized __free pointers, uncommented context_unsafe usage, and RGMII PHY modes without explanatory comments.
  • Add new recommendations in checkpatch for preferred allocation helpers and deprecate legacy IDR APIs.
  • Introduce Documentation/process/coding-assistants.rst describing expectations and requirements for AI-assisted kernel contributions and how to attribute such tools.

Bug Fixes:

  • Relax Fixes: tag validation to accept 12+ character commit IDs and avoid using undefined commit metadata when git lookup fails.
  • Prevent false-positive checkpatch warnings for strcpy/strlcpy/strncpy in userspace code, cacheline grouping macros, _Generic uses, long HTTP links, DT binding patches on deleted files, and non-ASCII spellings by improving context detection and UTF-8 handling.
  • Clarify the meaning of the --min-conf-desc-length option and the associated warning message for configuration symbol descriptions.

Enhancements:

  • Refine checkpatch style guidance for config help text and allocation patterns to better reflect current kernel practices.
  • Improve spell-check robustness in checkpatch by operating on UTF-8 decoded lines and preserving pointer diagnostics.
  • Tighten device-tree specific checks to require comments for certain RGMII PHY modes when delays are handled on the PCB.

Documentation:

  • Add a new coding-assistants process document and link it from the process index and maintainer tips to guide AI-assisted development practices.
  • Restructure and expand the top-level README to provide role-based navigation, a quick-start section, and explicit pointers to coding assistant documentation.
  • Correct the spelling and capitalization of “reStructuredText” in the README.

toblux and others added 4 commits April 24, 2026 19:41
[Upstream commit 693fe59]

- Fix spelling/capitalization s/Restructured/ReStructured/

Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20240207122127.9182-1-thorsten.blum@toblux.com
Signed-off-by: WangYuli <wangyl5933@chinaunicom.cn>
[Upstream commit bf4401f]

- ReStructured Text should be exactly reStructuredText
- "reStructuredText" is ONE word, not two! according to https://docutils.sourceforge.io/rst.html

Signed-off-by: Maki Hatano <Maki.Y.Hatano@gmail.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <20240313100136.20424-1-Maki.Y.Hatano@gmail.com>
Signed-off-by: WangYuli <wangyl5933@chinaunicom.cn>
[Upstream commit b9a565b]

Reorganize README to provide targeted documentation paths for different user
roles including developers, researchers, security experts, and maintainers.

Add quick start section and essential docs links.

Signed-off-by: Sasha Levin <sashal@kernel.org>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Reviewed-by: Kees Cook <kees@kernel.org>
Reviewed-by: SeongJae Park <sj@kernel.org>
Reviewed-by: Bagas Sanjaya <bagasdotme@gmail.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <20251121180009.2634393-1-sashal@kernel.org>
Signed-off-by: WangYuli <wangyl5933@chinaunicom.cn>
[Upstream commit 78d979d]

Add guidance for AI assistants and developers using AI tools for kernel
contributions, per the consensus reached at the 2025 Maintainers Summit.

Create Documentation/process/coding-assistants.rst with detailed guidance
on licensing, Signed-off-by requirements, and attribution format. The
README points AI tools to this documentation.

This will allow coding assistants to easily parse these instructions and
comply with guidelines set by the community.

Link: https://lwn.net/Articles/1049830/
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <20251223122110.2496946-1-sashal@kernel.org>
[WangYuli: Fix conflicts]
Signed-off-by: WangYuli <wangyl5933@chinaunicom.cn>
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Apr 24, 2026

Reviewer's Guide

Backports a series of upstream improvements to scripts/checkpatch.pl (new style checks, false-positive reductions, and robustness fixes) and updates documentation by restructuring the top-level README and adding AI coding assistant contribution guidelines wired into the process docs.

Sequence diagram for Fixes tag validation with git_commit_info

sequenceDiagram
  participant Dev as Developer
  participant Checkpatch as checkpatch_pl
  participant Git as git_commit_info

  Dev->>Checkpatch: Run checkpatch on patch
  Checkpatch->>Checkpatch: Detect Fixes line in commit log
  Checkpatch->>Git: git_commit_info(orig_commit, id, title)
  Git-->>Checkpatch: cid, ctitle
  Checkpatch->>Checkpatch: Validate commit id length (12-40), case, spacing, quotes
  alt Bad Fixes tag and cid defined
    Checkpatch->>Checkpatch: Build corrected Fixes line
    Checkpatch-->>Dev: WARN BAD_FIXES_TAG with suggested Fixes: cid ("ctitle")
    opt --fix option enabled
      Checkpatch->>Checkpatch: Replace line with corrected Fixes tag
    end
  else cid not defined
    Checkpatch->>Checkpatch: Skip BAD_FIXES_TAG warning
  end
  Checkpatch-->>Dev: Continue reporting other issues and summary
Loading

Class diagram for logical components in checkpatch.pl

classDiagram
  class CheckpatchProcess {
    +process(filename)
    +exclude_global_initialisers(realfile)
    +is_userspace(realfile)
  }

  class CommitLogChecks {
    +check_placeholder_text(line, in_commit_log, in_header_lines)
    +check_bad_commit_separator(line, in_commit_log, fix)
    +check_fixes_tag(line, herecurr, fix)
    +check_commit_log_long_line(line, herecurr)
    +spell_check_line(rawline, misspellings, hereptr)
  }

  class ConfigHelpChecks {
    +check_config_description(linenr, help_length, min_conf_desc_length)
  }

  class DeviceTreeChecks {
    +check_uncommented_rgmii_mode(realfile, line, first_line, linenr, herecurr)
  }

  class ContextChecks {
    +ctx_has_comment(first_line, linenr)
    +check_context_unsafe(line, first_line, linenr, herecurr)
  }

  class StringUsageChecks {
    +check_strcpy_usage(line, realfile, herecurr)
    +check_strlcpy_usage(line, realfile, herecurr)
    +check_strncpy_usage(line, realfile, herecurr)
  }

  class AllocationChecks {
    +check_alloc_with_sizeof(stat, linenr, here, fix)
    +check_alloc_with_multiply(stat, linenr, here, fix)
  }

  class DeviceIdChecks {
    +dev_id_types
    +check_device_id_sentinel(stat, line, here)
  }

  class PointerChecks {
    +check_uninitialized_free_pointer(line, herecurr)
  }

  class GitIntegration {
    +git_commit_info(orig_commit, id, title)
  }

  class SpellingSupport {
    +decode_utf8(rawline)
    +copy_spacing(rawline_utf8)
  }

  CheckpatchProcess --> CommitLogChecks : uses
  CheckpatchProcess --> ConfigHelpChecks : uses
  CheckpatchProcess --> DeviceTreeChecks : uses
  CheckpatchProcess --> ContextChecks : uses
  CheckpatchProcess --> StringUsageChecks : uses
  CheckpatchProcess --> AllocationChecks : uses
  CheckpatchProcess --> DeviceIdChecks : uses
  CheckpatchProcess --> PointerChecks : uses
  CommitLogChecks --> GitIntegration : uses
  CommitLogChecks --> SpellingSupport : uses
  ContextChecks <.. DeviceTreeChecks : uses
  StringUsageChecks <.. CheckpatchProcess : calls is_userspace
  DeviceIdChecks <.. CheckpatchProcess : uses dev_id_types
Loading

File-Level Changes

Change Details Files
Extend checkpatch.pl with new diagnostics and automatic fix suggestions for device IDs, allocation helpers, context safety, placeholders, RGMII DT modes, uninitialized __free pointers, and Fixes tags.
  • Document --min-conf-desc-length more clearly in help output and warning text, stating units (lines) and default value.
  • Add dev_id_types regex and logic to detect _device_id arrays missing sentinel entries, including stripping diff/whitespace noise before checking.
  • Add warnings for context_unsafe() used without a nearby explanatory comment and for RGMII phy-mode/phy-connection-type without a context comment in DT files.
  • Introduce PLACEHOLDER_USE error for common auto-generated cover letter placeholders like 'SUBJECT HERE' or 'BLURB HERE' in commit logs/headers.
  • Warn on uninitialized pointers annotated with the __free attribute when they appear in declarations.
  • Add BAD_COMMIT_SEPARATOR error for commit log separators like '--- ...' that have trailing content instead of a clean '---' line.
  • Enhance Fixes: tag validation to accept 12–40 character SHA-1s, guard git_commit_info() usage with defined() checks, and refactor the suggested replacement into a local variable.
  • Relax COMMIT_LOG_LONG_LINE to allow arbitrary-length http/https links by treating them as exempted lines.
  • Switch spelling check to operate on UTF-8 decoded lines to avoid false positives on non-ASCII words while still using the existing misspelling patterns.
  • Add cacheline-group macros (_cacheline_group{begin,end}[_aligned], _dma_from_device_group{begin,end}) to the type pattern whitelist to avoid spurious warnings.
  • Add is_userspace() helper and use it to suppress STRCPY/STRLCPY/STRNCPY warnings for files under tools/ and scripts/.
  • Add IDR APIs (DEFINE_IDR, idr_init, idr_init_base) to the deprecated signature mapping, recommending XArray replacements.
  • Introduce new kmalloc_obj/kvmalloc_obj*/kzalloc_obj*/kvzalloc_obj* suggestions when (kv
k)[mz]alloc is used with sizeof, including an auto-fix rewrite when safe.
  • Update the multiply-allocation heuristic to suggest kmalloc_objs*/kvmalloc_objs*/kzalloc_objs*/kvzalloc_objs* instead of *array/*calloc APIs and adjust the auto-fix to convert the sizeof expression into the typed argument name.
  • Exclude /dev/null from DT binding split checks by allowing MAINTAINERS
  • Improve documentation around contribution processes, especially for AI-assisted development, and integrate the new guidance into existing process indices and maintainer tips.
    • Add Documentation/process/coding-assistants.rst describing expectations for using AI coding assistants in kernel development, including licensing, attribution, and Signed-off-by requirements.
    • Link the new coding-assistants.rst document from Documentation/process/index.rst so it appears in the main process documentation TOC.
    • Update maintainer-focused docs (maintainer-tip.rst, submitting-patches.rst, and/or related process docs) to reference or align with the AI assistant guidance and checkpatch behavior where relevant.
    Documentation/process/coding-assistants.rst
    Documentation/process/index.rst
    Documentation/process/maintainer-tip.rst
    Documentation/process/submitting-patches.rst
    Restructure and polish the top-level README to clarify audience-specific entry points and fix minor terminology issues.
    • Rewrite/expand README sections to provide role-based pointers for developers, researchers, security experts, and maintainers, and add a quick-start section.
    • Add explicit guidance in README directing AI tools and contributors to the new coding-assistants documentation.
    • Fix the spelling/capitalization of 'ReStructured Text' to the correct 'reStructuredText' form.
    README

    Tips and commands

    Interacting with Sourcery

    • Trigger a new review: Comment @sourcery-ai review on the pull request.
    • Continue discussions: Reply directly to Sourcery's review comments.
    • Generate a GitHub issue from a review comment: Ask Sourcery to create an
      issue from a review comment by replying to it. You can also reply to a
      review comment with @sourcery-ai issue to create an issue from it.
    • Generate a pull request title: Write @sourcery-ai anywhere in the pull
      request title to generate a title at any time. You can also comment
      @sourcery-ai title on the pull request to (re-)generate the title at any time.
    • Generate a pull request summary: Write @sourcery-ai summary anywhere in
      the pull request body to generate a PR summary at any time exactly where you
      want it. You can also comment @sourcery-ai summary on the pull request to
      (re-)generate the summary at any time.
    • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
      request to (re-)generate the reviewer's guide at any time.
    • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
      pull request to resolve all Sourcery comments. Useful if you've already
      addressed all the comments and don't want to see them anymore.
    • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
      request to dismiss all existing Sourcery reviews. Especially useful if you
      want to start fresh with a new review - don't forget to comment
      @sourcery-ai review to trigger a new review!

    Customizing Your Experience

    Access your dashboard to:

    • Enable or disable review features such as the Sourcery-generated pull request
      summary, the reviewer's guide, and others.
    • Change the review language.
    • Add, remove or edit custom review instructions.
    • Adjust other review settings.

    Getting Help

    @deepin-ci-robot
    Copy link
    Copy Markdown

    [APPROVALNOTIFIER] This PR is NOT APPROVED

    This pull-request has been approved by:
    Once this PR has been reviewed and has the lgtm label, please ask for approval from avenger-285714. For more information see the Code Review Process.

    The full list of commands accepted by this bot can be found here.

    Details Needs approval from an approver in each of these files:

    Approvers can indicate their approval by writing /approve in a comment
    Approvers can cancel approval by writing /approve cancel in a comment

    Copy link
    Copy Markdown

    @sourcery-ai sourcery-ai Bot left a comment

    Choose a reason for hiding this comment

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

    Hey - I've reviewed your changes and they look great!


    Sourcery is free for open source - if you like our reviews please consider sharing them ✨
    Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

    Copy link
    Copy Markdown

    Copilot AI left a comment

    Choose a reason for hiding this comment

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

    Pull request overview

    Adds a new process document describing expectations for AI-assisted kernel contributions and updates entry points so humans and tools can discover it (README + process index).

    Changes:

    • Expand README into a role-oriented entry document and add a prominent pointer for AI coding assistants to the new guidance.
    • Add Documentation/process/coding-assistants.rst covering licensing, DCO / Signed-off-by handling, and attribution expectations.
    • Include the new document in Documentation/process/index.rst to surface it in the rendered “process” docs.

    Reviewed changes

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

    File Description
    README Reworks the top-level entry points and adds an explicit pointer to the AI assistants guidance.
    Documentation/process/index.rst Adds the new AI assistants document to the process toctree.
    Documentation/process/coding-assistants.rst Introduces AI-assistant contribution guidance (licensing, sign-off responsibilities, attribution format).

    💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

    Comment on lines +42 to +47
    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]

    Copy link

    Copilot AI Apr 24, 2026

    Choose a reason for hiding this comment

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

    The documented Assisted-by: format/example does not include a Name <email> identity. In this tree, scripts/checkpatch.pl treats any *-by: tag as a signature and will error out with “Unrecognized email address” when the text after the tag is not parseable as an email identity (see scripts/checkpatch.pl around the signature-style checks). Please adjust the documented format to include a valid email identity (or use a different tag name that doesn’t match *-by: / update checkpatch to explicitly accept the intended format).

    Copilot uses AI. Check for mistakes.
    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
    Copy link

    Copilot AI Apr 24, 2026

    Choose a reason for hiding this comment

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

    The Assisted-by: format line uses [TOOL1] [TOOL2] (square brackets), but the example omits brackets. If the brackets are meant to indicate optional items (not literal characters), consider switching to a placeholder style that can’t be mistaken for part of the actual tag value and keep the format line and example consistent for tooling that will parse it.

    Suggested change
    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

    Copilot uses AI. Check for mistakes.
    @Avenger-285714 Avenger-285714 marked this pull request as draft April 24, 2026 12:13
    @Avenger-285714 Avenger-285714 marked this pull request as draft April 24, 2026 12:13
    tamird and others added 14 commits April 24, 2026 20:25
    [Upstream commit 3735c52]
    
    Avoid string concatenation with an undefined variable when a reference to
    a missing commit is contained in a `Fixes` tag.
    
    Given this patch:
    
    : From: Tamir Duberstein <tamird@gmail.com>
    : Subject: Test patch
    : Date: Fri, 25 Oct 2024 19:30:51 -0400
    :
    : This is a test patch.
    :
    : Fixes: deadbeef111
    : Signed-off-by: Tamir Duberstein <tamird@gmail.com>
    : --- /dev/null
    : +++ b/new-file
    : @@ -0,0 +1 @@
    : +Test.
    
    Before:
    
    WARNING: Please use correct Fixes: style 'Fixes: <12 chars of sha1> ("<title line>")' - ie: 'Fixes:  ("commit title")'
    WARNING: Unknown commit id 'deadbeef111', maybe rebased or not pulled?
    Use of uninitialized value $cid in concatenation (.) or string at scripts/checkpatch.pl line 3242.
    
    After:
    
    WARNING: Unknown commit id 'deadbeef111', maybe rebased or not pulled?
    
    This patch also reduce duplication slightly.
    
    [akpm@linux-foundation.org: s/12 chars of sha1/12+ chars of sha1/, per Jon]
      Link: https://lkml.kernel.org/r/87o70kt232.fsf@trenco.lwn.net
    Link: https://lkml.kernel.org/r/20241204-checkpatch-missing-commit-v1-1-68b34c94944e@gmail.com
    Signed-off-by: Tamir Duberstein <tamird@gmail.com>
    Cc: Andy Whitcroft <apw@canonical.com>
    Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>
    Cc: Joe Perches <joe@perches.com>
    Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
    Cc: Jonathan Corbet <corbet@lwn.net>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: WangYuli <wangyl5933@chinaunicom.cn>
    [Upstream commit bc2f19d]
    
    Neither the warning nor the help message gives any hint on the unit for
    length: Could be meters, inches, bytes, characters or ...  lines.
    
    Extend the output of `--help` to name the unit "lines" and the default:
    -  --min-conf-desc-length=n   set the min description length, if shorter, warn
    +  --min-conf-desc-length=n   set the minimum description length for config symbols
    +                             in lines, if shorter, warn (default 4)
    
    Include the minimum number of lines as other error messages already do:
    - WARNING: please write a help paragraph that fully describes the config symbol
    + WARNING: please write a help paragraph that fully describes the config symbol with at least 4 lines
    
    Link: https://lkml.kernel.org/r/c71c170c90eba26265951e248adfedd3245fe575.1741605695.git.p.hahn@avm.de
    Signed-off-by: Philipp Hahn <p.hahn@avm.de>
    Cc: Andy Whitcroft <apw@canonical.com>
    Cc: Joe Perches <joe@perches.com>
    Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>
    Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: WangYuli <wangyl5933@chinaunicom.cn>
    [Upstream commit e02adac]
    
    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; many drivers still implement this
    incorrectly.
    
    Require a comment in Devices Trees using these modes (usually mentioning
    that the delay is realized on the PCB), so we can avoid adding more
    incorrect uses (or will at least notice which drivers still need to be
    fixed).
    
    Suggested-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Link: https://patch.msgid.link/bc112b8aa510cf9df9ab33178d122f234d0aebf7.1750756583.git.matthias.schiffer@ew.tq-group.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: WangYuli <wangyl5933@chinaunicom.cn>
    [Upstream commit 5eee4c2]
    
    The current code that checks for misspelling verifies, in a more
    complex regex, if $rawline matches [^\w]($misspellings)[^\w]
    
    Being $rawline a byte-string, a utf-8 character in $rawline can
    match the non-word-char [^\w].
    E.g.:
    	./scripts/checkpatch.pl --git 81c2f05
    	WARNING: 'ment' may be misspelled - perhaps 'meant'?
    	deepin-community#36: FILE: MAINTAINERS:14360:
    	+M:     Clément Léger <clement.leger@bootlin.com>
    	            ^^^^
    
    Use a utf-8 version of $rawline for spell checking.
    
    Link: https://lkml.kernel.org/r/20250616-b4-checkpatch-upstream-v2-1-5600ce4a3b43@foss.st.com
    Signed-off-by: Antonio Borneo <antonio.borneo@foss.st.com>
    Signed-off-by: Clément Le Goffic <clement.legoffic@foss.st.com>
    Cc: Andy Whitcroft <apw@canonical.com>
    Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>
    Cc: Joe Perches <joe@perches.com>
    Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: WangYuli <wangyl5933@chinaunicom.cn>
    [Upstream commit 22c2ed6]
    
    All of the ID tables based on <linux/mod_devicetable.h> (of_device_id,
    pci_device_id, ...) require their arrays to end in an empty sentinel
    value.  That's usually spelled with an empty initializer entry (e.g.,
    "{}"), but also sometimes with explicit 0 entries, field initializers
    (e.g., '.id = ""'), or even a macro entry (like PCMCIA_DEVICE_NULL).
    
    Without a sentinel, device-matching code may read out of bounds.
    
    I've found a number of such bugs in driver reviews, and we even
    occasionally commit one to the tree.  See commit 5751eee ("i2c:
    nomadik: Add missing sentinel to match table") for example.
    
    Teach checkpatch to find these ID tables, and complain if it looks like
    there wasn't a sentinel value.
    
    Test output:
    
      $ git format-patch -1 a0d15cc --stdout | scripts/checkpatch.pl -
      ERROR: missing sentinel in ID array
      deepin-community#57: FILE: drivers/i2c/busses/i2c-nomadik.c:1073:
      +static const struct of_device_id nmk_i2c_eyeq_match_table[] = {
       	{
       		.compatible = "XXXXXXXXXXXXXXXXXX",
       		.data = (void *)(NMK_I2C_EYEQ_FLAG_32B_BUS | NMK_I2C_EYEQ_FLAG_IS_EYEQ5),
       	},
       };
    
      total: 1 errors, 0 warnings, 66 lines checked
    
      NOTE: For some of the reported defects, checkpatch may be able to
            mechanically convert to the typical style using --fix or --fix-inplace.
    
      "[PATCH] i2c: nomadik: switch from of_device_is_compatible() to" has style problems, please review.
    
      NOTE: If any of the errors are false positives, please report
            them to the maintainer, see CHECKPATCH in MAINTAINERS.
    
    When run across the entire tree (scripts/checkpatch.pl -q --types
    MISSING_SENTINEL -f ...), false positives exist:
    
    * where macros are used that hide the table from analysis
      (e.g., drivers/gpu/drm/radeon/radeon_drv.c / radeon_PCI_IDS).
      There are fewer than 5 of these.
    
    * where such tables are processed correctly via ARRAY_SIZE() (fewer than
      5 instances). This is by far not the typical usage of *_device_id
      arrays.
    
    * some odd parsing artifacts, where ctx_statement_block() seems to quit
      in the middle of a block due to #if/#else/#endif.
    
    Also, not every "struct *_device_id" is in fact a sentinel-requiring
    structure, but even with such types, false positives are very rare.
    
    Link: https://lkml.kernel.org/r/20250702235245.1007351-1-briannorris@chromium.org
    Signed-off-by: Brian Norris <briannorris@chromium.org>
    Acked-by: Joe Perches <joe@perches.com>
    Cc: Andy Whitcroft <apw@canonical.com>
    Cc: Brian Norris <briannorris@chromium.org>
    Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>
    Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: WangYuli <wangyl5933@chinaunicom.cn>
    [Upstream commit a6cf527]
    
    Dave Gilbert noticed that checkpatch warns about URL links over 75 chars
    in length in commit logs.
    
    Fix that.
    
    Link: https://lkml.kernel.org/r/3529faaf84a5a9a96c5c0ec4183ae0ba6e97673c.camel@perches.com
    Signed-off-by: Joe Perches <joe@perches.com>
    Cc: Dave Gilbert <linux@treblig.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: WangYuli <wangyl5933@chinaunicom.cn>
    [Upstream commit 99b70ec]
    
    The checkpatch.pl script currently warns against the use of strcpy,
    strlcpy, and strncpy, recommending strscpy as a safer alternative.
    However, these warnings are also triggered for code under tools/ and
    scripts/, which are userspace utilities where strscpy is not available.
    This patch suppresses these warnings for files in tools/ and scripts/.
    
    Link: https://lkml.kernel.org/r/20250923171722.7798-1-suchitkarunakaran@gmail.com
    Signed-off-by: Suchit Karunakaran <suchitkarunakaran@gmail.com>
    Acked-by: Joe Perches <joe@perches.com>
    Cc: Andy Whitcroft <apw@canonical.com>
    Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>
    Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
    Cc: Shuah Khan <shuah@kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: WangYuli <wangyl5933@chinaunicom.cn>
    [Upstream commit fc387a0]
    
    Add a new check PLACEHOLDER_USE to detect unhandled placeholders.  This
    prevents sending patch series with incomplete patches (mostly in cover
    letters) containing auto generated subject or blurb lines.
    
    These placeholders can be seen on mailing lists.  With this change,
    checkpatch will emit an error when such text is found.
    
    Link: https://lkml.kernel.org/r/20250917173725.22547-2-work@onurozkan.dev
    Signed-off-by: Onur Özkan <work@onurozkan.dev>
    Acked-by: Joe Perches <joe@perches.com>
    Cc: Andy Whitcroft <apw@canonical.com>
    Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: WangYuli <wangyl5933@chinaunicom.cn>
    [Upstream commit 464c7ea]
    
    As of commit 85656ec, the IDR interface is marked as deprecated in
    the documentation, but no checks are made in that regard for new code.
    Add the existing IDR initialization APIs to the deprecated list in
    checkpatch, so that if new code is introduced using these APIs, a warning
    is emitted.
    
    Link: https://lkml.kernel.org/r/20251031111908.2266077-2-clopez@suse.de
    Signed-off-by: Carlos López <clopez@suse.de>
    Suggested-by: Dan Williams <dan.j.williams@intel.com>
    Acked-by: Dan Williams <dan.j.williams@intel.com>
    Acked-by: Joe Perches <joe@perches.com>
    Cc: Andy Whitcroft <apw@canonical.com>
    Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>
    Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
    Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: WangYuli <wangyl5933@chinaunicom.cn>
    [Upstream commit 01da521]
    
    Uinitialized pointers with __free attribute can cause undefined behavior
    as the memory randomly assigned to the pointer is freed automatically when
    the pointer goes out of scope.  add check in checkpatch to detect such
    issues.
    
    Link: https://lkml.kernel.org/r/20251203-aheev-checkpatch-uninitialized-free-v7-1-841e3b31d8f3@gmail.com
    Signed-off-by: Ally Heev <allyheev@gmail.com>
    Suggested-by: Dan Carpenter <dan.carpenter@linaro.org>
    Link: https://lore.kernel.org/all/8a4c0b43-cf63-400d-b33d-d9c447b7e0b9@suswa.mountain/
    Link: https://lore.kernel.org/all/58fd478f408a34b578ee8d949c5c4b4da4d4f41d.camel@HansenPartnership.com/
    Acked-by: Dan Williams <dan.j.williams@intel.com>
    Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
    Acked-by: Joe Perches <joe@perches.com>
    Cc: Andy Whitcroft <apw@canonical.com>
    Cc: David Hunter <david.hunter.linux@gmail.com>
    Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>
    Cc: Geert Uytterhoeven <geert@linux-m68k.org>
    Cc: James Bottomley <james.bottomley@HansenPartnership.com>
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
    Cc: Menon, Nishanth <nm@ti.com>
    Cc: Stephen Boyd <sboyd@kernel.org>
    Cc: Viresh Kumar <vireshk@kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: WangYuli <wangyl5933@chinaunicom.cn>
    [Upstream commit 25d3b21]
    
    Warn about applications of context_unsafe() without a comment, to
    encourage documenting the reasoning behind why it was deemed safe.
    
    Signed-off-by: Marco Elver <elver@google.com>
    Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Link: https://patch.msgid.link/20251219154418.3592607-6-elver@google.com
    Signed-off-by: WangYuli <wangyl5933@chinaunicom.cn>
    [Upstream commit 070580b]
    
    To support shifting away from sized allocation towards typed
    allocations, suggest the kmalloc_obj family of macros when a sizeof() is
    present in the argument lists.
    
    Link: https://patch.msgid.link/20251203233036.3212363-2-kees@kernel.org
    Signed-off-by: Kees Cook <kees@kernel.org>
    Signed-off-by: WangYuli <wangyl5933@chinaunicom.cn>
    [Upstream commit 74bc5f6]
    
    Currently, cacheline group macros trigger checkpatch warnings.
    For example:
    
      $ ./scripts/checkpatch.pl -g ba7e025a6c84aed012421468d83639e5dae982b0
      WARNING: Missing a blank line after declarations
      deepin-community#58: FILE: drivers/gpio/gpio-virtio.c:32:
      +	struct virtio_gpio_response res;
      +	__dma_from_device_group_end();
    
      $ ./scripts/checkpatch.pl -g 5d4cc87
      WARNING: Missing a blank line after declarations
      deepin-community#267: FILE: include/net/sock.h:431:
      +	int			sk_rcvlowat;
      +	__cacheline_group_end(sock_read_rx);
    
    But these are not actually statements - the following macros
    all expand to zero-length fields:
      __cacheline_group_begin()
      __cacheline_group_end()
      __cacheline_group_begin_aligned()
      __cacheline_group_end_aligned()
      __dma_from_device_group_begin()
      __dma_from_device_group_end()
    
    Add them to $declaration_macros so checkpatch recognizes this fact.
    
    Message-ID: <b345bb7e2d4e23672e3e5d1b283754dc11c7d8cd.1767647872.git.mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: WangYuli <wangyl5933@chinaunicom.cn>
    [Upstream commit 931d5c3]
    
    Some versions of tools that apply patches incorrectly allow lines that
    start with 3 dashes and have additional content on the same line.
    
    Checkpatch will now emit an ERROR on these lines and optionally convert
    those lines from dashes to equals with --fix.
    
    Link: https://lkml.kernel.org/r/6ec1ed08328340db42655287afd5fa4067316b11.camel@perches.com
    Signed-off-by: Joe Perches <joe@perches.com>
    Suggested-by: Ian Rogers <irogers@google.com>
    Cc: Andy Whitcroft <apw@canonical.com>
    Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>
    Cc: Kuan-Wei Chiu <visitorckw@gmail.com>
    Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
    Cc: Namhyung kim <namhyung@kernel.org>
    Cc: Stehen Rothwell <sfr@canb.auug.org.au>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: WangYuli <wangyl5933@chinaunicom.cn>
    robherring and others added 3 commits April 24, 2026 21:10
    [Upstream commit a45ff9dd3fec5d604f99b2665c40db26ce81ec0c]
    
    Patches which both remove and add/modify DT binding files are
    incorrectly flagged as needing to split the patch. The issue is the
    check sees "dev/null" as one of the files in the patch which is not a DT
    binding file. Add "dev/null" to the skipped files.
    
    Link: https://patch.msgid.link/20260121212715.144495-1-robh@kernel.org
    Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
    Signed-off-by: WangYuli <wangyl5933@chinaunicom.cn>
    [Upstream commit 20d00cf]
    
    Improve CamelCase recognition logic to avoid reporting on
     _Generic() use.
    
    Other C keywords, such as _Bool, are intentionally omitted, as those
    should be rather avoided in new source code.
    
    Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Signed-off-by: Mateusz Polchlopek <mateusz.polchlopek@intel.com>
    Acked-by: Joe Perches <joe@perches.com>
    Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
    Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
    Signed-off-by: WangYuli <wangyl5933@chinaunicom.cn>
    [Upstream commit 6356f18]
    
    The guidelines for git commit ID abbreviation are inconsistent: some
    places state to use 12 characters exactly, while other places recommend
    12 characters or more.  The same issue is present in the checkpatch.pl
    script.
    
    E.g. Documentation/dev-tools/checkpatch.rst says:
    
      **GIT_COMMIT_ID**
        The proper way to reference a commit id is:
        commit <12+ chars of sha1> ("<title line>")
    
    However, scripts/checkpatch.pl has two different checks: one warning
    check accepting 12 characters exactly:
    
        # Check Fixes: styles is correct
        Please use correct Fixes: style 'Fixes: <12 chars of sha1> (\"<title line>\")'
    
    and a second error check accepting 12-40 characters:
    
        # Check for git id commit length and improperly formed commit descriptions
        # A correctly formed commit description is:
        #    commit <SHA-1 hash length 12+ chars> ("Complete commit subject")
        Please use git commit description style 'commit <12+ chars of sha1>
    
    Hence patches containing commit IDs with more than 12 characters are
    flagged by checkpatch, and sometimes rejected by maintainers or
    reviewers.  This is becoming more important with the growth of the
    repository, as git may decide to use more characters in case of local
    conflicts.
    
    Fix this by settling on at least 12 characters, in both the
    documentation and in the checkpatch.pl script.
    
    Fixes: bd17e03 ("checkpatch: warn for non-standard fixes tag style")
    Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
    Link: https://lore.kernel.org/r/1c244040bf6ce304656e31036e5178b4b9dfb719.1733421037.git.geert+renesas@glider.be
    Signed-off-by: Jonathan Corbet <corbet@lwn.net>
    Signed-off-by: WangYuli <wangyl5933@chinaunicom.cn>
    @Avenger-285714 Avenger-285714 marked this pull request as ready for review April 25, 2026 02:25
    @Avenger-285714 Avenger-285714 changed the title [Deepin-Kernel-SIG] [linux 6.6.y] [Upstream] docs: add AI Coding Assistants documentation [Deepin-Kernel-SIG] [linux 6.6.y] [Upstream] Upstream backport: checkpatch enhancements, README restructuring, and AI coding assistant docs Apr 25, 2026
    Copy link
    Copy Markdown

    @sourcery-ai sourcery-ai Bot left a comment

    Choose a reason for hiding this comment

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

    Hey - I've found 4 issues, and left some high level feedback:

    • In the new ALLOC_WITH_SIZEOF and ALLOC_WITH_MULTIPLE checks, the capture groups from the regex are used incorrectly (e.g., $oldfunc = $3; my $a1 = $4; when the regex only defines $1..$3), which will result in wrong or undefined values at runtime; please realign the variable assignments with the actual capture indices (function name is $2, first argument $3, etc.).
    • The $dev_id_types regex only matches IDs starting with a lowercase ASCII letter ([a-z]), which may miss valid *_device_id types that start with an uppercase letter or underscore in future or out-of-tree code; consider relaxing this to \w or similar if you want the check to be more robust.
    Prompt for AI Agents
    Please address the comments from this code review:
    
    ## Overall Comments
    - In the new ALLOC_WITH_SIZEOF and ALLOC_WITH_MULTIPLE checks, the capture groups from the regex are used incorrectly (e.g., `$oldfunc = $3; my $a1 = $4;` when the regex only defines `$1..$3`), which will result in wrong or undefined values at runtime; please realign the variable assignments with the actual capture indices (function name is `$2`, first argument `$3`, etc.).
    - The `$dev_id_types` regex only matches IDs starting with a lowercase ASCII letter (`[a-z]`), which may miss valid `*_device_id` types that start with an uppercase letter or underscore in future or out-of-tree code; consider relaxing this to `\w` or similar if you want the check to be more robust.
    
    ## Individual Comments
    
    ### Comment 1
    <location path="scripts/checkpatch.pl" line_range="3102-3104" />
    <code_context>
     		}
    
    +# Check for invalid patch separator
    +		if ($in_commit_log &&
    +		    $line =~ /^---.+/) {
    +			if (ERROR("BAD_COMMIT_SEPARATOR",
    +				  "Invalid commit separator - some tools may have problems applying this\n" . $herecurr) &&
    +			    $fix) {
    </code_context>
    <issue_to_address>
    **issue (bug_risk):** Auto-fix for BAD_COMMIT_SEPARATOR is overly aggressive
    
    The fix uses `$fixed[$fixlinenr] =~ s/-/=/g;`, which replaces every dash on the line, not just the `---` separator. This risks altering commit message content on the same line. Please scope the substitution to the leading separator only (e.g. `s/^---/===/` or another prefix-limited pattern).
    </issue_to_address>
    
    ### Comment 2
    <location path="Documentation/dev-tools/checkpatch.rst" line_range="523" />
    <code_context>
    +    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
    </code_context>
    <issue_to_address>
    **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".
    
    ```suggestion
        PHY modes "rgmii", "rgmii-rxid" and "rgmii-txid" require the clock
    ```
    </issue_to_address>
    
    ### Comment 3
    <location path="Documentation/dev-tools/checkpatch.rst" line_range="633-634" />
    <code_context>
    
    +  **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
    +    may confuse tools that apply patches.
    
    </code_context>
    <issue_to_address>
    **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 regex matches '^---$'.
    
    ```
    
    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.
    </issue_to_address>
    
    ### Comment 4
    <location path="Documentation/dev-tools/checkpatch.rst" line_range="1023-1024" />
    <code_context>
           return bar;
    
    +  **UNINITIALIZED_PTR_WITH_FREE**
    +    Pointers with __free attribute should be declared at the place of use
    +    and initialized (see include/linux/cleanup.h). In this case
    +    declarations at the top of the function rule can be relaxed. Not doing
    </code_context>
    <issue_to_address>
    **issue (typo):** Missing article before "__free attribute"
    
    For correct grammar, use: "Pointers with the __free attribute should be declared at the place of use..."
    
    ```suggestion
      **UNINITIALIZED_PTR_WITH_FREE**
        Pointers with the __free attribute should be declared at the place of use
    ```
    </issue_to_address>

    Sourcery is free for open source - if you like our reviews please consider sharing them ✨
    Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

    Comment thread scripts/checkpatch.pl
    Comment on lines +3102 to +3104
    if ($in_commit_log &&
    $line =~ /^---.+/) {
    if (ERROR("BAD_COMMIT_SEPARATOR",
    Copy link
    Copy Markdown

    Choose a reason for hiding this comment

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

    issue (bug_risk): Auto-fix for BAD_COMMIT_SEPARATOR is overly aggressive

    The fix uses $fixed[$fixlinenr] =~ s/-/=/g;, which replaces every dash on the line, not just the --- separator. This risks altering commit message content on the same line. Please scope the substitution to the leading separator only (e.g. s/^---/===/ or another prefix-limited pattern).

    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
    Copy link
    Copy Markdown

    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".

    Suggested change
    PHY modes "rgmii", "rgmii-rxid" and "rgmii-txid" modes require the clock
    PHY modes "rgmii", "rgmii-rxid" and "rgmii-txid" require the clock

    Comment on lines +633 to +634
    The regex match is '^---$'
    Lines that start with 3 dashes and have more content on the same line
    Copy link
    Copy Markdown

    Choose a reason for hiding this comment

    The 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 regex matches '^---$'.
    
    

    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.

    Comment on lines +1023 to +1024
    **UNINITIALIZED_PTR_WITH_FREE**
    Pointers with __free attribute should be declared at the place of use
    Copy link
    Copy Markdown

    Choose a reason for hiding this comment

    The 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
    **UNINITIALIZED_PTR_WITH_FREE**
    Pointers with __free attribute should be declared at the place of use
    **UNINITIALIZED_PTR_WITH_FREE**
    Pointers with the __free attribute should be declared at the place of use

    Comment thread scripts/checkpatch.pl
    my $newfunc = "kmalloc_objs";
    $newfunc = "kvmalloc_objs" if ($oldfunc eq "kvmalloc");
    $newfunc = "kvzalloc_objs" if ($oldfunc eq "kvzalloc");
    $newfunc = "kzalloc_objs" if ($oldfunc eq "kzalloc");
    Copy link
    Copy Markdown
    Member

    Choose a reason for hiding this comment

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

    kzalloc_objs这些不在这个分支里面吧?

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Labels

    None yet

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.