From: Riana Tauro <riana.tauro@intel.com>
To: "Rodrigo Vivi" <rodrigo.vivi@intel.com>,
"Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: <igt-dev@lists.freedesktop.org>,
Bommithi Sakeena <bommithi.sakeena@intel.com>
Subject: Re: [PATCH i-g-t] tests/xe_pm_residency: Fix while loop in toggle_gt_c6
Date: Wed, 25 Sep 2024 14:47:39 +0530 [thread overview]
Message-ID: <01f37f21-b428-4943-9889-64ad36e793b4@intel.com> (raw)
In-Reply-To: <ZuyfcOSblAEBY9S3@intel.com>
On 9/20/2024 3:32 AM, Rodrigo Vivi wrote:
> On Thu, Sep 19, 2024 at 09:35:48PM +0300, Ville Syrjälä wrote:
>> On Thu, Sep 19, 2024 at 12:59:50PM -0400, Rodrigo Vivi wrote:
>>> From: Bommithi Sakeena <bommithi.sakeena@intel.com>
>>>
>>> Function toggle_gt_c6 has while loop iterating for (NUM_REPS +1)
>>> times. Correct it to iterate to NUM_REPS times.
>>>
>>> Signed-off-by: Bommithi Sakeena <bommithi.sakeena@intel.com>
>>> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
>>> ---
>>> tests/intel/xe_pm_residency.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/tests/intel/xe_pm_residency.c b/tests/intel/xe_pm_residency.c
>>> index 0e687558b..f4d05889c 100644
>>> --- a/tests/intel/xe_pm_residency.c
>>> +++ b/tests/intel/xe_pm_residency.c
>>> @@ -297,7 +297,7 @@ static void toggle_gt_c6(int fd, int n)
>>>
>>> if (n == NUM_REPS)
>>> measure_power(&gpu, >_c6_power);
>>> - } while (n--);
>>> + } while (--n);
>>
>> Why isn't that just a canonical for loop?
>
> I honestly asked me the same question when Sakeena showed me this.
> If it was in kernel I would had requested the for loop.
> but given while is used in more places in IGT I liked the small
> patch as possible here.
This can be converted into for loop. There was no specific reason to use
while.
Thank you for the fix. This patch however looks good to me
Reviewed-by: Riana Tauro <riana.tauro@intel.com>
>
>>
>>>
>>> igt_power_close(&gpu);
>>> igt_info("GPU consumed %fmW in GT C6 and %fmW in GT C0\n", gt_c6_power, gt_c0_power);
>>> --
>>> 2.46.0
>>
>> --
>> Ville Syrjälä
>> Intel
next prev parent reply other threads:[~2024-09-25 9:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-19 16:59 [PATCH i-g-t] tests/xe_pm_residency: Fix while loop in toggle_gt_c6 Rodrigo Vivi
2024-09-19 18:35 ` Ville Syrjälä
2024-09-19 22:02 ` Rodrigo Vivi
2024-09-25 9:17 ` Riana Tauro [this message]
2024-09-20 1:42 ` ✓ CI.xeBAT: success for " Patchwork
2024-09-20 1:54 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-09-20 6:12 ` ✗ CI.xeFULL: " 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=01f37f21-b428-4943-9889-64ad36e793b4@intel.com \
--to=riana.tauro@intel.com \
--cc=bommithi.sakeena@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=rodrigo.vivi@intel.com \
--cc=ville.syrjala@linux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox