From: Conor Dooley <conor@kernel.org>
To: Rob Herring <robh@kernel.org>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Frank Rowand <frowand.list@gmail.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dt: dt-check-compatible: Find struct of_device_id instances with compiler annotations
Date: Sat, 5 Aug 2023 10:16:25 +0100 [thread overview]
Message-ID: <20230805-murmuring-primate-42e9d91957f3@spud> (raw)
In-Reply-To: <20230804190130.1936566-1-robh@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 1472 bytes --]
On Fri, Aug 04, 2023 at 01:01:29PM -0600, Rob Herring wrote:
> The regex search for declarations of struct of_device_id was missing
> cases that had a compiler annotation such as "__maybe_unused". Improve
> the regex to allow for these. Use '\S' instead of specific characters to
> shorten the regex. That also finds some more compatibles using '.'
> characters.
>
> Unfortunately, these changes add ~400 more compatibles without a
> schema.
>
> Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Thanks,
Conor.
> ---
> scripts/dtc/dt-extract-compatibles | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/dtc/dt-extract-compatibles b/scripts/dtc/dt-extract-compatibles
> index a1119762ed08..9df9f1face83 100755
> --- a/scripts/dtc/dt-extract-compatibles
> +++ b/scripts/dtc/dt-extract-compatibles
> @@ -25,8 +25,8 @@ def parse_of_declare_macros(data):
> def parse_of_device_id(data):
> """ Find all compatible strings in of_device_id structs """
> compat_list = []
> - for m in re.finditer(r'of_device_id\s+[a-zA-Z0-9_]+\[\]\s*=\s*({.*?);', data):
> - compat_list += re.findall(r'\.compatible\s+=\s+"([a-zA-Z0-9_\-,]+)"', m[1])
> + for m in re.finditer(r'of_device_id(\s+\S+)?\s+\S+\[\](\s+\S+)?\s*=\s*({.*?);', data):
> + compat_list += re.findall(r'\.compatible\s+=\s+"(\S+)"', m[3])
>
> return compat_list
>
> --
> 2.40.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
prev parent reply other threads:[~2023-08-05 9:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-04 19:01 [PATCH] dt: dt-check-compatible: Find struct of_device_id instances with compiler annotations Rob Herring
2023-08-05 9:16 ` Conor Dooley [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=20230805-murmuring-primate-42e9d91957f3@spud \
--to=conor@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@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