2024-02-29 04:27:09

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: build failure after merge of the kunit-next tree

Hi all,

After merging the kunit-next tree, today's linux-next build (x86_64
allmodconfig) failed like this:

In file included from drivers/gpu/drm/tests/drm_buddy_test.c:7:
drivers/gpu/drm/tests/drm_buddy_test.c: In function 'drm_test_buddy_alloc_range_bias':
drivers/gpu/drm/tests/drm_buddy_test.c:191:40: error: format '%u' expects a matching 'unsigned int' argument [-Werror=format=]
191 | "buddy_alloc failed with bias(%x-%x), size=%u, ps=%u\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:597:37: note: in definition of macro '_KUNIT_FAILED'
597 | fmt, \
| ^~~
include/kunit/test.h:662:9: note: in expansion of macro 'KUNIT_UNARY_ASSERTION'
662 | KUNIT_UNARY_ASSERTION(test, \
| ^~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:1233:9: note: in expansion of macro 'KUNIT_FALSE_MSG_ASSERTION'
1233 | KUNIT_FALSE_MSG_ASSERTION(test, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/tests/drm_buddy_test.c:186:17: note: in expansion of macro 'KUNIT_ASSERT_FALSE_MSG'
186 | KUNIT_ASSERT_FALSE_MSG(test,
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/tests/drm_buddy_test.c:191:91: note: format string is defined here
191 | "buddy_alloc failed with bias(%x-%x), size=%u, ps=%u\n",
| ~^
| |
| unsigned int
cc1: all warnings being treated as errors

Caused by commit

806cb2270237 ("kunit: Annotate _MSG assertion variants with gnu printf specifiers")

interacting with commit

c70703320e55 ("drm/tests/drm_buddy: add alloc_range_bias test")

from the drm-misc-fixes tree.

I have applied the following patch for today (this should probably
actually be fixed in the drm-misc-fixes tree).

From: Stephen Rothwell <[email protected]>
Date: Thu, 29 Feb 2024 15:18:36 +1100
Subject: [PATCH] fix up for "drm/tests/drm_buddy: add alloc_range_bias test"

Signed-off-by: Stephen Rothwell <[email protected]>
---
drivers/gpu/drm/tests/drm_buddy_test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/tests/drm_buddy_test.c b/drivers/gpu/drm/tests/drm_buddy_test.c
index 1e73e3f0d278..369edf587b44 100644
--- a/drivers/gpu/drm/tests/drm_buddy_test.c
+++ b/drivers/gpu/drm/tests/drm_buddy_test.c
@@ -188,7 +188,7 @@ static void drm_test_buddy_alloc_range_bias(struct kunit *test)
bias_end, size, ps,
&allocated,
DRM_BUDDY_RANGE_ALLOCATION),
- "buddy_alloc failed with bias(%x-%x), size=%u, ps=%u\n",
+ "buddy_alloc failed with bias(%x-%x), size=%u\n",
bias_start, bias_end, size);
bias_rem -= size;

--
2.43.0

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2024-02-29 15:07:24

by Shuah Khan

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the kunit-next tree

Hi Stephen,

On 2/28/24 21:26, Stephen Rothwell wrote:
> Hi all,
>
> After merging the kunit-next tree, today's linux-next build (x86_64
> allmodconfig) failed like this:
>
> In file included from drivers/gpu/drm/tests/drm_buddy_test.c:7:
> drivers/gpu/drm/tests/drm_buddy_test.c: In function 'drm_test_buddy_alloc_range_bias':
> drivers/gpu/drm/tests/drm_buddy_test.c:191:40: error: format '%u' expects a matching 'unsigned int' argument [-Werror=format=]
> 191 | "buddy_alloc failed with bias(%x-%x), size=%u, ps=%u\n",
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> include/kunit/test.h:597:37: note: in definition of macro '_KUNIT_FAILED'
> 597 | fmt, \
> | ^~~
> include/kunit/test.h:662:9: note: in expansion of macro 'KUNIT_UNARY_ASSERTION'
> 662 | KUNIT_UNARY_ASSERTION(test, \
> | ^~~~~~~~~~~~~~~~~~~~~
> include/kunit/test.h:1233:9: note: in expansion of macro 'KUNIT_FALSE_MSG_ASSERTION'
> 1233 | KUNIT_FALSE_MSG_ASSERTION(test, \
> | ^~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/gpu/drm/tests/drm_buddy_test.c:186:17: note: in expansion of macro 'KUNIT_ASSERT_FALSE_MSG'
> 186 | KUNIT_ASSERT_FALSE_MSG(test,
> | ^~~~~~~~~~~~~~~~~~~~~~
> drivers/gpu/drm/tests/drm_buddy_test.c:191:91: note: format string is defined here
> 191 | "buddy_alloc failed with bias(%x-%x), size=%u, ps=%u\n",
> | ~^
> | |
> | unsigned int
> cc1: all warnings being treated as errors
>
> Caused by commit
>
> 806cb2270237 ("kunit: Annotate _MSG assertion variants with gnu printf specifiers")
>

Thank you. I did allmodconfig build on kselftest kunit branch to make
sure all is well, before I pushed the commits.

> interacting with commit
>
> c70703320e55 ("drm/tests/drm_buddy: add alloc_range_bias test")
>
> from the drm-misc-fixes tree.
>
> I have applied the following patch for today (this should probably
> actually be fixed in the drm-misc-fixes tree).
>

Danial, David,

I can carry the fix through kselftest kunit if it works
for all.

> From: Stephen Rothwell <[email protected]>
> Date: Thu, 29 Feb 2024 15:18:36 +1100
> Subject: [PATCH] fix up for "drm/tests/drm_buddy: add alloc_range_bias test"
>
> Signed-off-by: Stephen Rothwell <[email protected]>
> ---
> drivers/gpu/drm/tests/drm_buddy_test.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/tests/drm_buddy_test.c b/drivers/gpu/drm/tests/drm_buddy_test.c
> index 1e73e3f0d278..369edf587b44 100644
> --- a/drivers/gpu/drm/tests/drm_buddy_test.c
> +++ b/drivers/gpu/drm/tests/drm_buddy_test.c
> @@ -188,7 +188,7 @@ static void drm_test_buddy_alloc_range_bias(struct kunit *test)
> bias_end, size, ps,
> &allocated,
> DRM_BUDDY_RANGE_ALLOCATION),
> - "buddy_alloc failed with bias(%x-%x), size=%u, ps=%u\n",
> + "buddy_alloc failed with bias(%x-%x), size=%u\n",
> bias_start, bias_end, size);
> bias_rem -= size;
>

thanks,
-- Shuah

2024-03-01 07:21:13

by David Gow

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the kunit-next tree

On Thu, 29 Feb 2024 at 23:07, Shuah Khan <[email protected]> wrote:
>
> Hi Stephen,
>
> On 2/28/24 21:26, Stephen Rothwell wrote:
> > Hi all,
> >
> > After merging the kunit-next tree, today's linux-next build (x86_64
> > allmodconfig) failed like this:
> >
> > In file included from drivers/gpu/drm/tests/drm_buddy_test.c:7:
> > drivers/gpu/drm/tests/drm_buddy_test.c: In function 'drm_test_buddy_alloc_range_bias':
> > drivers/gpu/drm/tests/drm_buddy_test.c:191:40: error: format '%u' expects a matching 'unsigned int' argument [-Werror=format=]
> > 191 | "buddy_alloc failed with bias(%x-%x), size=%u, ps=%u\n",
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > include/kunit/test.h:597:37: note: in definition of macro '_KUNIT_FAILED'
> > 597 | fmt, \
> > | ^~~
> > include/kunit/test.h:662:9: note: in expansion of macro 'KUNIT_UNARY_ASSERTION'
> > 662 | KUNIT_UNARY_ASSERTION(test, \
> > | ^~~~~~~~~~~~~~~~~~~~~
> > include/kunit/test.h:1233:9: note: in expansion of macro 'KUNIT_FALSE_MSG_ASSERTION'
> > 1233 | KUNIT_FALSE_MSG_ASSERTION(test, \
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~
> > drivers/gpu/drm/tests/drm_buddy_test.c:186:17: note: in expansion of macro 'KUNIT_ASSERT_FALSE_MSG'
> > 186 | KUNIT_ASSERT_FALSE_MSG(test,
> > | ^~~~~~~~~~~~~~~~~~~~~~
> > drivers/gpu/drm/tests/drm_buddy_test.c:191:91: note: format string is defined here
> > 191 | "buddy_alloc failed with bias(%x-%x), size=%u, ps=%u\n",
> > | ~^
> > | |
> > | unsigned int
> > cc1: all warnings being treated as errors
> >
> > Caused by commit
> >
> > 806cb2270237 ("kunit: Annotate _MSG assertion variants with gnu printf specifiers")
> >
>
> Thank you. I did allmodconfig build on kselftest kunit branch to make
> sure all is well, before I pushed the commits.
>
> > interacting with commit
> >
> > c70703320e55 ("drm/tests/drm_buddy: add alloc_range_bias test")
> >
> > from the drm-misc-fixes tree.
> >
> > I have applied the following patch for today (this should probably
> > actually be fixed in the drm-misc-fixes tree).
> >
>
> Danial, David,
>
> I can carry the fix through kselftest kunit if it works
> for all.

I'm happy for this to go in with the KUnit changes if that's the best
way to keep all of the printk formatting fixes together.


-- David

>
> > From: Stephen Rothwell <[email protected]>
> > Date: Thu, 29 Feb 2024 15:18:36 +1100
> > Subject: [PATCH] fix up for "drm/tests/drm_buddy: add alloc_range_bias test"
> >
> > Signed-off-by: Stephen Rothwell <[email protected]>
> > ---
> > drivers/gpu/drm/tests/drm_buddy_test.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/tests/drm_buddy_test.c b/drivers/gpu/drm/tests/drm_buddy_test.c
> > index 1e73e3f0d278..369edf587b44 100644
> > --- a/drivers/gpu/drm/tests/drm_buddy_test.c
> > +++ b/drivers/gpu/drm/tests/drm_buddy_test.c
> > @@ -188,7 +188,7 @@ static void drm_test_buddy_alloc_range_bias(struct kunit *test)
> > bias_end, size, ps,
> > &allocated,
> > DRM_BUDDY_RANGE_ALLOCATION),
> > - "buddy_alloc failed with bias(%x-%x), size=%u, ps=%u\n",
> > + "buddy_alloc failed with bias(%x-%x), size=%u\n",
> > bias_start, bias_end, size);
> > bias_rem -= size;
> >
>
> thanks,
> -- Shuah


Attachments:
smime.p7s (3.92 kB)
S/MIME Cryptographic Signature

2024-03-01 10:45:59

by Stephen Rothwell

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the kunit-next tree

Hi all,

On Fri, 1 Mar 2024 15:15:02 +0800 David Gow <[email protected]> wrote:
>
> On Thu, 29 Feb 2024 at 23:07, Shuah Khan <[email protected]> wrote:
> >
> > I can carry the fix through kselftest kunit if it works
> > for all.
>
> I'm happy for this to go in with the KUnit changes if that's the best
> way to keep all of the printk formatting fixes together.

I am pretty sure that the proper fix has been applied to the drm-fixes
tree today (in the merge of the drm-misc-fixes tree).

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2024-03-01 16:07:49

by Shuah Khan

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the kunit-next tree

On 3/1/24 03:43, Stephen Rothwell wrote:
> Hi all,
>
> On Fri, 1 Mar 2024 15:15:02 +0800 David Gow <[email protected]> wrote:
>>
>> On Thu, 29 Feb 2024 at 23:07, Shuah Khan <[email protected]> wrote:
>>>
>>> I can carry the fix through kselftest kunit if it works
>>> for all.
>>
>> I'm happy for this to go in with the KUnit changes if that's the best
>> way to keep all of the printk formatting fixes together.
>
> I am pretty sure that the proper fix has been applied to the drm-fixes
> tree today (in the merge of the drm-misc-fixes tree).
>

What's the commit id for this fix? I Would like to include the details
in my pull request to Linus.

If this fix is going before the merge window - we are all set.

thanks,
-- Shuah

2024-03-01 20:47:01

by Stephen Rothwell

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the kunit-next tree

Hi Shuah,

On Fri, 1 Mar 2024 09:05:57 -0700 Shuah Khan <[email protected]> wrote:
>
> On 3/1/24 03:43, Stephen Rothwell wrote:
> > Hi all,
> >
> > On Fri, 1 Mar 2024 15:15:02 +0800 David Gow <[email protected]> wrote:
> >>
> >> On Thu, 29 Feb 2024 at 23:07, Shuah Khan <[email protected]> wrote:
> >>>
> >>> I can carry the fix through kselftest kunit if it works
> >>> for all.
> >>
> >> I'm happy for this to go in with the KUnit changes if that's the best
> >> way to keep all of the printk formatting fixes together.

Unfortunately you can't fix this in the kunit-next tree without pulling
in Linus' tree (or the drm-fixes tree) - which seems excessive.

> > I am pretty sure that the proper fix has been applied to the
> > drm-fixes tree today (in the merge of the drm-misc-fixes tree).
> >
>
> What's the commit id for this fix? I Would like to include the details
> in my pull request to Linus.

My mistake, I misread the merge commit. It has not been fixed in the
drm-misc-fixes tree or the drm-fixes tree (or Linus' tree since the
drm-fixes tree has been merged there) :-(

The problem in this case is not with the format string types, but with
a missing argument i.e. there is another argument required by the
format string. It really should be fixed in the drm-misc-fixes tree
and sent to Linus post haste.

At least the change in the kunit-next tree will stop this happening in
the future.

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2024-03-01 22:34:32

by Shuah Khan

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the kunit-next tree

Hi Stephen,

On 3/1/24 13:46, Stephen Rothwell wrote:
> Hi Shuah,
>
> On Fri, 1 Mar 2024 09:05:57 -0700 Shuah Khan <[email protected]> wrote:
>>
>> On 3/1/24 03:43, Stephen Rothwell wrote:
>>> Hi all,
>>>
>>> On Fri, 1 Mar 2024 15:15:02 +0800 David Gow <[email protected]> wrote:
>>>>
>>>> On Thu, 29 Feb 2024 at 23:07, Shuah Khan <[email protected]> wrote:
>>>>>
>>>>> I can carry the fix through kselftest kunit if it works
>>>>> for all.
>>>>
>>>> I'm happy for this to go in with the KUnit changes if that's the best
>>>> way to keep all of the printk formatting fixes together.
>
> Unfortunately you can't fix this in the kunit-next tree without pulling
> in Linus' tree (or the drm-fixes tree) - which seems excessive.
>
>>> I am pretty sure that the proper fix has been applied to the
>>> drm-fixes tree today (in the merge of the drm-misc-fixes tree).
>>>
>>
>> What's the commit id for this fix? I Would like to include the details
>> in my pull request to Linus.
>
> My mistake, I misread the merge commit. It has not been fixed in the
> drm-misc-fixes tree or the drm-fixes tree (or Linus' tree since the
> drm-fixes tree has been merged there) :-(
>
> The problem in this case is not with the format string types, but with
> a missing argument i.e. there is another argument required by the
> format string. It really should be fixed in the drm-misc-fixes tree
> and sent to Linus post haste.
>
> At least the change in the kunit-next tree will stop this happening in
> the future.
>

Thank you for looking into it.

David, please send a fix in as you suggested earlier. I will apply
it to avoid compile errors.

thanks,
-- Shuah

2024-03-06 15:26:03

by Shuah Khan

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the kunit-next tree

Hi Stephen,

On 3/1/24 15:30, Shuah Khan wrote:
> Hi Stephen,
>
> On 3/1/24 13:46, Stephen Rothwell wrote:
>> Hi Shuah,
>>
>> On Fri, 1 Mar 2024 09:05:57 -0700 Shuah Khan <[email protected]> wrote:
>>>
>>> On 3/1/24 03:43, Stephen Rothwell wrote:
>>>> Hi all,
>>>>
>>>> On Fri, 1 Mar 2024 15:15:02 +0800 David Gow <[email protected]> wrote:
>>>>>
>>>>> On Thu, 29 Feb 2024 at 23:07, Shuah Khan <[email protected]> wrote:
>>>>>>
>>>>>> I can carry the fix through kselftest kunit if it works
>>>>>> for all.
>>>>>
>>>>> I'm happy for this to go in with the KUnit changes if that's the best
>>>>> way to keep all of the printk formatting fixes together.
>>
>> Unfortunately you can't fix this in the kunit-next tree without pulling
>> in Linus' tree (or the drm-fixes tree) - which seems excessive.
>>>> I am pretty sure that the proper fix has been applied to the
>>>> drm-fixes tree today (in the merge of the drm-misc-fixes tree).
>>>

I misread your message.

>>> What's the commit id for this fix? I Would like to include the details
>>> in my pull request to Linus.
>>
>> My mistake, I misread the merge commit.  It has not been fixed in the
>> drm-misc-fixes tree or the drm-fixes tree (or Linus' tree since the
>> drm-fixes tree has been merged there) :-(
>>
>> The problem in this case is not with the format string types, but with
>> a missing argument i.e. there is another argument required by the
>> format string.  It really should be fixed in the drm-misc-fixes tree
>> and sent to Linus post haste.
>>

Agreed.

>> At least the change in the kunit-next tree will stop this happening in
>> the future.

I misread you message and asked David to send a fix.

I will send pull request with the mention of your fix up to this error
in your first message.

thanks,
-- Shuah