All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: 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?
Date: Wed, 10 Nov 2021 23:56:50 +0800	[thread overview]
Message-ID: <202111102342.Ksa56WJf-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3820 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:   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 <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) << 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/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 24753 bytes --]

             reply	other threads:[~2021-11-10 15:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-10 15:56 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-11-11 11:05 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? kernel test robot
2021-09-28 18:20 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=202111102342.Ksa56WJf-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.