From: Wei Yang <richard.weiyang@gmail.com>
To: kernel test robot <lkp@intel.com>
Cc: Wei Yang <richard.weiyang@gmail.com>,
akpm@linux-foundation.org, oe-kbuild-all@lists.linux.dev,
willy@infradead.org, michel@lespinasse.org, linux-mm@kvack.org
Subject: Re: [PATCH 3/7] lib/rbtree: add random seed
Date: Fri, 7 Mar 2025 01:55:38 +0000 [thread overview]
Message-ID: <20250307015538.yu6f7hgt3lfefoyw@master> (raw)
In-Reply-To: <202503061924.hFdFosTG-lkp@intel.com>
On Thu, Mar 06, 2025 at 07:34:21PM +0800, kernel test robot wrote:
>Hi Wei,
>
>kernel test robot noticed the following build warnings:
>
>[auto build test WARNING on linus/master]
>[also build test WARNING on v6.14-rc5 next-20250306]
>[cannot apply to akpm-mm/mm-nonmm-unstable akpm-mm/mm-everything]
>[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/Wei-Yang/lib-rbtree-enable-userland-test-suite-for-rbtree-related-data-structure/20250304-092345
>base: linus/master
>patch link: https://lore.kernel.org/r/20250304011952.29182-4-richard.weiyang%40gmail.com
>patch subject: [PATCH 3/7] lib/rbtree: add random seed
>config: csky-randconfig-002-20250305 (https://download.01.org/0day-ci/archive/20250306/202503061924.hFdFosTG-lkp@intel.com/config)
>compiler: csky-linux-gcc (GCC) 14.2.0
>reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250306/202503061924.hFdFosTG-lkp@intel.com/reproduce)
>
>If you fix the issue in a separate patch/commit (i.e. not just a new version of
>the same patch/commit), kindly add following tags
>| Reported-by: kernel test robot <lkp@intel.com>
>| Closes: https://lore.kernel.org/oe-kbuild-all/202503061924.hFdFosTG-lkp@intel.com/
>
>All warnings (new ones prefixed by >>):
>
>>> lib/interval_tree_test.c:22:22: warning: conversion from 'long long unsigned int' to 'ulong' {aka 'long unsigned int'} changes value from '3141592653589793238' to '2721204694' [-Woverflow]
> 22 | __param(ulong, seed, 3141592653589793238ULL, "Random seed");
> | ^~~~~~~~~~~~~~~~~~~~~~
> lib/interval_tree_test.c:10:28: note: in definition of macro '__param'
> 10 | static type name = init; \
> | ^~~~
>--
>>> lib/rbtree_test.c:17:22: warning: conversion from 'long long unsigned int' to 'ulong' {aka 'long unsigned int'} changes value from '3141592653589793238' to '2721204694' [-Woverflow]
> 17 | __param(ulong, seed, 3141592653589793238ULL, "Random seed");
> | ^~~~~~~~~~~~~~~~~~~~~~
> lib/rbtree_test.c:10:28: note: in definition of macro '__param'
> 10 | static type name = init; \
> | ^~~~
>
>
>vim +22 lib/interval_tree_test.c
>
> 20
> 21 __param(uint, max_endpoint, ~0, "Largest value for the interval's endpoint");
> > 22 __param(ulong, seed, 3141592653589793238ULL, "Random seed");
> 23
>
Thanks for reporting. I went through the mail list, it seems I need send a diff
reply here.
Since we already have proper definition of param_xxx_ullong(), I choose
following fix. If any comment, just let me know.
Thanks
diff --git a/include/linux/types.h b/include/linux/types.h
index a3d2182c2686..49b79c8bb1a9 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -92,6 +92,7 @@ typedef unsigned char unchar;
typedef unsigned short ushort;
typedef unsigned int uint;
typedef unsigned long ulong;
+typedef unsigned long long ullong;
#ifndef __BIT_TYPES_DEFINED__
#define __BIT_TYPES_DEFINED__
diff --git a/lib/interval_tree_test.c b/lib/interval_tree_test.c
index 37198afa87ed..5fd62656f42e 100644
--- a/lib/interval_tree_test.c
+++ b/lib/interval_tree_test.c
@@ -21,7 +21,7 @@ __param(int, search_loops, 1000, "Number of iterations searching the tree");
__param(bool, search_all, false, "Searches will iterate all nodes in the tree");
__param(uint, max_endpoint, ~0, "Largest value for the interval's endpoint");
-__param(ulong, seed, 3141592653589793238ULL, "Random seed");
+__param(ullong, seed, 3141592653589793238ULL, "Random seed");
static struct rb_root_cached root = RB_ROOT_CACHED;
static struct interval_tree_node *nodes = NULL;
diff --git a/lib/rbtree_test.c b/lib/rbtree_test.c
index 94ace8f0fbf8..690cede46ac2 100644
--- a/lib/rbtree_test.c
+++ b/lib/rbtree_test.c
@@ -14,7 +14,7 @@
__param(int, nnodes, 100, "Number of nodes in the rb-tree");
__param(int, perf_loops, 1000, "Number of iterations modifying the rb-tree");
__param(int, check_loops, 100, "Number of iterations modifying and verifying the rb-tree");
-__param(ulong, seed, 3141592653589793238ULL, "Random seed");
+__param(ullong, seed, 3141592653589793238ULL, "Random seed");
struct test_node {
u32 key;
diff --git a/tools/include/linux/types.h b/tools/include/linux/types.h
index 8519386acd23..4928e33d44ac 100644
--- a/tools/include/linux/types.h
+++ b/tools/include/linux/types.h
@@ -42,6 +42,8 @@ typedef __s16 s16;
typedef __u8 u8;
typedef __s8 s8;
+typedef unsigned long long ullong;
+
#ifdef __CHECKER__
#define __bitwise __attribute__((bitwise))
#else
--
Wei Yang
Help you, Help me
next prev parent reply other threads:[~2025-03-07 1:55 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-04 1:19 [PATCH 0/7] lib/interval_tree: add some test cases and cleanup Wei Yang
2025-03-04 1:19 ` [PATCH 1/7] lib/rbtree: enable userland test suite for rbtree related data structure Wei Yang
2025-03-04 1:46 ` Matthew Wilcox
2025-03-04 3:04 ` Wei Yang
2025-03-04 1:19 ` [PATCH 2/7] lib/rbtree: split tests Wei Yang
2025-03-04 1:19 ` [PATCH 3/7] lib/rbtree: add random seed Wei Yang
2025-03-05 3:05 ` kernel test robot
2025-03-05 9:10 ` Wei Yang
2025-03-06 11:34 ` kernel test robot
2025-03-07 1:55 ` Wei Yang [this message]
2025-03-07 2:36 ` kernel test robot
2025-03-04 1:19 ` [PATCH 4/7] lib/interval_tree: add test case for interval_tree_iter_xxx() helpers Wei Yang
2025-03-04 1:19 ` [PATCH 5/7] lib/interval_tree: add test case for span iteration Wei Yang
2025-03-04 1:19 ` [PATCH 6/7] lib/interval_tree: skip the check before go to the right subtree Wei Yang
2025-03-04 1:19 ` [PATCH 7/7] lib/interval_tree: fix the comment of interval_tree_span_iter_next_gap() Wei Yang
2025-03-04 14:12 ` Jason Gunthorpe
2025-03-05 0:57 ` Wei Yang
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=20250307015538.yu6f7hgt3lfefoyw@master \
--to=richard.weiyang@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=michel@lespinasse.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=willy@infradead.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox