CC: [email protected]
CC: [email protected]
CC: [email protected]
TO: Bard Liao <[email protected]>
CC: Mark Brown <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   9ff50bf2f2ff5fab01cac26d8eed21a89308e6ef
commit: 349dd23931d1943b1083182e35715eba8b150fe1 ASoC: max98373: don't access 
volatile registers in bias level off
date:   8 months ago
:::::: branch date: 26 hours ago
:::::: commit date: 8 months ago
config: arm-randconfig-c002-20210816 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 
44d0a99a12ec7ead4d2f5ef649ba05b40f6d463d)
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
        # install arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=349dd23931d1943b1083182e35715eba8b150fe1
        git remote add linus 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 349dd23931d1943b1083182e35715eba8b150fe1
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm 
clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>


clang-analyzer warnings: (new ones prefixed by >>)
           if (!fbdata->ready && fbdata->picolcd)
                              ^
   drivers/hid/hid-picolcd_fb.c:247:2: note: Loop condition is true.  Entering 
loop body
           for (chip = 0; chip < 4; chip++)
           ^
   drivers/hid/hid-picolcd_fb.c:248:3: note: Loop condition is true.  Entering 
loop body
                   for (tile = 0; tile < 8; tile++) {
                   ^
   drivers/hid/hid-picolcd_fb.c:249:8: note: Assuming field 'force' is 0
                           if (!fbdata->force && !picolcd_fb_update_tile(
                               ^~~~~~~~~~~~~~
   drivers/hid/hid-picolcd_fb.c:249:8: note: Left side of '&&' is true
   drivers/hid/hid-picolcd_fb.c:249:27: note: Calling 'picolcd_fb_update_tile'
                           if (!fbdata->force && !picolcd_fb_update_tile(
                                                  ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/hid/hid-picolcd_fb.c:148:6: note: Assuming 'bpp' is equal to 1
           if (bpp == 1) {
               ^~~~~~~~
   drivers/hid/hid-picolcd_fb.c:148:2: note: Taking true branch
           if (bpp == 1) {
           ^
   drivers/hid/hid-picolcd_fb.c:149:3: note: Loop condition is true.  Entering 
loop body
                   for (b = 7; b >= 0; b--) {
                   ^
   drivers/hid/hid-picolcd_fb.c:151:9: note: The value 0 is assigned to 'i'
                           for (i = 0; i < 64; i++) {
                                ^~~~~
   drivers/hid/hid-picolcd_fb.c:151:4: note: Loop condition is true.  Entering 
loop body
                           for (i = 0; i < 64; i++) {
                           ^
   drivers/hid/hid-picolcd_fb.c:152:14: note: The left expression of the 
compound assignment is an uninitialized value. The computed value will also be 
garbage
                                   tdata[i] <<= 1;
                                   ~~~~~~~~ ^
   drivers/hid/hid-picolcd_fb.c:160:14: warning: The left expression of the 
compound assignment is an uninitialized value. The computed value will also be 
garbage [clang-analyzer-core.uninitialized.Assign]
                                   tdata[i] <<= 1;
                                            ^
   drivers/hid/hid-picolcd_fb.c:437:2: note: Calling 'picolcd_fb_update'
           picolcd_fb_update(info);
           ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/hid/hid-picolcd_fb.c:234:2: note: Loop condition is false.  Exiting 
loop
           spin_lock_irqsave(&fbdata->lock, flags);
           ^
   include/linux/spinlock.h:384:2: note: expanded from macro 'spin_lock_irqsave'
           raw_spin_lock_irqsave(spinlock_check(lock), flags);     \
           ^
   include/linux/spinlock.h:250:2: note: expanded from macro 
'raw_spin_lock_irqsave'
           do {                                            \
           ^
   drivers/hid/hid-picolcd_fb.c:234:2: note: Loop condition is false.  Exiting 
loop
           spin_lock_irqsave(&fbdata->lock, flags);
           ^
   include/linux/spinlock.h:382:43: note: expanded from macro 
'spin_lock_irqsave'
   #define spin_lock_irqsave(lock, flags)                          \
                                                                   ^
   drivers/hid/hid-picolcd_fb.c:235:6: note: Assuming field 'ready' is not 
equal to 0
           if (!fbdata->ready && fbdata->picolcd)
               ^~~~~~~~~~~~~~
   drivers/hid/hid-picolcd_fb.c:235:21: note: Left side of '&&' is false
           if (!fbdata->ready && fbdata->picolcd)
                              ^
   drivers/hid/hid-picolcd_fb.c:247:2: note: Loop condition is true.  Entering 
loop body
           for (chip = 0; chip < 4; chip++)
           ^
   drivers/hid/hid-picolcd_fb.c:248:3: note: Loop condition is true.  Entering 
loop body
                   for (tile = 0; tile < 8; tile++) {
                   ^
   drivers/hid/hid-picolcd_fb.c:249:8: note: Assuming field 'force' is 0
                           if (!fbdata->force && !picolcd_fb_update_tile(
                               ^~~~~~~~~~~~~~
   drivers/hid/hid-picolcd_fb.c:249:8: note: Left side of '&&' is true
   drivers/hid/hid-picolcd_fb.c:249:27: note: Calling 'picolcd_fb_update_tile'
                           if (!fbdata->force && !picolcd_fb_update_tile(
                                                  ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/hid/hid-picolcd_fb.c:148:6: note: Assuming 'bpp' is not equal to 1
           if (bpp == 1) {
               ^~~~~~~~
   drivers/hid/hid-picolcd_fb.c:148:2: note: Taking false branch
           if (bpp == 1) {
           ^
   drivers/hid/hid-picolcd_fb.c:156:13: note: Assuming 'bpp' is equal to 8
           } else if (bpp == 8) {
                      ^~~~~~~~
   drivers/hid/hid-picolcd_fb.c:156:9: note: Taking true branch
           } else if (bpp == 8) {
                  ^
   drivers/hid/hid-picolcd_fb.c:157:3: note: Loop condition is true.  Entering 
loop body
                   for (b = 7; b >= 0; b--) {
                   ^
   drivers/hid/hid-picolcd_fb.c:159:9: note: The value 0 is assigned to 'i'
                           for (i = 0; i < 64; i++) {
                                ^~~~~
   drivers/hid/hid-picolcd_fb.c:159:4: note: Loop condition is true.  Entering 
loop body
                           for (i = 0; i < 64; i++) {
                           ^
   drivers/hid/hid-picolcd_fb.c:160:14: note: The left expression of the 
compound assignment is an uninitialized value. The computed value will also be 
garbage
                                   tdata[i] <<= 1;
                                   ~~~~~~~~ ^
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   4 warnings generated.
>> sound/soc/codecs/max98373-sdw.c:789:26: warning: Assigned value is garbage 
>> or undefined [clang-analyzer-core.uninitialized.Assign]
                   max98373->cache[i].reg = max98373_sdw_cache_reg[i];
                                          ^
   sound/soc/codecs/max98373-sdw.c:854:2: note: Taking false branch
           if (IS_ERR(regmap))
           ^
   sound/soc/codecs/max98373-sdw.c:857:9: note: Calling 'max98373_init'
           return max98373_init(slave, regmap);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/max98373-sdw.c:776:6: note: Assuming 'max98373' is non-null
           if (!max98373)
               ^~~~~~~~~
   sound/soc/codecs/max98373-sdw.c:776:2: note: Taking false branch
           if (!max98373)
           ^
   sound/soc/codecs/max98373-sdw.c:788:14: note: Assuming 'i' is < field 
'cache_num'
           for (i = 0; i < max98373->cache_num; i++)
                       ^~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/max98373-sdw.c:788:2: note: Loop condition is true.  
Entering loop body
           for (i = 0; i < max98373->cache_num; i++)
           ^
   sound/soc/codecs/max98373-sdw.c:788:14: note: Assuming 'i' is < field 
'cache_num'
           for (i = 0; i < max98373->cache_num; i++)
                       ^~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/max98373-sdw.c:788:2: note: Loop condition is true.  
Entering loop body
           for (i = 0; i < max98373->cache_num; i++)
           ^
   sound/soc/codecs/max98373-sdw.c:788:14: note: Assuming 'i' is < field 
'cache_num'
           for (i = 0; i < max98373->cache_num; i++)
                       ^~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/max98373-sdw.c:788:2: note: Loop condition is true.  
Entering loop body
           for (i = 0; i < max98373->cache_num; i++)
           ^
   sound/soc/codecs/max98373-sdw.c:788:39: note: The value 3 is assigned to 'i'
           for (i = 0; i < max98373->cache_num; i++)
                                                ^~~
   sound/soc/codecs/max98373-sdw.c:788:14: note: Assuming 'i' is < field 
'cache_num'
           for (i = 0; i < max98373->cache_num; i++)
                       ^~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/max98373-sdw.c:788:2: note: Loop condition is true.  
Entering loop body
           for (i = 0; i < max98373->cache_num; i++)
           ^
   sound/soc/codecs/max98373-sdw.c:789:26: note: Assigned value is garbage or 
undefined
                   max98373->cache[i].reg = max98373_sdw_cache_reg[i];
                                          ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   7 warnings generated.
   sound/soc/codecs/wm8903.c:434:3: warning: Value stored to 'best' is never 
read [clang-analyzer-deadcode.DeadStores]
                   best = 0;
                   ^      ~
   sound/soc/codecs/wm8903.c:434:3: note: Value stored to 'best' is never read
                   best = 0;
                   ^      ~
   sound/soc/codecs/wm8903.c:1552:2: warning: Value stored to 'best_val' is 
never read [clang-analyzer-deadcode.DeadStores]
           best_val = ((clk_sys * 10) / bclk_divs[0].ratio) - bclk;
           ^          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/wm8903.c:1552:2: note: Value stored to 'best_val' is never 
read
           best_val = ((clk_sys * 10) / bclk_divs[0].ratio) - bclk;
           ^          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/wm8903.c:1559:3: warning: Value stored to 'best_val' is 
never read [clang-analyzer-deadcode.DeadStores]
                   best_val = cur_val;
                   ^          ~~~~~~~
   sound/soc/codecs/wm8903.c:1559:3: note: Value stored to 'best_val' is never 
read
                   best_val = cur_val;
                   ^          ~~~~~~~
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   6 warnings generated.
   sound/soc/codecs/wm8960.c:508:18: warning: Access to field 'lout1' results 
in a dereference of a null pointer (loaded from variable 'wm8960') 
[clang-analyzer-core.NullDereference]
                           wm8960->lout1 = w;
                                         ^
   sound/soc/codecs/wm8960.c:1349:6: note: Assuming field 'capless' is false
           if (pdata->capless)
               ^~~~~~~~~~~~~~
   sound/soc/codecs/wm8960.c:1349:2: note: Taking false branch
           if (pdata->capless)
           ^
   sound/soc/codecs/wm8960.c:1356:2: note: Calling 'wm8960_add_widgets'
           wm8960_add_widgets(component);

vim +789 sound/soc/codecs/max98373-sdw.c

56a5b7910e965c Ryan Lee  2020-07-08  766  
56a5b7910e965c Ryan Lee  2020-07-08  767  static int max98373_init(struct 
sdw_slave *slave, struct regmap *regmap)
56a5b7910e965c Ryan Lee  2020-07-08  768  {
56a5b7910e965c Ryan Lee  2020-07-08  769        struct max98373_priv *max98373;
56a5b7910e965c Ryan Lee  2020-07-08  770        int ret;
349dd23931d194 Bard Liao 2020-12-17  771        int i;
56a5b7910e965c Ryan Lee  2020-07-08  772        struct device *dev = 
&slave->dev;
56a5b7910e965c Ryan Lee  2020-07-08  773  
56a5b7910e965c Ryan Lee  2020-07-08  774        /*  Allocate and assign private 
driver data structure  */
56a5b7910e965c Ryan Lee  2020-07-08  775        max98373 = devm_kzalloc(dev, 
sizeof(*max98373), GFP_KERNEL);
56a5b7910e965c Ryan Lee  2020-07-08  776        if (!max98373)
56a5b7910e965c Ryan Lee  2020-07-08  777                return -ENOMEM;
56a5b7910e965c Ryan Lee  2020-07-08  778  
56a5b7910e965c Ryan Lee  2020-07-08  779        dev_set_drvdata(dev, max98373);
56a5b7910e965c Ryan Lee  2020-07-08  780        max98373->regmap = regmap;
56a5b7910e965c Ryan Lee  2020-07-08  781        max98373->slave = slave;
56a5b7910e965c Ryan Lee  2020-07-08  782  
349dd23931d194 Bard Liao 2020-12-17  783        max98373->cache_num = 
ARRAY_SIZE(max98373_sdw_cache_reg);
349dd23931d194 Bard Liao 2020-12-17  784        max98373->cache = 
devm_kcalloc(dev, max98373->cache_num,
349dd23931d194 Bard Liao 2020-12-17  785                                       
sizeof(*max98373->cache),
349dd23931d194 Bard Liao 2020-12-17  786                                       
GFP_KERNEL);
349dd23931d194 Bard Liao 2020-12-17  787  
349dd23931d194 Bard Liao 2020-12-17  788        for (i = 0; i < 
max98373->cache_num; i++)
349dd23931d194 Bard Liao 2020-12-17 @789                max98373->cache[i].reg 
= max98373_sdw_cache_reg[i];
349dd23931d194 Bard Liao 2020-12-17  790  
56a5b7910e965c Ryan Lee  2020-07-08  791        /* Read voltage and slot 
configuration */
56a5b7910e965c Ryan Lee  2020-07-08  792        max98373_slot_config(dev, 
max98373);
56a5b7910e965c Ryan Lee  2020-07-08  793  
56a5b7910e965c Ryan Lee  2020-07-08  794        max98373->hw_init = false;
56a5b7910e965c Ryan Lee  2020-07-08  795        max98373->pm_init_once = false;
56a5b7910e965c Ryan Lee  2020-07-08  796  
56a5b7910e965c Ryan Lee  2020-07-08  797        /* codec registration  */
56a5b7910e965c Ryan Lee  2020-07-08  798        ret = 
devm_snd_soc_register_component(dev, &soc_codec_dev_max98373_sdw,
56a5b7910e965c Ryan Lee  2020-07-08  799                                        
      max98373_sdw_dai,
56a5b7910e965c Ryan Lee  2020-07-08  800                                        
      ARRAY_SIZE(max98373_sdw_dai));
56a5b7910e965c Ryan Lee  2020-07-08  801        if (ret < 0)
56a5b7910e965c Ryan Lee  2020-07-08  802                dev_err(dev, "Failed to 
register codec: %d\n", ret);
56a5b7910e965c Ryan Lee  2020-07-08  803  
56a5b7910e965c Ryan Lee  2020-07-08  804        return ret;
56a5b7910e965c Ryan Lee  2020-07-08  805  }
56a5b7910e965c Ryan Lee  2020-07-08  806  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to