Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] lib/igt_device_scan: Skip attributes in subdirectories
@ 2024-07-04 16:44 Marcin Bernatowicz
  2024-07-04 18:51 ` ✓ CI.xeBAT: success for " Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Marcin Bernatowicz @ 2024-07-04 16:44 UTC (permalink / raw)
  To: igt-dev; +Cc: zbigniew.kempczynski, kamil.konieczny, michal.wajdeczko

Skip attributes in subdirectories as they are not used for filtering.
This change improves speed and reduces the impact of non-DRM related
component bugs on testing, such as ASPM issues.

Rename function is_on_blacklist to is_on_blocklist to promote more
inclusive language.

Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
---
 lib/igt_device_scan.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/lib/igt_device_scan.c b/lib/igt_device_scan.c
index 9a2da3d62..6473ca7ad 100644
--- a/lib/igt_device_scan.c
+++ b/lib/igt_device_scan.c
@@ -433,7 +433,7 @@ static enum dev_type __pci_devtype(uint16_t vendor, uint16_t device, const char
 /* Reading sysattr values can take time (even seconds),
  * we want to avoid reading such keys.
  */
-static bool is_on_blacklist(const char *what)
+static bool is_on_blocklist(const char *what)
 {
 	static const char *keys[] = { "config", "modalias", "modes",
 				      "resource",
@@ -442,16 +442,18 @@ static bool is_on_blacklist(const char *what)
 				      "resource0_wc", "resource1_wc", "resource2_wc",
 				      "resource3_wc", "resource4_wc", "resource5_wc",
 				      "uevent", NULL};
-	const char *key;
-	int i = 0;
+	const char **key;
 
 	if (what == NULL)
 		return false;
 
-	while ((key = keys[i++])) {
-		if (strcmp(key, what) == 0)
+	/* Skip attributes in subdirectories */
+	if (strchr(what, '/') != NULL)
+		return true;
+
+	for (key = keys; *key; key++)
+		if (strcmp(*key, what) == 0)
 			return true;
-	}
 
 	return false;
 
@@ -553,7 +555,7 @@ static void get_attrs(struct udev_device *dev, struct igt_device *idev)
 		const char *key = udev_list_entry_get_name(entry);
 		const char *value;
 
-		if (is_on_blacklist(key)) {
+		if (is_on_blocklist(key)) {
 			entry = udev_list_entry_get_next(entry);
 			continue;
 		}
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-07-08  6:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-04 16:44 [PATCH i-g-t] lib/igt_device_scan: Skip attributes in subdirectories Marcin Bernatowicz
2024-07-04 18:51 ` ✓ CI.xeBAT: success for " Patchwork
2024-07-04 19:01 ` ✓ Fi.CI.BAT: " Patchwork
2024-07-05  0:27 ` ✗ CI.xeFULL: failure " Patchwork
2024-07-05  9:38   ` Bernatowicz, Marcin
2024-07-05  7:59 ` ✗ Fi.CI.IGT: " Patchwork
2024-07-05 10:08   ` Bernatowicz, Marcin
2024-07-08  6:58 ` [PATCH i-g-t] " Zbigniew Kempczyński

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox