mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-24 06:43:01 +00:00
igt.cocci: check the return values of various functions
Add rules to fix unused-result warnings when compiling with _FORTIFY_SOURCE defined and apply them to the library and tests. Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
This commit is contained in:
+2
-2
@@ -198,7 +198,7 @@ static bool fbc_enabled(data_t *data)
|
||||
status = igt_debugfs_fopen("i915_fbc_status", "r");
|
||||
igt_assert(status);
|
||||
|
||||
fread(str, sizeof(str) - 1, 1, status);
|
||||
igt_assert_eq(fread(str, sizeof(str) - 1, 1, status), 1);
|
||||
fclose(status);
|
||||
return strstr(str, "FBC enabled") != NULL;
|
||||
}
|
||||
@@ -510,7 +510,7 @@ igt_main
|
||||
|
||||
status = igt_debugfs_fopen("i915_fbc_status", "r");
|
||||
igt_require_f(status, "No i915_fbc_status found\n");
|
||||
fread(buf, sizeof(buf), 1, status);
|
||||
igt_assert_eq(fread(buf, sizeof(buf), 1, status), sizeof(buf));
|
||||
fclose(status);
|
||||
buf[sizeof(buf) - 1] = '\0';
|
||||
igt_require_f(!strstr(buf, "unsupported by this chipset") &&
|
||||
|
||||
Reference in New Issue
Block a user