All of lore.kernel.org
 help / color / mirror / Atom feed
* sound/virtio/virtio_pcm_msg.c:56 virtsnd_pcm_sg_num() warn: should '((pg - mem_map) + arch_pfn_offset) << 14' be a 64 bit type?
@ 2021-08-28  5:16 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-08-28  5:16 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Anton Yakovlev <anton.yakovlev@opensynergy.com>
CC: Takashi Iwai <tiwai@suse.de>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   64b4fc45bea6f4faa843d2f97ff51665280efee1
commit: f40a28679e0b7cb3a9cc6627a8dbb40961990f0a ALSA: virtio: handling control and I/O messages for the PCM device
date:   6 months ago
:::::: branch date: 6 hours ago
:::::: commit date: 6 months ago
config: arc-randconfig-m031-20210827 (attached as .config)
compiler: arceb-elf-gcc (GCC) 11.2.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>

smatch warnings:
sound/virtio/virtio_pcm_msg.c:56 virtsnd_pcm_sg_num() warn: should '((pg - mem_map) + arch_pfn_offset) << 14' be a 64 bit type?

vim +56 sound/virtio/virtio_pcm_msg.c

f40a28679e0b7c Anton Yakovlev 2021-03-02  38  
f40a28679e0b7c Anton Yakovlev 2021-03-02  39  /**
f40a28679e0b7c Anton Yakovlev 2021-03-02  40   * virtsnd_pcm_sg_num() - Count the number of sg-elements required to represent
f40a28679e0b7c Anton Yakovlev 2021-03-02  41   *                        vmalloc'ed buffer.
f40a28679e0b7c Anton Yakovlev 2021-03-02  42   * @data: Pointer to vmalloc'ed buffer.
f40a28679e0b7c Anton Yakovlev 2021-03-02  43   * @length: Buffer size.
f40a28679e0b7c Anton Yakovlev 2021-03-02  44   *
f40a28679e0b7c Anton Yakovlev 2021-03-02  45   * Context: Any context.
f40a28679e0b7c Anton Yakovlev 2021-03-02  46   * Return: Number of physically contiguous parts in the @data.
f40a28679e0b7c Anton Yakovlev 2021-03-02  47   */
f40a28679e0b7c Anton Yakovlev 2021-03-02  48  static int virtsnd_pcm_sg_num(u8 *data, unsigned int length)
f40a28679e0b7c Anton Yakovlev 2021-03-02  49  {
f40a28679e0b7c Anton Yakovlev 2021-03-02  50  	phys_addr_t sg_address;
f40a28679e0b7c Anton Yakovlev 2021-03-02  51  	unsigned int sg_length;
f40a28679e0b7c Anton Yakovlev 2021-03-02  52  	int num = 0;
f40a28679e0b7c Anton Yakovlev 2021-03-02  53  
f40a28679e0b7c Anton Yakovlev 2021-03-02  54  	while (length) {
f40a28679e0b7c Anton Yakovlev 2021-03-02  55  		struct page *pg = vmalloc_to_page(data);
f40a28679e0b7c Anton Yakovlev 2021-03-02 @56  		phys_addr_t pg_address = page_to_phys(pg);
f40a28679e0b7c Anton Yakovlev 2021-03-02  57  		size_t pg_length;
f40a28679e0b7c Anton Yakovlev 2021-03-02  58  
f40a28679e0b7c Anton Yakovlev 2021-03-02  59  		pg_length = PAGE_SIZE - offset_in_page(data);
f40a28679e0b7c Anton Yakovlev 2021-03-02  60  		if (pg_length > length)
f40a28679e0b7c Anton Yakovlev 2021-03-02  61  			pg_length = length;
f40a28679e0b7c Anton Yakovlev 2021-03-02  62  
f40a28679e0b7c Anton Yakovlev 2021-03-02  63  		if (!num || sg_address + sg_length != pg_address) {
f40a28679e0b7c Anton Yakovlev 2021-03-02  64  			sg_address = pg_address;
f40a28679e0b7c Anton Yakovlev 2021-03-02  65  			sg_length = pg_length;
f40a28679e0b7c Anton Yakovlev 2021-03-02  66  			num++;
f40a28679e0b7c Anton Yakovlev 2021-03-02  67  		} else {
f40a28679e0b7c Anton Yakovlev 2021-03-02  68  			sg_length += pg_length;
f40a28679e0b7c Anton Yakovlev 2021-03-02  69  		}
f40a28679e0b7c Anton Yakovlev 2021-03-02  70  
f40a28679e0b7c Anton Yakovlev 2021-03-02  71  		data += pg_length;
f40a28679e0b7c Anton Yakovlev 2021-03-02  72  		length -= pg_length;
f40a28679e0b7c Anton Yakovlev 2021-03-02  73  	}
f40a28679e0b7c Anton Yakovlev 2021-03-02  74  
f40a28679e0b7c Anton Yakovlev 2021-03-02  75  	return num;
f40a28679e0b7c Anton Yakovlev 2021-03-02  76  }
f40a28679e0b7c Anton Yakovlev 2021-03-02  77  

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-28  5:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-28  5:16 sound/virtio/virtio_pcm_msg.c:56 virtsnd_pcm_sg_num() warn: should '((pg - mem_map) + arch_pfn_offset) << 14' be a 64 bit type? 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.