From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id 41FDA10E4A7 for ; Fri, 24 Mar 2023 01:11:15 +0000 (UTC) From: Ashutosh Dixit To: igt-dev@lists.freedesktop.org Date: Thu, 23 Mar 2023 18:11:07 -0700 Message-Id: <20230324011107.3877669-1-ashutosh.dixit@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [igt-dev] [PATCH i-g-t] lib/igt_sysfs: Make i915_for_each_gt an alias for for_each_sysfs_gt_dirfd List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: i915_for_each_gt was the same as for_each_sysfs_gt_dirfd except that the last two arguments (gtid and dir) were switched with respect to for_each_sysfs_gt_dirfd. Make i915_for_each_gt an alias for_each_sysfs_gt_dirfd to resolve the order of these arguments so that we only have a single order of arguments to deal with. Fixes: cd9b68563e6 ("lib/igt_sysfs: Add i915_for_each_gt() macro") Signed-off-by: Ashutosh Dixit --- lib/igt_sysfs.h | 5 +---- tests/i915/i915_power.c | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/igt_sysfs.h b/lib/igt_sysfs.h index c0fcf6b5739..978b6906e23 100644 --- a/lib/igt_sysfs.h +++ b/lib/igt_sysfs.h @@ -38,10 +38,7 @@ (dirfd__ = igt_sysfs_gt_open(i915__, gt__)) != -1; \ close(dirfd__), gt__++) -#define i915_for_each_gt(i915, gtid, dir) \ - for ((gtid) = 0; \ - ((dir) = igt_sysfs_gt_open((i915), (gtid))) != -1; \ - close(dir), (gtid)++) +#define i915_for_each_gt for_each_sysfs_gt_dirfd #define igt_sysfs_rps_write(dir, id, data, len) \ igt_sysfs_write(dir, igt_sysfs_dir_id_to_name(dir, id), data, len) diff --git a/tests/i915/i915_power.c b/tests/i915/i915_power.c index b3757bbe322..333ea002b22 100644 --- a/tests/i915/i915_power.c +++ b/tests/i915/i915_power.c @@ -47,7 +47,7 @@ static void sanity(int i915) /* Wait till at least one spinner starts */ igt_spin_busywait_until_started(spin); busy = measure_power(&pwr, DURATION_SEC); - i915_for_each_gt(i915, gt, dir) { + i915_for_each_gt(i915, dir, gt) { req = igt_sysfs_get_u32(dir, "rps_cur_freq_mhz"); act = igt_sysfs_get_u32(dir, "rps_act_freq_mhz"); igt_info("gt %d: req MHz: %d, act MHz: %d\n", gt, req, act); -- 2.38.0