All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/video/fbdev/hyperv_fb.c:978 hvfb_get_phymem() warn: should '((page - mem_map) + (0)) << 12' be a 64 bit
@ 2020-11-09  7:46 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2020-11-09  7:46 UTC (permalink / raw)
  To: kbuild

[-- 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 --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* drivers/video/fbdev/hyperv_fb.c:978 hvfb_get_phymem() warn: should '((page - mem_map) + (0)) << 12' be a 64 bit
@ 2020-11-22 23:24 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2020-11-22 23:24 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 5470 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:   f4b936f5d6fd0625a78a7b4b92e98739a2bdb6f7
commit: 3a6fb6c4255c3893ab61e2bd4e9ae01ca6bbcd94 video: hyperv: hyperv_fb: Use physical memory for fb on HyperV Gen 1 VMs.
date:   10 months ago
:::::: branch date: 2 hours ago
:::::: commit date: 10 months ago
config: i386-randconfig-m021-20201123 (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

68a2d20b79b105f drivers/video/hyperv_fb.c       Haiyang Zhang 2013-04-29  955  
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  956  /*
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  957   * Allocate enough contiguous physical memory.
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  958   * Return physical address if succeeded or -1 if failed.
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  959   */
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  960  static phys_addr_t hvfb_get_phymem(struct hv_device *hdev,
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  961  				   unsigned int request_size)
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  962  {
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  963  	struct page *page = NULL;
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  964  	dma_addr_t dma_handle;
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  965  	void *vmem;
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  966  	phys_addr_t paddr = 0;
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  967  	unsigned int order = get_order(request_size);
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  968  
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  969  	if (request_size == 0)
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  970  		return -1;
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  971  
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  972  	if (order < MAX_ORDER) {
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  973  		/* Call alloc_pages if the size is less than 2^MAX_ORDER */
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  974  		page = alloc_pages(GFP_KERNEL | __GFP_ZERO, order);
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  975  		if (!page)
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  976  			return -1;
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  977  
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09 @978  		paddr = (page_to_pfn(page) << PAGE_SHIFT);
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  979  	} else {
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  980  		/* Allocate from CMA */
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  981  		hdev->device.coherent_dma_mask = DMA_BIT_MASK(64);
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  982  
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  983  		vmem = dma_alloc_coherent(&hdev->device,
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  984  					  round_up(request_size, PAGE_SIZE),
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  985  					  &dma_handle,
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  986  					  GFP_KERNEL | __GFP_NOWARN);
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  987  
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  988  		if (!vmem)
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  989  			return -1;
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  990  
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  991  		paddr = virt_to_phys(vmem);
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  992  	}
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  993  
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  994  	return paddr;
3a6fb6c4255c389 drivers/video/fbdev/hyperv_fb.c Wei Hu        2019-12-09  995  }
3a6fb6c4255c389 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: 36569 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-22 23:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-09  7:46 drivers/video/fbdev/hyperv_fb.c:978 hvfb_get_phymem() warn: should '((page - mem_map) + (0)) << 12' be a 64 bit kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2020-11-22 23:24 kernel test robot

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.