From: "Nícolas F. R. A. Prado" <nfraprado@collabora.com>
To: Rob Herring <robh+dt@kernel.org>,
Frank Rowand <frowand.list@gmail.com>,
Shuah Khan <shuah@kernel.org>
Cc: "Mark Brown" <broonie@kernel.org>,
kernelci@lists.linux.dev, "Guenter Roeck" <groeck@chromium.org>,
kernel@collabora.com, "Bjorn Andersson" <andersson@kernel.org>,
"Nícolas F. R. A. Prado" <nfraprado@collabora.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 1/3] dt: dt-extract-compatibles: Handle cfile arguments in generator function
Date: Thu, 17 Aug 2023 19:35:25 -0400 [thread overview]
Message-ID: <20230817233635.2306377-2-nfraprado@collabora.com> (raw)
In-Reply-To: <20230817233635.2306377-1-nfraprado@collabora.com>
Move the handling of the cfile arguments to a separate generator
function to avoid redundancy.
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
---
Changes in v2:
- Added this commit
| 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
--git a/scripts/dtc/dt-extract-compatibles b/scripts/dtc/dt-extract-compatibles
index 9df9f1face83..2b6d228602e8 100755
--- a/scripts/dtc/dt-extract-compatibles
+++ b/scripts/dtc/dt-extract-compatibles
@@ -49,6 +49,14 @@ def print_compat(filename, compatibles):
else:
print(*compatibles, sep='\n')
+def files_to_parse(path_args):
+ for f in path_args:
+ if os.path.isdir(f):
+ for filename in glob.iglob(f + "/**/*.c", recursive=True):
+ yield filename
+ else:
+ yield f
+
show_filename = False
if __name__ == "__main__":
@@ -59,11 +67,6 @@ if __name__ == "__main__":
show_filename = args.with_filename
- for f in args.cfile:
- if os.path.isdir(f):
- for filename in glob.iglob(f + "/**/*.c", recursive=True):
- compat_list = parse_compatibles(filename)
- print_compat(filename, compat_list)
- else:
- compat_list = parse_compatibles(f)
- print_compat(f, compat_list)
+ for f in files_to_parse(args.cfile):
+ compat_list = parse_compatibles(f)
+ print_compat(f, compat_list)
--
2.41.0
next prev parent reply other threads:[~2023-08-17 23:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-17 23:35 [PATCH v2 0/3] Add a test to catch unprobed Devicetree devices Nícolas F. R. A. Prado
2023-08-17 23:35 ` Nícolas F. R. A. Prado [this message]
2023-08-17 23:35 ` [PATCH v2 2/3] dt: dt-extract-compatibles: Add flag for driver matching compatibles Nícolas F. R. A. Prado
2023-08-17 23:35 ` [PATCH v2 3/3] kselftest: Add new test for detecting unprobed Devicetree devices Nícolas F. R. A. Prado
2023-08-18 12:54 ` Mark Brown
2023-08-18 15:08 ` Nícolas F. R. A. Prado
2023-08-18 16:11 ` Shuah Khan
2023-08-18 15:05 ` Rob Herring
2023-08-18 16:38 ` Nícolas F. R. A. Prado
2023-08-28 16:37 ` Rob Herring
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=20230817233635.2306377-2-nfraprado@collabora.com \
--to=nfraprado@collabora.com \
--cc=andersson@kernel.org \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=groeck@chromium.org \
--cc=kernel@collabora.com \
--cc=kernelci@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=shuah@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®