All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: sound/pci/au88x0/au88x0_core.c:2029 vortex_adb_checkinout() warn: signedness bug returning '(-22)'
Date: Sun, 23 Aug 2020 07:59:04 +0800	[thread overview]
Message-ID: <202008230752.D2UAT2ca%lkp@intel.com> (raw)

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
CC: Masahiro Yamada <yamada.masahiro@socionext.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   c3d8f220d01220a5b253e422be407d068dc65511
commit: 80591e61a0f7e88deaada69844e4a31280c4a38f kbuild: tell sparse about the $ARCH
date:   9 months ago
:::::: branch date: 7 hours ago
:::::: commit date: 9 months ago
config: riscv-randconfig-m031-20200823 (attached as .config)
compiler: riscv64-linux-gcc (GCC) 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:
sound/pci/au88x0/au88x0_core.c:2029 vortex_adb_checkinout() warn: signedness bug returning '(-22)'
sound/pci/rme9652/hdsp.c:4085 snd_hdsp_channel_info() warn: impossible condition '(hdsp->channel_map[channel] < 0) => (0-255 < 0)'

Old smatch warnings:
arch/riscv/include/asm/current.h:30 get_current() error: uninitialized symbol 'tp'.
sound/pci/au88x0/au88x0_core.c:2046 vortex_adb_checkinout() warn: signedness bug returning '(-12)'
arch/riscv/include/asm/current.h:30 get_current() error: uninitialized symbol 'tp'.
sound/pci/rme9652/hdsp.c:3338 snd_hdsp_proc_read() warn: argument 5 to %lx specifier is cast from pointer

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=80591e61a0f7e88deaada69844e4a31280c4a38f
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 80591e61a0f7e88deaada69844e4a31280c4a38f
vim +2029 sound/pci/au88x0/au88x0_core.c

^1da177e4c3f415 Linus Torvalds  2005-04-16  1990  
^1da177e4c3f415 Linus Torvalds  2005-04-16  1991  /* Resource manager */
^1da177e4c3f415 Linus Torvalds  2005-04-16  1992  static int resnum[VORTEX_RESOURCE_LAST] =
^1da177e4c3f415 Linus Torvalds  2005-04-16  1993      { NR_ADB, NR_SRC, NR_MIXIN, NR_MIXOUT, NR_A3D };
^1da177e4c3f415 Linus Torvalds  2005-04-16  1994  /*
^1da177e4c3f415 Linus Torvalds  2005-04-16  1995   Checkout/Checkin resource of given type. 
^1da177e4c3f415 Linus Torvalds  2005-04-16  1996   resmap: resource map to be used. If NULL means that we want to allocate
^1da177e4c3f415 Linus Torvalds  2005-04-16  1997   a DMA resource (root of all other resources of a dma channel).
^1da177e4c3f415 Linus Torvalds  2005-04-16  1998   out: Mean checkout if != 0. Else mean Checkin resource.
^1da177e4c3f415 Linus Torvalds  2005-04-16  1999   restype: Indicates type of resource to be checked in or out.
^1da177e4c3f415 Linus Torvalds  2005-04-16  2000  */
^1da177e4c3f415 Linus Torvalds  2005-04-16  2001  static char
^1da177e4c3f415 Linus Torvalds  2005-04-16  2002  vortex_adb_checkinout(vortex_t * vortex, int resmap[], int out, int restype)
^1da177e4c3f415 Linus Torvalds  2005-04-16  2003  {
^1da177e4c3f415 Linus Torvalds  2005-04-16  2004  	int i, qty = resnum[restype], resinuse = 0;
^1da177e4c3f415 Linus Torvalds  2005-04-16  2005  
^1da177e4c3f415 Linus Torvalds  2005-04-16  2006  	if (out) {
^1da177e4c3f415 Linus Torvalds  2005-04-16  2007  		/* Gather used resources by all streams. */
^1da177e4c3f415 Linus Torvalds  2005-04-16  2008  		for (i = 0; i < NR_ADB; i++) {
^1da177e4c3f415 Linus Torvalds  2005-04-16  2009  			resinuse |= vortex->dma_adb[i].resources[restype];
^1da177e4c3f415 Linus Torvalds  2005-04-16  2010  		}
^1da177e4c3f415 Linus Torvalds  2005-04-16  2011  		resinuse |= vortex->fixed_res[restype];
^1da177e4c3f415 Linus Torvalds  2005-04-16  2012  		/* Find and take free resource. */
^1da177e4c3f415 Linus Torvalds  2005-04-16  2013  		for (i = 0; i < qty; i++) {
^1da177e4c3f415 Linus Torvalds  2005-04-16  2014  			if ((resinuse & (1 << i)) == 0) {
^1da177e4c3f415 Linus Torvalds  2005-04-16  2015  				if (resmap != NULL)
^1da177e4c3f415 Linus Torvalds  2005-04-16  2016  					resmap[restype] |= (1 << i);
^1da177e4c3f415 Linus Torvalds  2005-04-16  2017  				else
^1da177e4c3f415 Linus Torvalds  2005-04-16  2018  					vortex->dma_adb[i].resources[restype] |= (1 << i);
ee419653a38de93 Takashi Iwai    2009-02-05  2019  				/*
e7e69265b626976 Sudip Mukherjee 2014-09-08  2020  				pr_debug(
ee419653a38de93 Takashi Iwai    2009-02-05  2021  				       "vortex: ResManager: type %d out %d\n",
ee419653a38de93 Takashi Iwai    2009-02-05  2022  				       restype, i);
ee419653a38de93 Takashi Iwai    2009-02-05  2023  				*/
^1da177e4c3f415 Linus Torvalds  2005-04-16  2024  				return i;
^1da177e4c3f415 Linus Torvalds  2005-04-16  2025  			}
^1da177e4c3f415 Linus Torvalds  2005-04-16  2026  		}
^1da177e4c3f415 Linus Torvalds  2005-04-16  2027  	} else {
^1da177e4c3f415 Linus Torvalds  2005-04-16  2028  		if (resmap == NULL)
^1da177e4c3f415 Linus Torvalds  2005-04-16 @2029  			return -EINVAL;
^1da177e4c3f415 Linus Torvalds  2005-04-16  2030  		/* Checkin first resource of type restype. */
^1da177e4c3f415 Linus Torvalds  2005-04-16  2031  		for (i = 0; i < qty; i++) {
^1da177e4c3f415 Linus Torvalds  2005-04-16  2032  			if (resmap[restype] & (1 << i)) {
^1da177e4c3f415 Linus Torvalds  2005-04-16  2033  				resmap[restype] &= ~(1 << i);
ee419653a38de93 Takashi Iwai    2009-02-05  2034  				/*
e7e69265b626976 Sudip Mukherjee 2014-09-08  2035  				pr_debug(
ee419653a38de93 Takashi Iwai    2009-02-05  2036  				       "vortex: ResManager: type %d in %d\n",
ee419653a38de93 Takashi Iwai    2009-02-05  2037  				       restype, i);
ee419653a38de93 Takashi Iwai    2009-02-05  2038  				*/
^1da177e4c3f415 Linus Torvalds  2005-04-16  2039  				return i;
^1da177e4c3f415 Linus Torvalds  2005-04-16  2040  			}
^1da177e4c3f415 Linus Torvalds  2005-04-16  2041  		}
^1da177e4c3f415 Linus Torvalds  2005-04-16  2042  	}
70c84418bf74f58 Sudip Mukherjee 2014-10-13  2043  	dev_err(vortex->card->dev,
70c84418bf74f58 Sudip Mukherjee 2014-10-13  2044  		"FATAL: ResManager: resource type %d exhausted.\n",
70c84418bf74f58 Sudip Mukherjee 2014-10-13  2045  		restype);
^1da177e4c3f415 Linus Torvalds  2005-04-16  2046  	return -ENOMEM;
^1da177e4c3f415 Linus Torvalds  2005-04-16  2047  }
^1da177e4c3f415 Linus Torvalds  2005-04-16  2048  

:::::: The code at line 2029 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

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

             reply	other threads:[~2020-08-22 23:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-22 23:59 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-10-08  7:24 sound/pci/au88x0/au88x0_core.c:2029 vortex_adb_checkinout() warn: signedness bug returning '(-22)' kernel test robot
2020-10-09 12:00 kernel test robot
2020-10-09 16:19 ` Luc Van Oostenryck
2020-10-09 16:19   ` Luc Van Oostenryck
2020-10-09 16:19   ` Luc Van Oostenryck

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=202008230752.D2UAT2ca%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.