public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Christoph Hellwig <hch@lst.de>
Subject: kernel/dma/pool.c:79 cma_in_zone() warn: always true condition '(end <= ((((32) == 64)) << (32)) - 1))) => (0-u32max <= u32max)'
Date: Tue, 25 Aug 2020 13:45:38 +0800	[thread overview]
Message-ID: <202008251334.2KKCn4PE%lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   6a9dc5fd6170d0a41c8a14eb19e63d94bea5705a
commit: d7e673ec2c8e0ea39c4c70fc490d67d7fbda869d dma-pool: Only allocate from CMA when in same memory zone
date:   11 days ago
config: arc-randconfig-m031-20200824 (attached as .config)
compiler: arc-elf-gcc (GCC) 9.3.0

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

New smatch warnings:
kernel/dma/pool.c:79 cma_in_zone() warn: always true condition '(end <= ((((32) == 64)) ?~0:((1 << (32)) - 1))) => (0-u32max <= u32max)'

Old smatch warnings:
arch/arc/include/asm/thread_info.h:65 current_thread_info() error: uninitialized symbol 'sp'.

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d7e673ec2c8e0ea39c4c70fc490d67d7fbda869d
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout d7e673ec2c8e0ea39c4c70fc490d67d7fbda869d
vim +79 kernel/dma/pool.c

    59	
    60	static bool cma_in_zone(gfp_t gfp)
    61	{
    62		unsigned long size;
    63		phys_addr_t end;
    64		struct cma *cma;
    65	
    66		cma = dev_get_cma_area(NULL);
    67		if (!cma)
    68			return false;
    69	
    70		size = cma_get_size(cma);
    71		if (!size)
    72			return false;
    73	
    74		/* CMA can't cross zone boundaries, see cma_activate_area() */
    75		end = cma_get_base(cma) + size - 1;
    76		if (IS_ENABLED(CONFIG_ZONE_DMA) && (gfp & GFP_DMA))
    77			return end <= DMA_BIT_MASK(zone_dma_bits);
    78		if (IS_ENABLED(CONFIG_ZONE_DMA32) && (gfp & GFP_DMA32))
  > 79			return end <= DMA_BIT_MASK(32);
    80		return true;
    81	}
    82	

---
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: 28564 bytes --]

             reply	other threads:[~2020-08-25  5:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-25  5:45 kernel test robot [this message]
2020-08-25  7:04 ` kernel/dma/pool.c:79 cma_in_zone() warn: always true condition '(end <= ((((32) == 64)) << (32)) - 1))) => (0-u32max <= u32max)' Christoph Hellwig

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=202008251334.2KKCn4PE%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=hch@lst.de \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nsaenzjulienne@suse.de \
    /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