linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: David Laight <David.Laight@aculab.com>,
	"'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>,
	'Andy Shevchenko' <andriy.shevchenko@linux.intel.com>,
	'Andrew Morton' <akpm@linux-foundation.org>,
	"'Matthew Wilcox (Oracle)'" <willy@infradead.org>,
	'Christoph Hellwig' <hch@infradead.org>,
	"'Jason A. Donenfeld'" <Jason@zx2c4.com>
Cc: oe-kbuild-all@lists.linux.dev,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [PATCH next resend 5/5] minmax: Relax check to allow comparison between int and small unsigned constants.
Date: Fri, 28 Jul 2023 16:08:10 +0800	[thread overview]
Message-ID: <202307281556.iTVIR4tJ-lkp@intel.com> (raw)
In-Reply-To: <48c2cd0407f14859919d4fcbe526234a@AcuMS.aculab.com>

Hi David,

kernel test robot noticed the following build warnings:

[auto build test WARNING on akpm-mm/mm-everything]
[also build test WARNING on linus/master crng-random/master v6.5-rc3 next-20230728]
[cannot apply to next-20230725]
[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-Laight/minmax-Allow-min-max-clamp-if-the-arguments-have-the-same-signedness/20230725-204940
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/48c2cd0407f14859919d4fcbe526234a%40AcuMS.aculab.com
patch subject: [PATCH next resend 5/5] minmax: Relax check to allow comparison between int and small unsigned constants.
config: xtensa-randconfig-r093-20230725 (https://download.01.org/0day-ci/archive/20230728/202307281556.iTVIR4tJ-lkp@intel.com/config)
compiler: xtensa-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230728/202307281556.iTVIR4tJ-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/202307281556.iTVIR4tJ-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   mm/kmemleak.c: note: in included file (through arch/xtensa/include/asm/bitops.h, include/linux/bitops.h, include/linux/kernel.h):
   arch/xtensa/include/asm/processor.h:103:2: sparse: sparse: Unsupported xtensa ABI
   arch/xtensa/include/asm/processor.h:133:2: sparse: sparse: Unsupported Xtensa ABI
>> mm/kmemleak.c:1429:32: sparse: sparse: incompatible types for operation (>=):
>> mm/kmemleak.c:1429:32: sparse:    void *
>> mm/kmemleak.c:1429:32: sparse:    int
>> mm/kmemleak.c:1429:32: sparse: sparse: bad constant expression type
>> mm/kmemleak.c:1429:32: sparse: sparse: incompatible types for operation (>=):
>> mm/kmemleak.c:1429:32: sparse:    void *
>> mm/kmemleak.c:1429:32: sparse:    int
>> mm/kmemleak.c:1429:32: sparse: sparse: incompatible types for operation (>=):
>> mm/kmemleak.c:1429:32: sparse:    void *end
>> mm/kmemleak.c:1429:32: sparse:    int
>> mm/kmemleak.c:1429:32: sparse: sparse: incompatible types for operation (>=):
>> mm/kmemleak.c:1429:32: sparse:    void *
>> mm/kmemleak.c:1429:32: sparse:    int
>> mm/kmemleak.c:1429:32: sparse: sparse: incompatible types for operation (>=):
>> mm/kmemleak.c:1429:32: sparse:    void *end
>> mm/kmemleak.c:1429:32: sparse:    int
   mm/kmemleak.c:1429:32: sparse: sparse: incompatible types for operation (<):
   mm/kmemleak.c:1429:32: sparse:    bad type __UNIQUE_ID___x229
   mm/kmemleak.c:1429:32: sparse:    bad type __UNIQUE_ID___y230

vim +1429 mm/kmemleak.c

3c7b4e6b8be4c1 Catalin Marinas  2009-06-11  1396  
3c7b4e6b8be4c1 Catalin Marinas  2009-06-11  1397  /*
3c7b4e6b8be4c1 Catalin Marinas  2009-06-11  1398   * Scan a memory block corresponding to a kmemleak_object. A condition is
3c7b4e6b8be4c1 Catalin Marinas  2009-06-11  1399   * that object->use_count >= 1.
3c7b4e6b8be4c1 Catalin Marinas  2009-06-11  1400   */
3c7b4e6b8be4c1 Catalin Marinas  2009-06-11  1401  static void scan_object(struct kmemleak_object *object)
3c7b4e6b8be4c1 Catalin Marinas  2009-06-11  1402  {
3c7b4e6b8be4c1 Catalin Marinas  2009-06-11  1403  	struct kmemleak_scan_area *area;
3c7b4e6b8be4c1 Catalin Marinas  2009-06-11  1404  	unsigned long flags;
0c24e061196c21 Patrick Wang     2022-06-11  1405  	void *obj_ptr;
3c7b4e6b8be4c1 Catalin Marinas  2009-06-11  1406  
3c7b4e6b8be4c1 Catalin Marinas  2009-06-11  1407  	/*
21ae2956ce289f Uwe Kleine-König 2009-10-07  1408  	 * Once the object->lock is acquired, the corresponding memory block
21ae2956ce289f Uwe Kleine-König 2009-10-07  1409  	 * cannot be freed (the same lock is acquired in delete_object).
3c7b4e6b8be4c1 Catalin Marinas  2009-06-11  1410  	 */
8c96f1bc6fc49c He Zhe           2020-01-30  1411  	raw_spin_lock_irqsave(&object->lock, flags);
3c7b4e6b8be4c1 Catalin Marinas  2009-06-11  1412  	if (object->flags & OBJECT_NO_SCAN)
3c7b4e6b8be4c1 Catalin Marinas  2009-06-11  1413  		goto out;
3c7b4e6b8be4c1 Catalin Marinas  2009-06-11  1414  	if (!(object->flags & OBJECT_ALLOCATED))
3c7b4e6b8be4c1 Catalin Marinas  2009-06-11  1415  		/* already freed object */
3c7b4e6b8be4c1 Catalin Marinas  2009-06-11  1416  		goto out;
0c24e061196c21 Patrick Wang     2022-06-11  1417  
0c24e061196c21 Patrick Wang     2022-06-11  1418  	obj_ptr = object->flags & OBJECT_PHYS ?
0c24e061196c21 Patrick Wang     2022-06-11  1419  		  __va((phys_addr_t)object->pointer) :
0c24e061196c21 Patrick Wang     2022-06-11  1420  		  (void *)object->pointer;
0c24e061196c21 Patrick Wang     2022-06-11  1421  
dba82d9431770e Catalin Marinas  2019-09-23  1422  	if (hlist_empty(&object->area_list) ||
dba82d9431770e Catalin Marinas  2019-09-23  1423  	    object->flags & OBJECT_FULL_SCAN) {
0c24e061196c21 Patrick Wang     2022-06-11  1424  		void *start = obj_ptr;
0c24e061196c21 Patrick Wang     2022-06-11  1425  		void *end = obj_ptr + object->size;
93ada579b0eea0 Catalin Marinas  2015-06-24  1426  		void *next;
af98603dad87e3 Catalin Marinas  2009-08-27  1427  
93ada579b0eea0 Catalin Marinas  2015-06-24  1428  		do {
93ada579b0eea0 Catalin Marinas  2015-06-24 @1429  			next = min(start + MAX_SCAN_SIZE, end);
93ada579b0eea0 Catalin Marinas  2015-06-24  1430  			scan_block(start, next, object);
93ada579b0eea0 Catalin Marinas  2015-06-24  1431  
93ada579b0eea0 Catalin Marinas  2015-06-24  1432  			start = next;
93ada579b0eea0 Catalin Marinas  2015-06-24  1433  			if (start >= end)
93ada579b0eea0 Catalin Marinas  2015-06-24  1434  				break;
af98603dad87e3 Catalin Marinas  2009-08-27  1435  
8c96f1bc6fc49c He Zhe           2020-01-30  1436  			raw_spin_unlock_irqrestore(&object->lock, flags);
af98603dad87e3 Catalin Marinas  2009-08-27  1437  			cond_resched();
8c96f1bc6fc49c He Zhe           2020-01-30  1438  			raw_spin_lock_irqsave(&object->lock, flags);
93ada579b0eea0 Catalin Marinas  2015-06-24  1439  		} while (object->flags & OBJECT_ALLOCATED);
af98603dad87e3 Catalin Marinas  2009-08-27  1440  	} else
b67bfe0d42cac5 Sasha Levin      2013-02-27  1441  		hlist_for_each_entry(area, &object->area_list, node)
c017b4be3e8417 Catalin Marinas  2009-10-28  1442  			scan_block((void *)area->start,
c017b4be3e8417 Catalin Marinas  2009-10-28  1443  				   (void *)(area->start + area->size),
93ada579b0eea0 Catalin Marinas  2015-06-24  1444  				   object);
3c7b4e6b8be4c1 Catalin Marinas  2009-06-11  1445  out:
8c96f1bc6fc49c He Zhe           2020-01-30  1446  	raw_spin_unlock_irqrestore(&object->lock, flags);
3c7b4e6b8be4c1 Catalin Marinas  2009-06-11  1447  }
3c7b4e6b8be4c1 Catalin Marinas  2009-06-11  1448  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


      parent reply	other threads:[~2023-07-28  8:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <48c2cd0407f14859919d4fcbe526234a@AcuMS.aculab.com>
2023-07-25 19:36 ` kernel test robot
2023-07-26  9:29   ` David Laight
2023-07-27  5:20 ` kernel test robot
2023-07-28  7:15 ` kernel test robot
2023-07-28  8:08 ` kernel test robot [this message]

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=202307281556.iTVIR4tJ-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=David.Laight@aculab.com \
    --cc=Jason@zx2c4.com \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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