From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: drivers/video/fbdev/hyperv_fb.c:978 hvfb_get_phymem() warn: should '((page - mem_map) + (0)) << 12' be a 64 bit
Date: Mon, 09 Nov 2020 15:46:31 +0800 [thread overview]
Message-ID: <202011091510.bHrnCPpy-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 5428 bytes --]
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Wei Hu <weh@microsoft.com>
CC: Sasha Levin <alexander.levin@microsoft.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: f8394f232b1eab649ce2df5c5f15b0e528c92091
commit: 3a6fb6c4255c3893ab61e2bd4e9ae01ca6bbcd94 video: hyperv: hyperv_fb: Use physical memory for fb on HyperV Gen 1 VMs.
date: 10 months ago
:::::: branch date: 8 hours ago
:::::: commit date: 10 months ago
config: i386-randconfig-m031-20201109 (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>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
New smatch warnings:
drivers/video/fbdev/hyperv_fb.c:978 hvfb_get_phymem() warn: should '((page - mem_map) + (0)) << 12' be a 64 bit type?
Old smatch warnings:
drivers/video/fbdev/hyperv_fb.c:597 synthvid_get_supported_resolution() warn: inconsistent indenting
vim +978 drivers/video/fbdev/hyperv_fb.c
68a2d20b79b105 drivers/video/hyperv_fb.c Haiyang Zhang 2013-04-29 955
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 956 /*
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 957 * Allocate enough contiguous physical memory.
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 958 * Return physical address if succeeded or -1 if failed.
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 959 */
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 960 static phys_addr_t hvfb_get_phymem(struct hv_device *hdev,
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 961 unsigned int request_size)
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 962 {
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 963 struct page *page = NULL;
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 964 dma_addr_t dma_handle;
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 965 void *vmem;
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 966 phys_addr_t paddr = 0;
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 967 unsigned int order = get_order(request_size);
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 968
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 969 if (request_size == 0)
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 970 return -1;
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 971
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 972 if (order < MAX_ORDER) {
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 973 /* Call alloc_pages if the size is less than 2^MAX_ORDER */
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 974 page = alloc_pages(GFP_KERNEL | __GFP_ZERO, order);
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 975 if (!page)
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 976 return -1;
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 977
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 @978 paddr = (page_to_pfn(page) << PAGE_SHIFT);
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 979 } else {
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 980 /* Allocate from CMA */
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 981 hdev->device.coherent_dma_mask = DMA_BIT_MASK(64);
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 982
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 983 vmem = dma_alloc_coherent(&hdev->device,
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 984 round_up(request_size, PAGE_SIZE),
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 985 &dma_handle,
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 986 GFP_KERNEL | __GFP_NOWARN);
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 987
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 988 if (!vmem)
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 989 return -1;
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 990
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 991 paddr = virt_to_phys(vmem);
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 992 }
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 993
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 994 return paddr;
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 995 }
3a6fb6c4255c38 drivers/video/fbdev/hyperv_fb.c Wei Hu 2019-12-09 996
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 29747 bytes --]
next reply other threads:[~2020-11-09 7:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-09 7:46 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-11-22 23:24 drivers/video/fbdev/hyperv_fb.c:978 hvfb_get_phymem() warn: should '((page - mem_map) + (0)) << 12' be a 64 bit kernel test robot
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=202011091510.bHrnCPpy-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.