[K/Unstable][SRU][PATCH 0/1] Fix powerpc test build issue in ubuntu_kernel_selftests

Po-Hsu Lin po-hsu.lin at canonical.com
Fri Dec 30 10:05:32 UTC 2022


[Impact]
When trying to build powerpc tests from ubuntu_kernel_selftests, it
will fail with:
    inlined from ‘cycles_with_mmcr2’ at cycles_with_mmcr2_test.c:81:3:
/usr/include/powerpc64le-linux-gnu/bits/stdio2.h:86:10: error: ‘actual’ may be used uninitialized [-Werror=maybe-uninitialized]
   86 | return __printf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ());
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cycles_with_mmcr2_test.c: In function ‘cycles_with_mmcr2’:
cycles_with_mmcr2_test.c:25:36: note: ‘actual’ was declared here
   25 | uint64_t val, expected[2], actual;
      | ^~~~~~
cc1: all warnings being treated as errors

[Fix]
* ff446cd768 "selftests/powerpc: Avoid GCC 12 uninitialised variable warning"
This patch can be cherry-picked into Kinetic kernel.

[Test]
Apply this patch to the kernel tree and build it with:
sudo make -C linux/tools/testing/selftests TARGETS=powerpc

With this error fixed, test compliation can finish without any issue.

[Where problems could occur]
Change for test case, no impact to acutal function.


Michael Ellerman (1):
  selftests/powerpc: Avoid GCC 12 uninitialised variable warning

 tools/testing/selftests/powerpc/pmu/ebb/cycles_with_mmcr2_test.c | 1 +
 1 file changed, 1 insertion(+)

-- 
2.7.4




More information about the kernel-team mailing list