:::::: 
:::::: Manual check reason: "low confidence bisect report"
:::::: Manual check reason: "low confidence static check warning: 
sound/soc/soc-utils-test.c:125:34: warning: use of uninitialized value '((int 
*)_13 = PHI <&MEM <struct snd_pcm_hw_params> [(void *)&params + 4B](2), 
_48(3)>)[2]' [CWE-457] [-Wanalyzer-use-of-uninitialized-value]"
:::::: 

BCC: l...@intel.com
CC: kbuild-...@lists.01.org
CC: linux-ker...@vger.kernel.org
TO: Richard Fitzgerald <r...@opensource.cirrus.com>
CC: Mark Brown <broo...@kernel.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   568035b01cfb107af8d2e4bd2fb9aea22cf5b868
commit: 89342fa38bbaade51584f255eee5cd43621f4e10 ASoC: soc-utils: Add kunit 
test for snd_soc_tdm_params_to_bclk()
date:   4 months ago
:::::: branch date: 14 hours ago
:::::: commit date: 4 months ago
config: arm-randconfig-c002-20220810 
(https://download.01.org/0day-ci/archive/20220815/202208152002.a2yviwme-...@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
        chmod +x ~/bin/make.cross
        # 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=89342fa38bbaade51584f255eee5cd43621f4e10
        git remote add linus 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 89342fa38bbaade51584f255eee5cd43621f4e10
        # save the config file
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross 
ARCH=arm KBUILD_USERCFLAGS='-fanalyzer -Wno-error' 

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <l...@intel.com>

gcc-analyzer warnings: (new ones prefixed by >>)
   sound/soc/soc-utils-test.c: In function 'test_tdm_params_to_bclk_one':
>> sound/soc/soc-utils-test.c:125:34: warning: use of uninitialized value 
>> '((int *)_13 = PHI <&MEM <struct snd_pcm_hw_params> [(void *)&params + 
>> 4B](2), _48(3)>)[2]' [CWE-457] [-Wanalyzer-use-of-uninitialized-value]
     125 |         struct snd_pcm_hw_params params;
         |                                  ^~~~~~
     'test_tdm_params_to_bclk_one': events 1-4
       |
       |  125 |         struct snd_pcm_hw_params params;
       |      |                                  ^~~~~~
       |      |                                  |
       |      |                                  (1) region created on stack 
here
       |      |                                  (2) following 'true' branch...
       |      |                                  (3) ...to here
       |      |                                  (4) use of uninitialized value 
'((int *)_13 = PHI <&MEM <struct snd_pcm_hw_params> [(void *)&params + 4B](2), 
_48(3)>)[2]' here
       |
>> sound/soc/soc-utils-test.c:125:34: warning: use of uninitialized value 
>> '((int *)_13 = PHI <&MEM <struct snd_pcm_hw_params> [(void *)&params + 
>> 4B](2), _48(3)>)[2]' [CWE-457] [-Wanalyzer-use-of-uninitialized-value]
     125 |         struct snd_pcm_hw_params params;
         |                                  ^~~~~~
     'test_tdm_params_to_bclk': event 1
       |
       |  144 | static void test_tdm_params_to_bclk(struct kunit *test)
       |      |             ^~~~~~~~~~~~~~~~~~~~~~~
       |      |             |
       |      |             (1) entry to 'test_tdm_params_to_bclk'
       |
     'test_tdm_params_to_bclk': events 2-4
       |
       |  148 |         for (i = 0; i < ARRAY_SIZE(tdm_params_to_bclk_cases); 
++i) {
       |  149 |                 test_tdm_params_to_bclk_one(test,
       |      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       |      |                 |
       |      |                 (4) calling 'test_tdm_params_to_bclk_one' from 
'test_tdm_params_to_bclk'
       |  150 |                                             
tdm_params_to_bclk_cases[i].rate,
       |      |                                             
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       |      |                                                                 
       |
       |      |                                                                 
       (3) ...to here
       |  151 |                                             
tdm_params_to_bclk_cases[i].fmt,
       |      |                                             
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       |  152 |                                             
tdm_params_to_bclk_cases[i].channels,
       |      |                                             
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       |  153 |                                             
tdm_params_to_bclk_cases[i].tdm_width,
       |      |                                             
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       |  154 |                                             
tdm_params_to_bclk_cases[i].tdm_slots,
       |      |                                             
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       |  155 |                                             
tdm_params_to_bclk_cases[i].slot_multiple,
       |      |                                             
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       |  156 |                                             
tdm_params_to_bclk_cases[i].bclk);
       |      |                                             
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       |
       +--> 'test_tdm_params_to_bclk_one': events 5-9
              |
              |  118 | static void test_tdm_params_to_bclk_one(struct kunit 
*test,
              |      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
              |      |             |
              |      |             (5) entry to 'test_tdm_params_to_bclk_one'
              |......
              |  125 |         struct snd_pcm_hw_params params;
              |      |                                  ~~~~~~
              |      |                                  |
              |      |                                  (6) region created on 
stack here
              |      |                                  (7) following 'true' 
branch...
              |      |                                  (8) ...to here
              |      |                                  (9) use of 
uninitialized value '((int *)_13 = PHI <&MEM <struct snd_pcm_hw_params> [(void 
*)&params + 4B](2), _48(3)>)[2]' here
              |

vim +125 sound/soc/soc-utils-test.c

89342fa38bbaad Richard Fitzgerald 2022-04-05  117  
89342fa38bbaad Richard Fitzgerald 2022-04-05  118  static void 
test_tdm_params_to_bclk_one(struct kunit *test,
89342fa38bbaad Richard Fitzgerald 2022-04-05  119                               
        unsigned int rate, snd_pcm_format_t fmt,
89342fa38bbaad Richard Fitzgerald 2022-04-05  120                               
        unsigned int channels,
89342fa38bbaad Richard Fitzgerald 2022-04-05  121                               
        unsigned int tdm_width, unsigned int tdm_slots,
89342fa38bbaad Richard Fitzgerald 2022-04-05  122                               
        unsigned int slot_multiple,
89342fa38bbaad Richard Fitzgerald 2022-04-05  123                               
        unsigned int expected_bclk)
89342fa38bbaad Richard Fitzgerald 2022-04-05  124  {
89342fa38bbaad Richard Fitzgerald 2022-04-05 @125       struct 
snd_pcm_hw_params params;
89342fa38bbaad Richard Fitzgerald 2022-04-05  126       int got_bclk;
89342fa38bbaad Richard Fitzgerald 2022-04-05  127  
89342fa38bbaad Richard Fitzgerald 2022-04-05  128       
_snd_pcm_hw_params_any(&params);
89342fa38bbaad Richard Fitzgerald 2022-04-05  129       
snd_mask_none(hw_param_mask(&params, SNDRV_PCM_HW_PARAM_FORMAT));
89342fa38bbaad Richard Fitzgerald 2022-04-05  130       
hw_param_interval(&params, SNDRV_PCM_HW_PARAM_RATE)->min = rate;
89342fa38bbaad Richard Fitzgerald 2022-04-05  131       
hw_param_interval(&params, SNDRV_PCM_HW_PARAM_RATE)->max = rate;
89342fa38bbaad Richard Fitzgerald 2022-04-05  132       
hw_param_interval(&params, SNDRV_PCM_HW_PARAM_CHANNELS)->min = channels;
89342fa38bbaad Richard Fitzgerald 2022-04-05  133       
hw_param_interval(&params, SNDRV_PCM_HW_PARAM_CHANNELS)->max = channels;
89342fa38bbaad Richard Fitzgerald 2022-04-05  134       
params_set_format(&params, fmt);
89342fa38bbaad Richard Fitzgerald 2022-04-05  135  
89342fa38bbaad Richard Fitzgerald 2022-04-05  136       got_bclk = 
snd_soc_tdm_params_to_bclk(&params, tdm_width, tdm_slots, slot_multiple);
89342fa38bbaad Richard Fitzgerald 2022-04-05  137       pr_debug("%s: r=%u 
sb=%u ch=%u tw=%u ts=%u sm=%u expected=%u got=%d\n",
89342fa38bbaad Richard Fitzgerald 2022-04-05  138                __func__,
89342fa38bbaad Richard Fitzgerald 2022-04-05  139                rate, 
params_width(&params), channels, tdm_width, tdm_slots, slot_multiple,
89342fa38bbaad Richard Fitzgerald 2022-04-05  140                expected_bclk, 
got_bclk);
89342fa38bbaad Richard Fitzgerald 2022-04-05  141       KUNIT_ASSERT_EQ(test, 
expected_bclk, (unsigned int)got_bclk);
89342fa38bbaad Richard Fitzgerald 2022-04-05  142  }
89342fa38bbaad Richard Fitzgerald 2022-04-05  143  

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp
_______________________________________________
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-le...@lists.01.org

Reply via email to