public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org, Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>,
	kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Masahiro Yamada <yamada.masahiro@socionext.com>
Subject: sound/pci/au88x0/au88x0_core.c:2029 vortex_adb_checkinout() warn: signedness bug returning '(-22)'
Date: Fri, 9 Oct 2020 15:00:43 +0300	[thread overview]
Message-ID: <20201009120043.GL1042@kadam> (raw)

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

Hi Luc,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   c85fb28b6f999db9928b841f63f1beeb3074eeca
commit: 80591e61a0f7e88deaada69844e4a31280c4a38f kbuild: tell sparse about the $ARCH
config: powerpc64-randconfig-m031-20201008 (attached as .config)
compiler: powerpc-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:
sound/pci/au88x0/au88x0_core.c:2046 vortex_adb_checkinout() warn: signedness bug returning '(-12)'
sound/pci/rme9652/hdsp.c:3338 snd_hdsp_proc_read() warn: argument 5 to %lx specifier is cast from pointer
sound/pci/rme9652/hdsp.c:5305 snd_hdsp_create() warn: 'hdsp->iobase' not released on lines: 5237.
sound/pci/rme9652/hdsp.c:5305 snd_hdsp_create() warn: 'pci' not released on lines: 5237.

vim +2029 sound/pci/au88x0/au88x0_core.c

^1da177e4c3f415 Linus Torvalds  2005-04-16  2001  static char
                                                         ^^^^
Is char unsigned on PowerPC?  I thought that was only on s390.

^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  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

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

             reply	other threads:[~2020-10-09 12:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-09 12:00 kernel test robot [this message]
2020-10-09 16:19 ` sound/pci/au88x0/au88x0_core.c:2029 vortex_adb_checkinout() warn: signedness bug returning '(-22)' 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=20201009120043.GL1042@kadam \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luc.vanoostenryck@gmail.com \
    --cc=yamada.masahiro@socionext.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox