[PATCH i-g-t] intel_reg: Stop warning if register spec is not there

Lucas De Marchi lucas.demarchi at intel.com
Wed Apr 10 23:17:10 UTC 2024


Stop suffering when using igt from the git checkout, which is the case
for all/most developers.

	$ sudo ./build/tools/intel_reg write 0x2358 0xdeadbeef
	Warning: stat '/usr/local/share/igt-gpu-tools/registers' failed: No such file or directory. Using builtin register spec.

Pretty annoying when you have a bunch of commands to run and don't want
to simply ignore stderr.  Keep the other warnings as if the file is
there and can't be read for some reason, it's good to give a warning.
However if the file simply isn't there, let it pass.

Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
---
 tools/intel_reg.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/tools/intel_reg.c b/tools/intel_reg.c
index 6c37e14d1..ec311a05a 100644
--- a/tools/intel_reg.c
+++ b/tools/intel_reg.c
@@ -1114,12 +1114,8 @@ static int read_reg_spec(struct config *config)
 		path = IGT_DATADIR"/registers";
 
 	r = stat(path, &st);
-	if (r) {
-		fprintf(stderr, "Warning: stat '%s' failed: %s. "
-			"Using builtin register spec.\n",
-			path, strerror(errno));
+	if (r)
 		goto builtin;
-	}
 
 	if (S_ISDIR(st.st_mode)) {
 		r = get_reg_spec_file(buf, sizeof(buf), path, config->devid);
-- 
2.43.0



More information about the igt-dev mailing list