sound/pci/rme96.c:1011 snd_rme96_playback_hw_params() warn: inconsistent returns '&rme96->lock'.
kernel test robot <[email protected]>
| Newsgroups | dev.linux.lists.oe-kbuild |
|---|---|
| Message-ID | <[email protected]> |
BCC: [email protected] CC: [email protected] CC: [email protected] TO: Takashi Iwai <[email protected]> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 0e35b9b6ec0ffcc5e23cbdec09f5c622ad532b53 commit: d3424b8bf78593e1751cfa19628aa0008d2e08ce ALSA: rme96: Use guard() for spin locks date: 10 months ago :::::: branch date: 2 days ago :::::: commit date: 10 months ago config: alpha-randconfig-r073-20260709 (https://download.01.org/0day-ci/archive/20260709/[email protected]/config) compiler: alpha-linux-gcc (GCC) 8.5.0 smatch: v0.5.0-9185-gbcc58b9c If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Fixes: d3424b8bf785 ("ALSA: rme96: Use guard() for spin locks") | Reported-by: kernel test robot <[email protected]> | Reported-by: Dan Carpenter <[email protected]> | Closes: https://lore.kernel.org/r/[email protected]/ smatch warnings: sound/pci/rme96.c:1011 snd_rme96_playback_hw_params() warn: inconsistent returns '&rme96->lock'. sound/pci/rme96.c:1011 snd_rme96_playback_hw_params() warn: inconsistent returns 'irq'. vim +1011 sound/pci/rme96.c ^1da177e4c3f415 Linus Torvalds 2005-04-16 952 ^1da177e4c3f415 Linus Torvalds 2005-04-16 953 static int a3aefd883dc8c17 Takashi Iwai 2005-11-17 954 snd_rme96_playback_hw_params(struct snd_pcm_substream *substream, a3aefd883dc8c17 Takashi Iwai 2005-11-17 955 struct snd_pcm_hw_params *params) ^1da177e4c3f415 Linus Torvalds 2005-04-16 956 { a3aefd883dc8c17 Takashi Iwai 2005-11-17 957 struct rme96 *rme96 = snd_pcm_substream_chip(substream); a3aefd883dc8c17 Takashi Iwai 2005-11-17 958 struct snd_pcm_runtime *runtime = substream->runtime; ^1da177e4c3f415 Linus Torvalds 2005-04-16 959 int err, rate, dummy; a74a821624c0c75 Takashi Iwai 2015-12-04 960 bool apply_dac_volume = false; ^1da177e4c3f415 Linus Torvalds 2005-04-16 961 4d23359b7ec8b03 Clemens Ladisch 2005-09-05 962 runtime->dma_area = (void __force *)(rme96->iobase + 4d23359b7ec8b03 Clemens Ladisch 2005-09-05 963 RME96_IO_PLAY_BUFFER); ^1da177e4c3f415 Linus Torvalds 2005-04-16 964 runtime->dma_addr = rme96->port + RME96_IO_PLAY_BUFFER; ^1da177e4c3f415 Linus Torvalds 2005-04-16 965 runtime->dma_bytes = RME96_BUFFER_SIZE; ^1da177e4c3f415 Linus Torvalds 2005-04-16 966 d3424b8bf78593e Takashi Iwai 2025-08-29 967 scoped_guard(spinlock_irq, &rme96->lock) { da8eedb169712c8 Takashi Iwai 2021-06-08 968 rate = 0; ^1da177e4c3f415 Linus Torvalds 2005-04-16 969 if (!(rme96->wcreg & RME96_WCR_MASTER) && da8eedb169712c8 Takashi Iwai 2021-06-08 970 snd_rme96_getinputtype(rme96) != RME96_INPUT_ANALOG) da8eedb169712c8 Takashi Iwai 2021-06-08 971 rate = snd_rme96_capture_getrate(rme96, &dummy); da8eedb169712c8 Takashi Iwai 2021-06-08 972 if (rate > 0) { ^1da177e4c3f415 Linus Torvalds 2005-04-16 973 /* slave clock */ d3424b8bf78593e Takashi Iwai 2025-08-29 974 if ((int)params_rate(params) != rate) d3424b8bf78593e Takashi Iwai 2025-08-29 975 return -EIO; a74a821624c0c75 Takashi Iwai 2015-12-04 976 } else { a74a821624c0c75 Takashi Iwai 2015-12-04 977 err = snd_rme96_playback_setrate(rme96, params_rate(params)); a74a821624c0c75 Takashi Iwai 2015-12-04 978 if (err < 0) d3424b8bf78593e Takashi Iwai 2025-08-29 979 return err; a74a821624c0c75 Takashi Iwai 2015-12-04 980 apply_dac_volume = err > 0; /* need to restore volume later? */ ^1da177e4c3f415 Linus Torvalds 2005-04-16 981 } a74a821624c0c75 Takashi Iwai 2015-12-04 982 a74a821624c0c75 Takashi Iwai 2015-12-04 983 err = snd_rme96_playback_setformat(rme96, params_format(params)); a74a821624c0c75 Takashi Iwai 2015-12-04 984 if (err < 0) a74a821624c0c75 Takashi Iwai 2015-12-04 985 goto error; ^1da177e4c3f415 Linus Torvalds 2005-04-16 986 snd_rme96_setframelog(rme96, params_channels(params), 1); ^1da177e4c3f415 Linus Torvalds 2005-04-16 987 if (rme96->capture_periodsize != 0) { ^1da177e4c3f415 Linus Torvalds 2005-04-16 988 if (params_period_size(params) << rme96->playback_frlog != d3424b8bf78593e Takashi Iwai 2025-08-29 989 rme96->capture_periodsize) { a74a821624c0c75 Takashi Iwai 2015-12-04 990 err = -EBUSY; a74a821624c0c75 Takashi Iwai 2015-12-04 991 goto error; ^1da177e4c3f415 Linus Torvalds 2005-04-16 992 } ^1da177e4c3f415 Linus Torvalds 2005-04-16 993 } ^1da177e4c3f415 Linus Torvalds 2005-04-16 994 rme96->playback_periodsize = ^1da177e4c3f415 Linus Torvalds 2005-04-16 995 params_period_size(params) << rme96->playback_frlog; ^1da177e4c3f415 Linus Torvalds 2005-04-16 996 snd_rme96_set_period_properties(rme96, rme96->playback_periodsize); ^1da177e4c3f415 Linus Torvalds 2005-04-16 997 /* S/PDIF setup */ ^1da177e4c3f415 Linus Torvalds 2005-04-16 998 if ((rme96->wcreg & RME96_WCR_ADAT) == 0) { ^1da177e4c3f415 Linus Torvalds 2005-04-16 999 rme96->wcreg &= ~(RME96_WCR_PRO | RME96_WCR_DOLBY | RME96_WCR_EMP); ^1da177e4c3f415 Linus Torvalds 2005-04-16 1000 writel(rme96->wcreg |= rme96->wcreg_spdif_stream, rme96->iobase + RME96_IO_CONTROL_REGISTER); ^1da177e4c3f415 Linus Torvalds 2005-04-16 1001 } a74a821624c0c75 Takashi Iwai 2015-12-04 1002 a74a821624c0c75 Takashi Iwai 2015-12-04 1003 err = 0; d3424b8bf78593e Takashi Iwai 2025-08-29 1004 } a74a821624c0c75 Takashi Iwai 2015-12-04 1005 error: a74a821624c0c75 Takashi Iwai 2015-12-04 1006 if (apply_dac_volume) { a74a821624c0c75 Takashi Iwai 2015-12-04 1007 usleep_range(3000, 10000); a74a821624c0c75 Takashi Iwai 2015-12-04 1008 snd_rme96_apply_dac_volume(rme96); a74a821624c0c75 Takashi Iwai 2015-12-04 1009 } ^1da177e4c3f415 Linus Torvalds 2005-04-16 1010 a74a821624c0c75 Takashi Iwai 2015-12-04 @1011 return err; ^1da177e4c3f415 Linus Torvalds 2005-04-16 1012 } ^1da177e4c3f415 Linus Torvalds 2005-04-16 1013 :::::: The code at line 1011 was first introduced by commit :::::: a74a821624c0c75388a193337babd17a8c02c740 ALSA: rme96: Fix unexpected volume reset after rate changes :::::: TO: Takashi Iwai <[email protected]> :::::: CC: Takashi Iwai <[email protected]> -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki