From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Cc: Upadhyay <tejas.upadhyay@intel.com>,
igt-dev@lists.freedesktop.org,
Badal Nilawar <badal.nilawar@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t v5 3/4] tests/xe/xe_guc_pc: Change the sysfs paths
Date: Wed, 05 Jul 2023 17:12:05 -0700 [thread overview]
Message-ID: <87sfa1dhka.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20230705085259.533791-4-himal.prasad.ghimiray@intel.com>
On Wed, 05 Jul 2023 01:52:58 -0700, Himal Prasad Ghimiray wrote:
>
> diff --git a/tests/xe/xe_guc_pc.c b/tests/xe/xe_guc_pc.c
> index 827693eb4..046791d51 100644
> --- a/tests/xe/xe_guc_pc.c
> +++ b/tests/xe/xe_guc_pc.c
> @@ -137,8 +137,13 @@ static int set_freq(int sysfs, int gt_id, const char *freq_name, uint32_t freq)
> {
> int ret = -EAGAIN;
> char path[32];
> + char *gt_path;
> +
> + gt_path = xe_gt_sysfs_path(sysfs, gt_id);
> + igt_assert(snprintf(path, sizeof(path), "%s/freq_%s",
> + xe_gt_sysfs_path(sysfs, gt_id), freq_name) < sizeof(path));
No need to do this, delete path[], gt_path can directly be passed igt_sysfs_printf/scanf?
> + free(gt_path);
>
> - sprintf(path, "device/gt%d/freq_%s", gt_id, freq_name);
> while (ret == -EAGAIN)
> ret = igt_sysfs_printf(sysfs, path, "%u", freq);
> return ret;
> @@ -149,7 +154,12 @@ static uint32_t get_freq(int sysfs, int gt_id, const char *freq_name)
> uint32_t freq;
> int err = -EAGAIN;
> char path[32];
> - sprintf(path, "device/gt%d/freq_%s", gt_id, freq_name);
> + char *gt_path;
> +
> + gt_path = xe_gt_sysfs_path(sysfs, gt_id);
> + igt_assert(snprintf(path, sizeof(path), "%s/freq_%s",
> + gt_path, freq_name) < sizeof(path));
> + free(gt_path);
> while (err == -EAGAIN)
> err = igt_sysfs_scanf(sysfs, path, "%u", &freq);
> return freq;
> --
> 2.25.1
>
next prev parent reply other threads:[~2023-07-06 0:22 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-05 8:52 [igt-dev] [PATCH i-g-t v5 0/4] Handle GT and tile seperation in IGT Himal Prasad Ghimiray
2023-07-05 8:52 ` [igt-dev] [PATCH i-g-t v5 1/4] lib/igt_sysfs: Add support to query number of tiles Himal Prasad Ghimiray
2023-07-05 8:52 ` [igt-dev] [PATCH i-g-t v5 2/4] lib/igt_sysfs: Handling gt related sysfs uapi changes Himal Prasad Ghimiray
2023-07-05 8:52 ` [igt-dev] [PATCH i-g-t v5 3/4] tests/xe/xe_guc_pc: Change the sysfs paths Himal Prasad Ghimiray
2023-07-06 0:12 ` Dixit, Ashutosh [this message]
2023-07-06 3:20 ` Ghimiray, Himal Prasad
2023-07-06 3:52 ` Dixit, Ashutosh
2023-07-06 4:10 ` Ghimiray, Himal Prasad
2023-07-05 8:52 ` [igt-dev] [PATCH i-g-t v5 4/4] tests/xe/xe_sysfs_tile_prop: adds new test to verify per tile vram addr_range Himal Prasad Ghimiray
2023-07-05 9:14 ` [igt-dev] [PATCH i-g-t v5 0/4] Handle GT and tile seperation in IGT Kumar, Janga Rahul
2023-07-05 9:18 ` Ghimiray, Himal Prasad
2023-07-06 16:26 ` Kumar, Janga Rahul
2023-07-05 10:18 ` [igt-dev] ✓ Fi.CI.BAT: success for Handle GT and tile seperation in IGT (rev4) Patchwork
2023-07-05 12:05 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sfa1dhka.wl-ashutosh.dixit@intel.com \
--to=ashutosh.dixit@intel.com \
--cc=badal.nilawar@intel.com \
--cc=himal.prasad.ghimiray@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=tejas.upadhyay@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.