[rcu:willy-maple 125/202] lib/maple_tree.c:3273:6: warning: no previous prototype for 'mas_is_span_wr'

From: kernel test robot
Date: Tue Feb 02 2021 - 18:32:31 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git willy-maple
head: 7e346d2845b4bd77663394f39fa70456e0084c86
commit: 824aa5e4af0be646da193e90e3383651b93f1c8d [125/202] Maple Tree: Add new data structure
config: alpha-defconfig (attached as .config)
compiler: alpha-linux-gcc (GCC) 9.3.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://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git/commit/?id=824aa5e4af0be646da193e90e3383651b93f1c8d
git remote add rcu https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
git fetch --no-tags rcu willy-maple
git checkout 824aa5e4af0be646da193e90e3383651b93f1c8d
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=alpha

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

All warnings (new ones prefixed by >>):

>> lib/maple_tree.c:3273:6: warning: no previous prototype for 'mas_is_span_wr' [-Wmissing-prototypes]
3273 | bool mas_is_span_wr(struct ma_state *mas, unsigned long piv,
| ^~~~~~~~~~~~~~
>> lib/maple_tree.c:3373:6: warning: no previous prototype for 'mas_wr_walk' [-Wmissing-prototypes]
3373 | bool mas_wr_walk(struct ma_state *mas, unsigned long *range_min,
| ^~~~~~~~~~~
>> lib/maple_tree.c:5633:5: warning: no previous prototype for 'mtree_store' [-Wmissing-prototypes]
5633 | int mtree_store(struct maple_tree *mt, unsigned long index, void *entry,
| ^~~~~~~~~~~
>> lib/maple_tree.c:5692:5: warning: no previous prototype for 'mtree_alloc_range' [-Wmissing-prototypes]
5692 | int mtree_alloc_range(struct maple_tree *mt, unsigned long *startp,
| ^~~~~~~~~~~~~~~~~
>> lib/maple_tree.c:5727:5: warning: no previous prototype for 'mtree_alloc_rrange' [-Wmissing-prototypes]
5727 | int mtree_alloc_rrange(struct maple_tree *mt, unsigned long *startp,
| ^~~~~~~~~~~~~~~~~~
lib/maple_tree.c:31:28: warning: 'mt_max' defined but not used [-Wunused-const-variable=]
31 | static const unsigned long mt_max[] = {
| ^~~~~~


vim +/mas_is_span_wr +3273 lib/maple_tree.c

3259
3260 /*
3261 * mas_is_span_wr() - Check if the write needs to be treated as a write that
3262 * spans the node.
3263 * @mas: The maple state
3264 * @piv: The pivot value being written
3265 * @type: The maple node type
3266 * @entry: The data to write
3267 *
3268 * Spanning writes are writes that start in one node and end in another OR if
3269 * the write of a %NULL will cause the node to end with a %NULL.
3270 *
3271 * Return: True if this is a spanning write, false otherwise.
3272 */
> 3273 bool mas_is_span_wr(struct ma_state *mas, unsigned long piv,
3274 enum maple_type type, void *entry)
3275 {
3276 unsigned long max;
3277 unsigned long last = mas->last;
3278
3279 if (piv > last) // Contained in this pivot
3280 return false;
3281
3282 max = mas->max;
3283 if (unlikely(ma_is_leaf(type))) {
3284 if (last < max) // Fits in the node, but may span slots.
3285 return false;
3286
3287 if ((last == max) && entry) // Writes to the end of the node but not null.
3288 return false;
3289 } else if ((piv == last) && entry) {
3290 return false;
3291 }
3292
3293 /* Writing ULONG_MAX is not a spanning write regardless of the value
3294 * being written as long as the range fits in the node.
3295 */
3296 if ((last == ULONG_MAX) && (last == max))
3297 return false;
3298
3299 trace_mas_is_span_wr(mas, piv, entry);
3300
3301 return true;
3302 }
3303
3304 /*
3305 * mas_node_walk() - Walk a maple node to offset of the index.
3306 * @mas: The maple state
3307 * @type: The maple node type
3308 * @*range_min: Pointer to store the minimum range of the offset
3309 * @*range_max: Pointer to store the maximum range of the offset
3310 *
3311 * The offset will be stored in the maple state.
3312 *
3313 */
3314 static inline void mas_node_walk(struct ma_state *mas, enum maple_type type,
3315 unsigned long *range_min, unsigned long *range_max)
3316 {
3317 unsigned long *pivots = ma_pivots(mas_mn(mas), type);
3318 unsigned char offset, count;
3319 unsigned long min, max, index;
3320
3321 if (unlikely(ma_is_dense(type))) {
3322 (*range_max) = (*range_min) = mas->index;
3323 mas->offset = mas->index = mas->min;
3324 return;
3325 }
3326
3327 offset = mas->offset;
3328 min = mas_safe_min(mas, pivots, offset);
3329 count = mt_pivots[type];
3330 if (unlikely(offset == count))
3331 goto max;
3332
3333 index = mas->index;
3334 max = pivots[offset];
3335 if (unlikely(index <= max))
3336 goto done;
3337
3338 if (unlikely(!max && offset))
3339 goto max;
3340
3341 offset++;
3342 min = max + 1;
3343 while (offset < count) {
3344 max = pivots[offset];
3345 if (index <= max)
3346 goto done;
3347
3348 if (unlikely(!max))
3349 break;
3350
3351 min = max + 1;
3352 offset++;
3353 }
3354
3355 max:
3356 max = mas->max;
3357 done:
3358 *range_max = max;
3359 *range_min = min;
3360 mas->offset = offset;
3361 }
3362
3363 /*
3364 * mas_wr_walk(): Walk the tree for a write.
3365 * @range_min - pointer that will be set to the minimum of the slot range
3366 * @range_max - pointer that will be set to the maximum of the slot range
3367 * @entry - the value that will be written.
3368 *
3369 * Uses mas_slot_locked() and does not need to worry about dead nodes.
3370 *
3371 * Return: True if it's contained in a node, false on spanning write.
3372 */
> 3373 bool mas_wr_walk(struct ma_state *mas, unsigned long *range_min,
3374 unsigned long *range_max, void *entry)
3375 {
3376 enum maple_type type;
3377
3378 while (true) {
3379 type = mte_node_type(mas->node);
3380 mas->depth++;
3381
3382 mas_node_walk(mas, type, range_min, range_max);
3383 if (mas_is_span_wr(mas, *range_max, type, entry))
3384 return false;
3385
3386 if (ma_is_leaf(type))
3387 return true;
3388
3389 // Traverse.
3390 mas->max = *range_max;
3391 mas->min = *range_min;
3392 mas->node = mas_slot_locked(mas, ma_slots(mas_mn(mas), type),
3393 mas->offset);
3394 mas->offset = 0;
3395 }
3396 return true;
3397 }
3398

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

Attachment: .config.gz
Description: application/gzip