All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wen Yang <wen.yang@linux.dev>
To: Masahiro Yamada <masahiroy@kernel.org>,
	ndrew Morton <akpm@linux-foundation.org>
Cc: Nicolas Schier <nicolas@fjasle.eu>,
	Miguel Ojeda <ojeda@kernel.org>,
	linux-kernel@vger.kernel.org, Wen Yang <wen.yang@linux.dev>
Subject: [PATCH] scripts: headers_install: fix a false positive
Date: Wed, 14 May 2025 00:00:56 +0800	[thread overview]
Message-ID: <20250513160056.7576-1-wen.yang@linux.dev> (raw)

The current implementation only handles C89 style comments (/*... */) in
the code, and there are false positives for C99 style comments (//...).

This patch fixes this issue.

Signed-off-by: Wen Yang <wen.yang@linux.dev>
---
 scripts/headers_install.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/headers_install.sh b/scripts/headers_install.sh
index 6bbccb43f7e7..41722bcc8668 100755
--- a/scripts/headers_install.sh
+++ b/scripts/headers_install.sh
@@ -44,6 +44,7 @@ scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__ $TMPFILE > $OUTFILE
 # Remove /* ... */ style comments, and find CONFIG_ references in code
 configs=$(sed -e '
 :comment
+	s://.*::
 	s:/\*[^*][^*]*:/*:
 	s:/\*\*\**\([^/]\):/*\1:
 	t comment
-- 
2.25.1


             reply	other threads:[~2025-05-13 16:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-13 16:00 Wen Yang [this message]
2025-05-15 11:32 ` [PATCH] scripts: headers_install: fix a false positive Nicolas Schier
2025-05-16 15:45   ` Wen Yang
2025-06-30 13:11     ` Masahiro Yamada

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=20250513160056.7576-1-wen.yang@linux.dev \
    --to=wen.yang@linux.dev \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=nicolas@fjasle.eu \
    --cc=ojeda@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.