Subject: linux-next: build failure after merge of the kunit-next tree

From: Stephen Rothwell <[email-masked]>
Date: Wed, 28 Feb 2024 13:48:18 +1100

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_contiguous':
drivers/gpu/drm/tests/drm_buddy_test.c:58:40: error: format '%u' expects argument of type 'unsigned int', but argument 7 has type 'long unsigned int' [-Werror=format=]
   58 |                                        "buddy_alloc hit an error size=%u\n",
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   59 |                                        ps);
      |                                        ~~
      |                                        |
      |                                        long unsigned int
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:55:17: note: in expansion of macro 'KUNIT_ASSERT_FALSE_MSG'
   55 |                 KUNIT_ASSERT_FALSE_MSG(test,
      |                 ^~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/tests/drm_buddy_test.c:58:72: note: format string is defined here
   58 |                                        "buddy_alloc hit an error size=%u\n",
      |                                                                       ~^
      |                                                                        |
      |                                                                        unsigned int
      |                                                                       %lu
drivers/gpu/drm/tests/drm_buddy_test.c:65:32: error: format '%u' expects argument of type 'unsigned int', but argument 7 has type 'long unsigned int' [-Werror=format=]
   65 |                                "buddy_alloc didn't error size=%u\n", 3 * ps);
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~
      |                                                                        |
      |                                                                        long unsigned int
include/kunit/test.h:597:37: note: in definition of macro '_KUNIT_FAILED'
  597 |                                     fmt,                                       \
      |                                     ^~~
include/kunit/test.h:654:9: note: in expansion of macro 'KUNIT_UNARY_ASSERTION'
  654 |         KUNIT_UNARY_ASSERTION(test,                                            \
      |         ^~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:1214:9: note: in expansion of macro 'KUNIT_TRUE_MSG_ASSERTION'
 1214 |         KUNIT_TRUE_MSG_ASSERTION(test,                                         \
      |         ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/tests/drm_buddy_test.c:62:9: note: in expansion of macro 'KUNIT_ASSERT_TRUE_MSG'
   62 |         KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
      |         ^~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/tests/drm_buddy_test.c:65:64: note: format string is defined here
   65 |                                "buddy_alloc didn't error size=%u\n", 3 * ps);
      |                                                               ~^
      |                                                                |
      |                                                                unsigned int
      |                                                               %lu
drivers/gpu/drm/tests/drm_buddy_test.c:71:32: error: format '%u' expects argument of type 'unsigned int', but argument 7 has type 'long unsigned int' [-Werror=format=]
   71 |                                "buddy_alloc didn't error size=%u\n", 3 * ps);
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~
      |                                                                        |
      |                                                                        long unsigned int
include/kunit/test.h:597:37: note: in definition of macro '_KUNIT_FAILED'
  597 |                                     fmt,                                       \
      |                                     ^~~
include/kunit/test.h:654:9: note: in expansion of macro 'KUNIT_UNARY_ASSERTION'
  654 |         KUNIT_UNARY_ASSERTION(test,                                            \
      |         ^~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:1214:9: note: in expansion of macro 'KUNIT_TRUE_MSG_ASSERTION'
 1214 |         KUNIT_TRUE_MSG_ASSERTION(test,                                         \
      |         ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/tests/drm_buddy_test.c:68:9: note: in expansion of macro 'KUNIT_ASSERT_TRUE_MSG'
   68 |         KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
      |         ^~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/tests/drm_buddy_test.c:71:64: note: format string is defined here
   71 |                                "buddy_alloc didn't error size=%u\n", 3 * ps);
      |                                                               ~^
      |                                                                |
      |                                                                unsigned int
      |                                                               %lu
drivers/gpu/drm/tests/drm_buddy_test.c:75:32: error: format '%u' expects argument of type 'unsigned int', but argument 7 has type 'long unsigned int' [-Werror=format=]
   75 |                                "buddy_alloc didn't error size=%u\n", 2 * ps);
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~
      |                                                                        |
      |                                                                        long unsigned int
include/kunit/test.h:597:37: note: in definition of macro '_KUNIT_FAILED'
  597 |                                     fmt,                                       \
      |                                     ^~~
include/kunit/test.h:654:9: note: in expansion of macro 'KUNIT_UNARY_ASSERTION'
  654 |         KUNIT_UNARY_ASSERTION(test,                                            \
      |         ^~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:1214:9: note: in expansion of macro 'KUNIT_TRUE_MSG_ASSERTION'
 1214 |         KUNIT_TRUE_MSG_ASSERTION(test,                                         \
      |         ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/tests/drm_buddy_test.c:72:9: note: in expansion of macro 'KUNIT_ASSERT_TRUE_MSG'
   72 |         KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
      |         ^~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/tests/drm_buddy_test.c:75:64: note: format string is defined here
   75 |                                "buddy_alloc didn't error size=%u\n", 2 * ps);
      |                                                               ~^
      |                                                                |
      |                                                                unsigned int
      |                                                               %lu
drivers/gpu/drm/tests/drm_buddy_test.c:81:32: error: format '%u' expects argument of type 'unsigned int', but argument 7 has type 'long unsigned int' [-Werror=format=]
   81 |                                "buddy_alloc didn't error size=%u\n", 3 * ps);
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~
      |                                                                        |
      |                                                                        long unsigned int
include/kunit/test.h:597:37: note: in definition of macro '_KUNIT_FAILED'
  597 |                                     fmt,                                       \
      |                                     ^~~
include/kunit/test.h:654:9: note: in expansion of macro 'KUNIT_UNARY_ASSERTION'
  654 |         KUNIT_UNARY_ASSERTION(test,                                            \
      |         ^~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:1214:9: note: in expansion of macro 'KUNIT_TRUE_MSG_ASSERTION'
 1214 |         KUNIT_TRUE_MSG_ASSERTION(test,                                         \
      |         ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/tests/drm_buddy_test.c:78:9: note: in expansion of macro 'KUNIT_ASSERT_TRUE_MSG'
   78 |         KUNIT_ASSERT_TRUE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
      |         ^~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/tests/drm_buddy_test.c:81:64: note: format string is defined here
   81 |                                "buddy_alloc didn't error size=%u\n", 3 * ps);
      |                                                               ~^
      |                                                                |
      |                                                                unsigned int
      |                                                               %lu
drivers/gpu/drm/tests/drm_buddy_test.c:90:32: error: format '%u' expects argument of type 'unsigned int', but argument 7 has type 'long unsigned int' [-Werror=format=]
   90 |                                "buddy_alloc hit an error size=%u\n", 2 * ps);
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~
      |                                                                        |
      |                                                                        long unsigned int
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:87:9: note: in expansion of macro 'KUNIT_ASSERT_FALSE_MSG'
   87 |         KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
      |         ^~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/tests/drm_buddy_test.c:90:64: note: format string is defined here
   90 |                                "buddy_alloc hit an error size=%u\n", 2 * ps);
      |                                                               ~^
      |                                                                |
      |                                                                unsigned int
      |                                                               %lu
drivers/gpu/drm/tests/drm_buddy_test.c:96:32: error: format '%u' expects argument of type 'unsigned int', but argument 7 has type 'long unsigned int' [-Werror=format=]
   96 |                                "buddy_alloc hit an error size=%u\n", 3 * ps);
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~
      |                                                                        |
      |                                                                        long unsigned int
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:93:9: note: in expansion of macro 'KUNIT_ASSERT_FALSE_MSG'
   93 |         KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_alloc_blocks(&mm, 0, mm_size,
      |         ^~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/tests/drm_buddy_test.c:96:64: note: format string is defined here
   96 |                                "buddy_alloc hit an error size=%u\n", 3 * ps);
      |                                                               ~^
      |                                                                |
      |                                                                unsigned int
      |                                                               %lu
In file included from drivers/gpu/drm/tests/drm_mm_test.c:8:
drivers/gpu/drm/tests/drm_mm_test.c: In function 'drm_test_mm_init':
drivers/gpu/drm/tests/drm_mm_test.c:160:34: error: zero-length gnu_printf format string [-Werror=format-zero-length]
  160 |                 KUNIT_FAIL(test, "");
      |                                  ^~
include/kunit/test.h:597:37: note: in definition of macro '_KUNIT_FAILED'
  597 |                                     fmt,                                       \
      |                                     ^~~
include/kunit/test.h:625:9: note: in expansion of macro 'KUNIT_FAIL_ASSERTION'
  625 |         KUNIT_FAIL_ASSERTION(test,                                             \
      |         ^~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/tests/drm_mm_test.c:160:17: note: in expansion of macro 'KUNIT_FAIL'
  160 |                 KUNIT_FAIL(test, "");
      |                 ^~~~~~~~~~
drivers/gpu/drm/tests/drm_mm_test.c:174:34: error: zero-length gnu_printf format string [-Werror=format-zero-length]
  174 |                 KUNIT_FAIL(test, "");
      |                                  ^~
include/kunit/test.h:597:37: note: in definition of macro '_KUNIT_FAILED'
  597 |                                     fmt,                                       \
      |                                     ^~~
include/kunit/test.h:625:9: note: in expansion of macro 'KUNIT_FAIL_ASSERTION'
  625 |         KUNIT_FAIL_ASSERTION(test,                                             \
      |         ^~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/tests/drm_mm_test.c:174:17: note: in expansion of macro 'KUNIT_FAIL'
  174 |                 KUNIT_FAIL(test, "");
      |                 ^~~~~~~~~~
drivers/gpu/drm/tests/drm_mm_test.c:181:34: error: zero-length gnu_printf format string [-Werror=format-zero-length]
  181 |                 KUNIT_FAIL(test, "");
      |                                  ^~
include/kunit/test.h:597:37: note: in definition of macro '_KUNIT_FAILED'
  597 |                                     fmt,                                       \
      |                                     ^~~
include/kunit/test.h:625:9: note: in expansion of macro 'KUNIT_FAIL_ASSERTION'
  625 |         KUNIT_FAIL_ASSERTION(test,                                             \
      |         ^~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/tests/drm_mm_test.c:181:17: note: in expansion of macro 'KUNIT_FAIL'
  181 |                 KUNIT_FAIL(test, "");
      |                 ^~~~~~~~~~

Caused by commit

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

Please fix all the current problems before applying a patch to warn
about them.

I have used the kunit-next tree from next-20240227 for today.
-- 
Cheers,
Stephen Rothwell