Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Senna Tschudin <peter.senna@linux.intel.com>
To: "Gurram, Pravalika" <pravalika.gurram@intel.com>,
	"igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>,
	"kamil.konieczny@linux.intel.com"
	<kamil.konieczny@linux.intel.com>
Subject: Re: [PATCH 1/2] lib/igt_facts: Make igt_facts_test noreturn
Date: Tue, 21 Jan 2025 10:30:09 +0100	[thread overview]
Message-ID: <b1c07be9-1122-4b87-aa1e-7b634a48518a@linux.intel.com> (raw)
In-Reply-To: <BL1PR11MB55257D034ACCBD6FF163A80584E62@BL1PR11MB5525.namprd11.prod.outlook.com>

Hi Pravalika,

Please see my answers below.

>>>
>>> diff --git a/lib/igt_facts.c b/lib/igt_facts.c index
>>> 2e04a7c86..bd6742065 100644
>>> --- a/lib/igt_facts.c
>>> +++ b/lib/igt_facts.c
>>> @@ -748,7 +748,7 @@ static void igt_facts_test_mark_and_sweep(struct
>> igt_list_head *head)
>>>   *
>>>   * Returns: bool indicating if the tests passed
>>>   */
>>> -void igt_facts_test(void)
>>> +__noreturn void igt_facts_test(void)
>>
>> How did you find this? Is the compiler complaining?
>>
> When am fixing the check patch errors I have seen below error 
> 
> ninja: Entering directory `build'
> [2/835] Compiling C object lib/libigt-igt_facts_c.a.p/igt_facts.c.o
> ../lib/igt_facts.c: In function ‘igt_facts_test’:
> ../lib/igt_facts.c:751:6: warning: function might be candidate for attribute ‘noreturn’ [-Wsuggest-attribute=noreturn]
>   751 | void igt_facts_test(void)
>       |      ^~~~~~~~~~~~~~
> [6/6] Generating docs/testplan/intel-ci-tests with a custom command

Is your tree clean? What command line are you using? Asking because I see no
warnings when I build with:

 rm -rf build/ && meson build && ninja -C build


> 
> Then have added changes.
>>>  {
>>>  	const char *last_test = "Unit Testing";
>>>
>>> @@ -776,4 +776,6 @@ void igt_facts_test(void)
>>>  	/* Clean up the list and call igt_facts(). This should not crash */
>>>  	igt_facts_list_mark_and_sweep(&igt_facts_list_pci_gpu_head);
>>>  	igt_facts(last_test);
>>> +
>>> +	igt_exit();
>>>  }
>> Why adding igt_exit() here?
>>
>> How did you test this patch?
>>
> If we don’t explicitly specify igt_exit() I will below warning 
> 
> ninja: Entering directory `build'
> [43/999] Compiling C object lib/libigt-igt_facts_c.a.p/igt_facts.c.o
> ../lib/igt_facts.c: In function ‘igt_facts_test’:
> ../lib/igt_facts.c:779:1: warning: ‘noreturn’ function does return
>   779 | }
>       | ^
> I have compiled since these check patch errors

Curious with your command line to see these warning here too.

Compiling only is not enough testing. Please run unit testing, and a few
calls to igt_runner with facts enabled, with large test lists such as xe
bat or i915 bat, and in a RIL DUT. Compare the facts before and after
your changes to make sure nothing breaks.


> 
>> Thanks,
>>
>> Peter


  reply	other threads:[~2025-01-21  9:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-21  6:32 [PATCH 0/2] Make igt_facts_test noreturn and cleanup Pravalika Gurram
2025-01-21  6:32 ` [PATCH 1/2] lib/igt_facts: Make igt_facts_test noreturn Pravalika Gurram
2025-01-21  8:21   ` Peter Senna Tschudin
2025-01-21  9:14     ` Gurram, Pravalika
2025-01-21  9:30       ` Peter Senna Tschudin [this message]
2025-01-21 14:02   ` Kamil Konieczny
2025-01-21  6:32 ` [PATCH 2/2] lib/igt_facts : Cleanup Pravalika Gurram
2025-01-21  8:32   ` Peter Senna Tschudin
2025-01-21 13:58     ` Kamil Konieczny
2025-01-21 13:52   ` Kamil Konieczny
2025-01-21 13:55   ` Kamil Konieczny
2025-01-21  9:18 ` ✗ GitLab.Pipeline: warning for Make igt_facts_test noreturn and cleanup Patchwork
2025-01-21  9:23 ` ✓ i915.CI.BAT: success " Patchwork
2025-01-21 10:48 ` ✓ Xe.CI.BAT: " Patchwork
2025-01-21 14:26 ` ✗ Xe.CI.Full: failure " Patchwork
2025-01-21 17:26 ` ✗ i915.CI.Full: " 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=b1c07be9-1122-4b87-aa1e-7b634a48518a@linux.intel.com \
    --to=peter.senna@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=kamil.konieczny@linux.intel.com \
    --cc=pravalika.gurram@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