LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Isabella Basso <isabellabdoamaral@usp.br>,
	linux@sciencehorizons.net, geert@linux-m68k.org
Cc: kbuild-all@lists.01.org, ferreiraenzoa@gmail.com,
	augusto.duraes33@gmail.com, brendanhiggins@google.com,
	dlatypov@google.com, davidgow@google.com,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
	kunit-dev@googlegroups.com
Subject: Re: [PATCH 6/6] test_hash.c: refactor into kunit
Date: Thu, 26 Aug 2021 18:10:47 +0800	[thread overview]
Message-ID: <202108261826.fL5iv4HD-lkp@intel.com> (raw)
In-Reply-To: <20210826012626.1163705-7-isabellabdoamaral@usp.br>

[-- Attachment #1: Type: text/plain, Size: 12216 bytes --]

Hi Isabella,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v5.14-rc7 next-20210825]
[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]

url:    https://github.com/0day-ci/linux/commits/Isabella-Basso/test_hash-c-refactor-into-KUnit/20210826-092911
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 73f3af7b4611d77bdaea303fb639333eb28e37d7
config: parisc-randconfig-r014-20210825 (attached as .config)
compiler: hppa64-linux-gcc (GCC) 11.2.0
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
        # https://github.com/0day-ci/linux/commit/89fe4c8eec63dcabd6d3e8f3f71f3c2248d18dab
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Isabella-Basso/test_hash-c-refactor-into-KUnit/20210826-092911
        git checkout 89fe4c8eec63dcabd6d3e8f3f71f3c2248d18dab
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=parisc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>):

   lib/test_hash.c: In function 'test_int_hash32':
   lib/test_hash.c:62:50: warning: passing argument 1 of '__hash_32_generic' makes integer from pointer without a cast [-Wint-conversion]
      62 |         hash_or[1][0] |= *h2 = __hash_32_generic(h0);
         |                                                  ^~
         |                                                  |
         |                                                  u32 * {aka unsigned int *}
   In file included from lib/test_hash.c:18:
   include/linux/hash.h:60:41: note: expected 'u32' {aka 'unsigned int'} but argument is of type 'u32 *' {aka 'unsigned int *'}
      60 | static inline u32 __hash_32_generic(u32 val)
         |                                     ~~~~^~~
   lib/test_hash.c:68:1: error: no return statement in function returning non-void [-Werror=return-type]
      68 | }
         | ^
   lib/test_hash.c: In function 'test_int_hash64':
>> lib/test_hash.c:75:31: error: invalid type argument of unary '*' (have 'long long unsigned int')
      75 |         *h2 = hash_64_generic(*h64, *k);
         |                               ^~~~
>> lib/test_hash.c:75:37: error: invalid type argument of unary '*' (have 'int')
      75 |         *h2 = hash_64_generic(*h64, *k);
         |                                     ^~
   In file included from lib/test_hash.c:20:
   lib/test_hash.c:79:29: error: invalid type argument of unary '*' (have 'long long unsigned int')
      79 |                             *h64, *k, *h1, *h2);
         |                             ^~~~
   include/kunit/test.h:775:30: note: in definition of macro 'KUNIT_ASSERTION'
     775 |                            ##__VA_ARGS__);                                     \
         |                              ^~~~~~~~~~~
   include/kunit/test.h:891:9: note: in expansion of macro 'KUNIT_BASE_BINARY_ASSERTION'
     891 |         KUNIT_BASE_BINARY_ASSERTION(test,                                      \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:980:9: note: in expansion of macro 'KUNIT_BASE_EQ_MSG_ASSERTION'
     980 |         KUNIT_BASE_EQ_MSG_ASSERTION(test,                                      \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:1644:9: note: in expansion of macro 'KUNIT_BINARY_EQ_MSG_ASSERTION'
    1644 |         KUNIT_BINARY_EQ_MSG_ASSERTION(test,                                    \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   lib/test_hash.c:77:9: note: in expansion of macro 'KUNIT_ASSERT_EQ_MSG'
      77 |         KUNIT_ASSERT_EQ_MSG(test, *h1, *h2,
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_hash.c:79:35: error: invalid type argument of unary '*' (have 'int')
      79 |                             *h64, *k, *h1, *h2);
         |                                   ^~
   include/kunit/test.h:775:30: note: in definition of macro 'KUNIT_ASSERTION'
     775 |                            ##__VA_ARGS__);                                     \
         |                              ^~~~~~~~~~~
   include/kunit/test.h:891:9: note: in expansion of macro 'KUNIT_BASE_BINARY_ASSERTION'
     891 |         KUNIT_BASE_BINARY_ASSERTION(test,                                      \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:980:9: note: in expansion of macro 'KUNIT_BASE_EQ_MSG_ASSERTION'
     980 |         KUNIT_BASE_EQ_MSG_ASSERTION(test,                                      \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:1644:9: note: in expansion of macro 'KUNIT_BINARY_EQ_MSG_ASSERTION'
    1644 |         KUNIT_BINARY_EQ_MSG_ASSERTION(test,                                    \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   lib/test_hash.c:77:9: note: in expansion of macro 'KUNIT_ASSERT_EQ_MSG'
      77 |         KUNIT_ASSERT_EQ_MSG(test, *h1, *h2,
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_hash.c:85:1: error: no return statement in function returning non-void [-Werror=return-type]
      85 | }
         | ^
   lib/test_hash.c: In function 'test_int_hash':
   lib/test_hash.c:110:24: error: 'return' with a value, in function returning void [-Werror=return-type]
     110 |                 return false;
         |                        ^~~~~
   lib/test_hash.c:97:13: note: declared here
      97 | static void test_int_hash(struct kunit *test, unsigned long long h64)
         |             ^~~~~~~~~~~~~
>> lib/test_hash.c:129:39: warning: passing argument 2 of 'test_int_hash64' makes integer from pointer without a cast [-Wint-conversion]
     129 |                 test_int_hash64(test, &h64, &h0, &h1, &h2, &m, &k);
         |                                       ^~~~
         |                                       |
         |                                       long long unsigned int *
   lib/test_hash.c:72:68: note: expected 'long long unsigned int' but argument is of type 'long long unsigned int *'
      72 | static bool test_int_hash64(struct kunit *test, unsigned long long h64, u32 *h0, u32 *h1,
         |                                                 ~~~~~~~~~~~~~~~~~~~^~~
   lib/test_hash.c:129:64: warning: passing argument 7 of 'test_int_hash64' makes integer from pointer without a cast [-Wint-conversion]
     129 |                 test_int_hash64(test, &h64, &h0, &h1, &h2, &m, &k);
         |                                                                ^~
         |                                                                |
         |                                                                int *
   lib/test_hash.c:73:44: note: expected 'int' but argument is of type 'int *'
      73 |                 u32 *h2, u32 const *m, int k)
         |                                        ~~~~^
   cc1: some warnings being treated as errors


vim +75 lib/test_hash.c

7d8047a5cceb31 Isabella Basso 2021-08-25   70  
7d8047a5cceb31 Isabella Basso 2021-08-25   71  #ifdef HAVE_ARCH_HASH_64
89fe4c8eec63dc Isabella Basso 2021-08-25   72  static bool test_int_hash64(struct kunit *test, unsigned long long h64, u32 *h0, u32 *h1,
89fe4c8eec63dc Isabella Basso 2021-08-25   73  		u32 *h2, u32 const *m, int k)
7d8047a5cceb31 Isabella Basso 2021-08-25   74  {
7d8047a5cceb31 Isabella Basso 2021-08-25  @75  	*h2 = hash_64_generic(*h64, *k);
7d8047a5cceb31 Isabella Basso 2021-08-25   76  #if HAVE_ARCH_HASH_64 == 1
89fe4c8eec63dc Isabella Basso 2021-08-25   77  	KUNIT_ASSERT_EQ_MSG(test, *h1, *h2,
89fe4c8eec63dc Isabella Basso 2021-08-25   78  			    "hash_64(%#llx, %d) = %#x != hash_64_generic() = %#x",
7d8047a5cceb31 Isabella Basso 2021-08-25   79  			    *h64, *k, *h1, *h2);
7d8047a5cceb31 Isabella Basso 2021-08-25   80  #else
89fe4c8eec63dc Isabella Basso 2021-08-25   81  	KUNIT_ASSERT_LE_MSG(test, *h1, *h2,
89fe4c8eec63dc Isabella Basso 2021-08-25   82  			    "hash_64_generic(%#llx, %d) = %#x > %#x",
7d8047a5cceb31 Isabella Basso 2021-08-25   83  			    *h64, *k, *h1, *m);
7d8047a5cceb31 Isabella Basso 2021-08-25   84  #endif
7d8047a5cceb31 Isabella Basso 2021-08-25   85  }
7d8047a5cceb31 Isabella Basso 2021-08-25   86  #endif
7d8047a5cceb31 Isabella Basso 2021-08-25   87  
468a9428521e7d George Spelvin 2016-05-26   88  /*
468a9428521e7d George Spelvin 2016-05-26   89   * Test the various integer hash functions.  h64 (or its low-order bits)
468a9428521e7d George Spelvin 2016-05-26   90   * is the integer to hash.  hash_or accumulates the OR of the hash values,
468a9428521e7d George Spelvin 2016-05-26   91   * which are later checked to see that they cover all the requested bits.
468a9428521e7d George Spelvin 2016-05-26   92   *
468a9428521e7d George Spelvin 2016-05-26   93   * Because these functions (as opposed to the string hashes) are all
468a9428521e7d George Spelvin 2016-05-26   94   * inline, the code being tested is actually in the module, and you can
468a9428521e7d George Spelvin 2016-05-26   95   * recompile and re-test the module without rebooting.
468a9428521e7d George Spelvin 2016-05-26   96   */
89fe4c8eec63dc Isabella Basso 2021-08-25   97  static void test_int_hash(struct kunit *test, unsigned long long h64)
468a9428521e7d George Spelvin 2016-05-26   98  {
468a9428521e7d George Spelvin 2016-05-26   99  	int k;
7d8047a5cceb31 Isabella Basso 2021-08-25  100  	u32 h0 = (u32)h64, h1;
7d8047a5cceb31 Isabella Basso 2021-08-25  101  
7d8047a5cceb31 Isabella Basso 2021-08-25  102  #if defined HAVE_ARCH__HASH_32 || defined HAVE_ARCH_HASH_64
7d8047a5cceb31 Isabella Basso 2021-08-25  103  	u32 h2;
7d8047a5cceb31 Isabella Basso 2021-08-25  104  #endif
468a9428521e7d George Spelvin 2016-05-26  105  
468a9428521e7d George Spelvin 2016-05-26  106  	/* Test __hash32 */
468a9428521e7d George Spelvin 2016-05-26  107  	hash_or[0][0] |= h1 = __hash_32(h0);
468a9428521e7d George Spelvin 2016-05-26  108  #ifdef HAVE_ARCH__HASH_32
89fe4c8eec63dc Isabella Basso 2021-08-25  109  	if (!test_int_hash32(test, &h0, &h1, &h2))
468a9428521e7d George Spelvin 2016-05-26  110  		return false;
468a9428521e7d George Spelvin 2016-05-26  111  #endif
468a9428521e7d George Spelvin 2016-05-26  112  
468a9428521e7d George Spelvin 2016-05-26  113  	/* Test k = 1..32 bits */
468a9428521e7d George Spelvin 2016-05-26  114  	for (k = 1; k <= 32; k++) {
468a9428521e7d George Spelvin 2016-05-26  115  		u32 const m = ((u32)2 << (k-1)) - 1;	/* Low k bits set */
468a9428521e7d George Spelvin 2016-05-26  116  
468a9428521e7d George Spelvin 2016-05-26  117  		/* Test hash_32 */
468a9428521e7d George Spelvin 2016-05-26  118  		hash_or[0][k] |= h1 = hash_32(h0, k);
89fe4c8eec63dc Isabella Basso 2021-08-25  119  		KUNIT_ASSERT_LE_MSG(test, h1, m,
89fe4c8eec63dc Isabella Basso 2021-08-25  120  				    "hash_32(%#x, %d) = %#x > %#x",
89fe4c8eec63dc Isabella Basso 2021-08-25  121  				    h0, k, h1, m);
d41da448b96d6d Isabella Basso 2021-08-25  122  
468a9428521e7d George Spelvin 2016-05-26  123  		/* Test hash_64 */
468a9428521e7d George Spelvin 2016-05-26  124  		hash_or[1][k] |= h1 = hash_64(h64, k);
89fe4c8eec63dc Isabella Basso 2021-08-25  125  		KUNIT_ASSERT_LE_MSG(test, h1, m,
89fe4c8eec63dc Isabella Basso 2021-08-25  126  				    "hash_64(%#llx, %d) = %#x > %#x",
89fe4c8eec63dc Isabella Basso 2021-08-25  127  				    h64, k, h1, m);
468a9428521e7d George Spelvin 2016-05-26  128  #ifdef HAVE_ARCH_HASH_64
89fe4c8eec63dc Isabella Basso 2021-08-25 @129  		test_int_hash64(test, &h64, &h0, &h1, &h2, &m, &k);
468a9428521e7d George Spelvin 2016-05-26  130  #endif
468a9428521e7d George Spelvin 2016-05-26  131  	}
468a9428521e7d George Spelvin 2016-05-26  132  }
468a9428521e7d George Spelvin 2016-05-26  133  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 33138 bytes --]

  parent reply	other threads:[~2021-08-26 10:11 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-26  1:26 [PATCH 0/6] test_hash.c: refactor into KUnit Isabella Basso
2021-08-26  1:26 ` [PATCH 1/6] hash.h: remove unused define directive Isabella Basso
2021-08-26  4:01   ` David Gow
2021-09-05 22:31     ` Isabella B do Amaral
2021-08-26  1:26 ` [PATCH 2/6] test_hash.c: move common definitions to top of file Isabella Basso
2021-08-26 14:36   ` Marco Elver
2021-09-05 22:40     ` Isabella B do Amaral
2021-08-26  1:26 ` [PATCH 3/6] test_hash.c: split test_int_hash into arch-specific functions Isabella Basso
2021-08-26  4:21   ` David Gow
2021-09-05 22:53     ` Isabella B do Amaral
2021-08-26  1:26 ` [PATCH 4/6] test_hash.c: split test_hash_init Isabella Basso
2021-08-26  1:26 ` [PATCH 5/6] lib/Kconfig.debug: properly split hash test kernel entries Isabella Basso
2021-08-26  1:26 ` [PATCH 6/6] test_hash.c: refactor into kunit Isabella Basso
2021-08-26  4:26   ` David Gow
2021-09-05 23:32     ` Isabella B do Amaral
2021-08-26  6:00   ` kernel test robot
2021-08-26 10:10   ` kernel test robot [this message]
2021-08-26  1:36 ` [PATCH 0/6] test_hash.c: refactor into KUnit Daniel Latypov

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=202108261826.fL5iv4HD-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=augusto.duraes33@gmail.com \
    --cc=brendanhiggins@google.com \
    --cc=davidgow@google.com \
    --cc=dlatypov@google.com \
    --cc=ferreiraenzoa@gmail.com \
    --cc=geert@linux-m68k.org \
    --cc=isabellabdoamaral@usp.br \
    --cc=kbuild-all@lists.01.org \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux@sciencehorizons.net \
    --subject='Re: [PATCH 6/6] test_hash.c: refactor into kunit' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).