public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Ben Widawsky <bwidawsk@kernel.org>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>
Subject: kernel/resource.c:1795:23: sparse: sparse: cast truncates bits from constant value (fffffffff becomes ffffffff)
Date: Tue, 20 Sep 2022 12:49:42 +0800	[thread overview]
Message-ID: <202209201253.FRw5oo2x-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   521a547ced6477c54b4b0cc206000406c221b4d6
commit: 23a22cd1c98be518774fe7f7e8a5203af050525a cxl/region: Allocate HPA capacity to regions
date:   8 weeks ago
config: arm-randconfig-s042-20220919 (https://download.01.org/0day-ci/archive/20220920/202209201253.FRw5oo2x-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-39-gce1a6720-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=23a22cd1c98be518774fe7f7e8a5203af050525a
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 23a22cd1c98be518774fe7f7e8a5203af050525a
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm SHELL=/bin/bash

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

sparse warnings: (new ones prefixed by >>)
>> kernel/resource.c:1795:23: sparse: sparse: cast truncates bits from constant value (fffffffff becomes ffffffff)
   kernel/resource.c:1813:24: sparse: sparse: cast truncates bits from constant value (fffffffff becomes ffffffff)

vim +1795 kernel/resource.c

14b80582c43e4f Dan Williams 2022-05-20  1788  
14b80582c43e4f Dan Williams 2022-05-20  1789  static resource_size_t gfr_start(struct resource *base, resource_size_t size,
14b80582c43e4f Dan Williams 2022-05-20  1790  				 resource_size_t align, unsigned long flags)
14b80582c43e4f Dan Williams 2022-05-20  1791  {
14b80582c43e4f Dan Williams 2022-05-20  1792  	if (flags & GFR_DESCENDING) {
14b80582c43e4f Dan Williams 2022-05-20  1793  		resource_size_t end;
14b80582c43e4f Dan Williams 2022-05-20  1794  
14b80582c43e4f Dan Williams 2022-05-20 @1795  		end = min_t(resource_size_t, base->end,
14b80582c43e4f Dan Williams 2022-05-20  1796  			    (1ULL << MAX_PHYSMEM_BITS) - 1);
14b80582c43e4f Dan Williams 2022-05-20  1797  		return end - size + 1;
14b80582c43e4f Dan Williams 2022-05-20  1798  	}
14b80582c43e4f Dan Williams 2022-05-20  1799  
14b80582c43e4f Dan Williams 2022-05-20  1800  	return ALIGN(base->start, align);
14b80582c43e4f Dan Williams 2022-05-20  1801  }
14b80582c43e4f Dan Williams 2022-05-20  1802  

:::::: The code at line 1795 was first introduced by commit
:::::: 14b80582c43e4f550acfd93c2b2cadbe36ea0874 resource: Introduce alloc_free_mem_region()

:::::: TO: Dan Williams <dan.j.williams@intel.com>
:::::: CC: Dan Williams <dan.j.williams@intel.com>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

                 reply	other threads:[~2022-09-20  4:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202209201253.FRw5oo2x-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=bwidawsk@kernel.org \
    --cc=dan.j.williams@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.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