CC: [email protected]
CC: [email protected]
TO: Anton Yakovlev <[email protected]>
CC: Takashi Iwai <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   cb690f5238d71f543f4ce874aa59237cf53a877c
commit: f40a28679e0b7cb3a9cc6627a8dbb40961990f0a ALSA: virtio: handling control 
and I/O messages for the PCM device
date:   8 months ago
:::::: branch date: 21 hours ago
:::::: commit date: 8 months ago
config: arc-randconfig-m031-20210928 (attached as .config)
compiler: arc-elf-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

smatch warnings:
sound/virtio/virtio_pcm_msg.c:56 virtsnd_pcm_sg_num() warn: should '((pg - 
mem_map) + arch_pfn_offset) << 13' 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/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to