[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202210220326.pUYk9oBZ-lkp@intel.com>
Date: Sat, 22 Oct 2022 03:31:00 +0800
From: kernel test robot <lkp@...el.com>
To: David Gow <davidgow@...gle.com>,
Brendan Higgins <brendan.higgins@...ux.dev>,
Daniel Latypov <dlatypov@...gle.com>,
Shuah Khan <skhan@...uxfoundation.org>
Cc: llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
David Gow <davidgow@...gle.com>, kunit-dev@...glegroups.com,
linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
Kees Cook <keescook@...omium.org>
Subject: Re: [PATCH 2/2] kunit: Use the static key in
kunit_fail_current_test()
Hi David,
I love your patch! Yet something to improve:
[auto build test ERROR on kees/for-next/pstore]
[also build test ERROR on linus/master v6.1-rc1 next-20221021]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/David-Gow/kunit-Provide-a-static-key-to-check-if-KUnit-is-actively-running-tests/20221021-153225
base: https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/pstore
patch link: https://lore.kernel.org/r/20221021072854.333010-2-davidgow%40google.com
patch subject: [PATCH 2/2] kunit: Use the static key in kunit_fail_current_test()
config: s390-randconfig-r024-20221019
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 791a7ae1ba3efd6bca96338e10ffde557ba83920)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install s390 cross compiling tool for clang build
# apt-get install binutils-s390x-linux-gnu
# https://github.com/intel-lab-lkp/linux/commit/6a21df30828089657bb7d56ce48a6188a4468878
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review David-Gow/kunit-Provide-a-static-key-to-check-if-KUnit-is-actively-running-tests/20221021-153225
git checkout 6a21df30828089657bb7d56ce48a6188a4468878
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=s390 SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
All error/warnings (new ones prefixed by >>):
lib/ubsan.c:149:1: error: expected 'while' in do/while loop
static void ubsan_epilogue(void)
^
lib/ubsan.c:146:2: note: to match this 'do'
kunit_fail_current_test("%s in %s", reason, loc->file_name);
^
include/kunit/test-bug.h:19:43: note: expanded from macro 'kunit_fail_current_test'
#define kunit_fail_current_test(fmt, ...) do { \
^
lib/ubsan.c:184:1: error: function definition is not allowed here
{
^
lib/ubsan.c:199:1: error: function definition is not allowed here
{
^
lib/ubsan.c:215:1: error: function definition is not allowed here
{
^
lib/ubsan.c:229:1: error: function definition is not allowed here
{
^
lib/ubsan.c:244:1: error: function definition is not allowed here
{
^
lib/ubsan.c:257:1: error: function definition is not allowed here
{
^
lib/ubsan.c:271:1: error: function definition is not allowed here
{
^
lib/ubsan.c:288:1: error: function definition is not allowed here
{
^
lib/ubsan.c:330:1: error: function definition is not allowed here
{
^
lib/ubsan.c:340:1: error: function definition is not allowed here
{
^
lib/ubsan.c:364:1: error: function definition is not allowed here
{
^
>> lib/ubsan.c:387:52: error: expected '}'
EXPORT_SYMBOL(__ubsan_handle_alignment_assumption);
^
lib/ubsan.c:138:1: note: to match this '{'
{
^
>> lib/ubsan.c:358:6: warning: mixing declarations and code is incompatible with standards before C99 [-Wdeclaration-after-statement]
void __ubsan_handle_alignment_assumption(void *_data, unsigned long ptr,
^
1 warning and 13 errors generated.
vim +387 lib/ubsan.c
28abcc963149e0 Nathan Chancellor 2021-02-04 357
28abcc963149e0 Nathan Chancellor 2021-02-04 @358 void __ubsan_handle_alignment_assumption(void *_data, unsigned long ptr,
28abcc963149e0 Nathan Chancellor 2021-02-04 359 unsigned long align,
28abcc963149e0 Nathan Chancellor 2021-02-04 360 unsigned long offset);
28abcc963149e0 Nathan Chancellor 2021-02-04 361 void __ubsan_handle_alignment_assumption(void *_data, unsigned long ptr,
28abcc963149e0 Nathan Chancellor 2021-02-04 362 unsigned long align,
28abcc963149e0 Nathan Chancellor 2021-02-04 363 unsigned long offset)
28abcc963149e0 Nathan Chancellor 2021-02-04 364 {
28abcc963149e0 Nathan Chancellor 2021-02-04 365 struct alignment_assumption_data *data = _data;
28abcc963149e0 Nathan Chancellor 2021-02-04 366 unsigned long real_ptr;
28abcc963149e0 Nathan Chancellor 2021-02-04 367
28abcc963149e0 Nathan Chancellor 2021-02-04 368 if (suppress_report(&data->location))
28abcc963149e0 Nathan Chancellor 2021-02-04 369 return;
28abcc963149e0 Nathan Chancellor 2021-02-04 370
28abcc963149e0 Nathan Chancellor 2021-02-04 371 ubsan_prologue(&data->location, "alignment-assumption");
28abcc963149e0 Nathan Chancellor 2021-02-04 372
28abcc963149e0 Nathan Chancellor 2021-02-04 373 if (offset)
28abcc963149e0 Nathan Chancellor 2021-02-04 374 pr_err("assumption of %lu byte alignment (with offset of %lu byte) for pointer of type %s failed",
28abcc963149e0 Nathan Chancellor 2021-02-04 375 align, offset, data->type->type_name);
28abcc963149e0 Nathan Chancellor 2021-02-04 376 else
28abcc963149e0 Nathan Chancellor 2021-02-04 377 pr_err("assumption of %lu byte alignment for pointer of type %s failed",
28abcc963149e0 Nathan Chancellor 2021-02-04 378 align, data->type->type_name);
28abcc963149e0 Nathan Chancellor 2021-02-04 379
28abcc963149e0 Nathan Chancellor 2021-02-04 380 real_ptr = ptr - offset;
28abcc963149e0 Nathan Chancellor 2021-02-04 381 pr_err("%saddress is %lu aligned, misalignment offset is %lu bytes",
28abcc963149e0 Nathan Chancellor 2021-02-04 382 offset ? "offset " : "", BIT(real_ptr ? __ffs(real_ptr) : 0),
28abcc963149e0 Nathan Chancellor 2021-02-04 383 real_ptr & (align - 1));
28abcc963149e0 Nathan Chancellor 2021-02-04 384
28abcc963149e0 Nathan Chancellor 2021-02-04 385 ubsan_epilogue();
28abcc963149e0 Nathan Chancellor 2021-02-04 386 }
28abcc963149e0 Nathan Chancellor 2021-02-04 @387 EXPORT_SYMBOL(__ubsan_handle_alignment_assumption);
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (142791 bytes)
Powered by blists - more mailing lists