[igt-dev] [PATCH i-g-t] lib/igt_sysfs: Add helpers to iterate over GTs

Dixit, Ashutosh ashutosh.dixit at intel.com
Wed Apr 27 15:56:49 UTC 2022


On Wed, 27 Apr 2022 04:38:54 -0700, Kamil Konieczny wrote:
>
> > +/**
> > + * igt_sysfs_gt_open:
> > + * @device: fd of the device
> > + * @gt: gt number
> > + *
> > + * This opens the sysfs gt directory corresponding to device and gt for use
> > + * with igt_sysfs_set() and igt_sysfs_get().
> > + *
> > + * Returns:
> > + * The directory fd, or -1 on failure.
> > + */
> > +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))))
> ----------- ^
> imho here we should not use igt_debug_on because we use this
> function in iterator macro for_each_sysfs_gt_dirfd and the end
> condition is hitting end of available GTs and returning -1.

Hi Kamil,

You are right, I removed other igt_debug_on's and merged it but missed this
one. Somebody will need to send a patch for this. Sorry about that.

Thanks.
--
Ashutosh


More information about the igt-dev mailing list