linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Christoph Hellwig <hch@lst.de>
Cc: kbuild-all@lists.01.org,
	Tvrtko Ursulin <tvrtko.ursulin@intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: [linux-next:master 13152/13159] drivers/gpu/drm/i915/gt/shmem_utils.c:76 shmem_pin_map() warn: always true condition '(--i >= 0) => (0-u64max >= 0)'
Date: Sun, 4 Oct 2020 05:07:19 +0800	[thread overview]
Message-ID: <202010040517.GzLE38rk-lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   2172e358cd1713c5b7c31361ac465edfe55e455c
commit: 400b65cb5acbcbe227c95f098349e02f77e04d88 [13152/13159] drm/i915: use vmap in shmem_pin_map
config: x86_64-randconfig-m001-20201004 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

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

smatch warnings:
drivers/gpu/drm/i915/gt/shmem_utils.c:76 shmem_pin_map() warn: always true condition '(--i >= 0) => (0-u64max >= 0)'
drivers/gpu/drm/i915/gt/shmem_utils.c:76 shmem_pin_map() warn: always true condition '(--i >= 0) => (0-u64max >= 0)'

vim +76 drivers/gpu/drm/i915/gt/shmem_utils.c

    51	
    52	void *shmem_pin_map(struct file *file)
    53	{
    54		struct page **pages;
    55		size_t n_pages, i;
    56		void *vaddr;
    57	
    58		n_pages = file->f_mapping->host->i_size >> PAGE_SHIFT;
    59		pages = kvmalloc_array(n_pages, sizeof(*pages), GFP_KERNEL);
    60		if (!pages)
    61			return NULL;
    62	
    63		for (i = 0; i < n_pages; i++) {
    64			pages[i] = shmem_read_mapping_page_gfp(file->f_mapping, i,
    65							       GFP_KERNEL);
    66			if (IS_ERR(pages[i]))
    67				goto err_page;
    68		}
    69	
    70		vaddr = vmap(pages, n_pages, VM_MAP_PUT_PAGES, PAGE_KERNEL);
    71		if (!vaddr)
    72			goto err_page;
    73		mapping_set_unevictable(file->f_mapping);
    74		return vaddr;
    75	err_page:
  > 76		while (--i >= 0)
    77			put_page(pages[i]);
    78		kvfree(pages);
    79		return NULL;
    80	}
    81	

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

             reply	other threads:[~2020-10-03 21:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-03 21:07 kernel test robot [this message]
2020-10-06  7:55 ` [linux-next:master 13152/13159] drivers/gpu/drm/i915/gt/shmem_utils.c:76 shmem_pin_map() warn: always true condition '(--i >= 0) => (0-u64max >= 0)' 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=202010040517.GzLE38rk-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=hch@lst.de \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-mm@kvack.org \
    --cc=tvrtko.ursulin@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).