[igt-dev] [PATCH i-g-t] lib/igt_sysfs: Drop igt_debug_on from igt_sysfs_gt_open

Umesh Nerlige Ramappa umesh.nerlige.ramappa at intel.com
Mon Aug 15 17:05:53 UTC 2022


On Thu, Aug 11, 2022 at 05:50:39PM -0700, Ashutosh Dixit wrote:
>igt_sysfs_gt_open() is called from for_each_sysfs_gt_dirfd() which counts
>to 1 greater than the actual number of gt's where igt_sysfs_gt_open() fails
>and the loop exits. This means that the final failure is an expected
>condition which happens during normal course of operation.
>
>Therefore drop igt_debug_on() from igt_sysfs_gt_open() since the debug
>print is a false positive which makes it appear that something has gone
>wrong when it hasn't.
>
>Cc: Umesh Nerlige Ramappa <umesh.nerlige.ramappa at intel.com>
>Cc: Kamil Konieczny <kamil.konieczny at linux.intel.com>
>Signed-off-by: Ashutosh Dixit <ashutosh.dixit at intel.com>
>---
> lib/igt_sysfs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c
>index 40c9a2e36a90..9c3076947b35 100644
>--- a/lib/igt_sysfs.c
>+++ b/lib/igt_sysfs.c
>@@ -258,7 +258,7 @@ int igt_sysfs_gt_open(int device, int gt)
> {
> 	char path[96];
>
>-	if (igt_debug_on(!igt_sysfs_gt_path(device, gt, path, sizeof(path))))
>+	if (!igt_sysfs_gt_path(device, gt, path, sizeof(path)))
> 		return -1;

Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa at intel.com>

Regards,
Umesh
>
> 	return open(path, O_RDONLY);
>-- 
>2.34.1
>


More information about the igt-dev mailing list