mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hemanth Selam <hemanth.selam@gmail.com>
To: Thierry Reding <thierry.reding@kernel.org>
Cc: Jonathan Hunter <jonathanh@nvidia.com>,
	linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] soc: fix typos in comments
Date: Mon, 26 Oct 2026 15:25:43 +0530	[thread overview]
Message-ID: <20261026095543.2729446-1-hemanth.selam@gmail.com> (raw)
In-Reply-To: <ar9qxmyIZEP2IlMp@orome>

On Fri, Oct 02, 2026 at 10:40:50AM +0200, Thierry Reding wrote:
> For some reason I can't seem to get checkpatch.pl report these spelling
> mistakes, so maybe that's part of the reason why these are not flagged
> before they get merged?

That is exactly it, and there are three separate reasons it stays quiet.

The spelling check only looks at the commit log and at lines beginning
with '+':

	if (defined($misspellings) &&
	    ($in_commit_log || $line =~ /^(?:\+|Subject:)/i)) {

so on a normal patch it reads what you are adding and nothing else.  A
typo already in the file is never examined, even when it is sitting in
the context lines of the very same hunk.  Nothing that is already in the
tree can be found this way, which is why none of these were caught when
the code went in.

Scanning a whole file needs -f, but in file mode the finding is demoted
from WARN to CHK, and CHK only prints under --strict.  So:

	$ scripts/checkpatch.pl -f drivers/mtd/ubi/wl.c
	(says nothing about it)

	$ scripts/checkpatch.pl -f --strict drivers/mtd/ubi/wl.c
	CHECK: 'occured' may be misspelled - perhaps 'occurred'?

That is probably the run you were missing.

The third reason is the word list.  scripts/spelling.txt has to contain
the misspelling or it does not exist as far as checkpatch is concerned,
and it is much smaller than people expect.  "inclue" in
drivers/nfc/fdp/i2c.c:270 is a plain typo that no invocation of
checkpatch will report, because the word is not in the file.
--codespell swaps in codespell's dictionary, which is where most of
these actually come from.

> Maybe a better use of LLM tokens would be to have it write a script
> that can be merged and that will automatically run a spellcheck on the
> tree.

Agreed, and codespell is the right engine for it rather than
spelling.txt.  The awkward part is the false positives: codespell on the
kernel produces a lot of them, mostly identifiers, hex, and abbreviations
in comments, so something mergeable needs a tuned ignore list more than
it needs a wrapper.  I will see how far I get and send it separately
rather than hold up anything here.

Thanks for picking the patch up.

Hemanth

      reply	other threads:[~2026-10-26  9:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-07  6:21 Hemanth Selam
2026-10-02  8:40 ` Thierry Reding
2026-10-26  9:55   ` Hemanth Selam [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261026095543.2729446-1-hemanth.selam@gmail.com \
    --to=hemanth.selam@gmail.com \
    --cc=jonathanh@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=thierry.reding@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®