All of lore.kernel.org
 help / color / mirror / Atom feed
* sound/soc/codecs/max98373-sdw.c:789:26: warning: Assigned value is garbage or undefined [clang-analyzer-core.uninitialized.Assign]
@ 2021-12-01 14:05 kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2021-12-01 14:05 UTC (permalink / raw)
  To: kbuild

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

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Bard Liao <yung-chuan.liao@linux.intel.com>
CC: Mark Brown <broonie@kernel.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   58e1100fdc5990b0cc0d4beaf2562a92e621ac7d
commit: 349dd23931d1943b1083182e35715eba8b150fe1 ASoC: max98373: don't access volatile registers in bias level off
date:   12 months ago
:::::: branch date: 17 hours ago
:::::: commit date: 12 months ago
config: riscv-randconfig-c006-20211118 (https://download.01.org/0day-ci/archive/20211201/202112012111.HwiCDMP2-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c46becf500df2a7fb4b4fce16178a036c344315a)
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 riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # 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 config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
   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.
   Suppressed 6 warnings (6 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.
   Suppressed 6 warnings (6 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.
   Suppressed 6 warnings (6 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.
   Suppressed 7 warnings (7 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.
   Suppressed 7 warnings (7 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.
   Suppressed 6 warnings (6 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.
   5 warnings generated.
   Suppressed 5 warnings (5 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.
   Suppressed 6 warnings (6 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.
   Suppressed 6 warnings (6 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.
   Suppressed 6 warnings (6 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.
   Suppressed 7 warnings (7 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.
   2 warnings generated.
   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.
   2 warnings generated.
   Suppressed 2 warnings (2 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.
   12 warnings generated.
   lib/zstd/decompress.c:1557:4: warning: Value stored to 'remainingSize' is never read [clang-analyzer-deadcode.DeadStores]
                           remainingSize -= 4;
                           ^                ~
   lib/zstd/decompress.c:1557:4: note: Value stored to 'remainingSize' is never read
                           remainingSize -= 4;
                           ^                ~
   Suppressed 11 warnings (6 in non-user code, 5 with check filters).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   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.
   6 warnings generated.
   Suppressed 6 warnings (6 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.
   Suppressed 6 warnings (6 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.
   fs/hpfs/ea.c:260:3: warning: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
                   strcpy(ea->name, key);
                   ^~~~~~
   fs/hpfs/ea.c:260:3: note: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119
                   strcpy(ea->name, key);
                   ^~~~~~
   Suppressed 5 warnings (5 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.
   5 warnings generated.
   Suppressed 5 warnings (5 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.
   5 warnings generated.
   Suppressed 5 warnings (5 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.
   Suppressed 7 warnings (7 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.
   18 warnings generated.
   kernel/sched/core.c:4243:16: warning: Value stored to 'preempt_disable_ip' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           unsigned long preempt_disable_ip = get_preempt_disable_ip(current);
                         ^~~~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/sched/core.c:4243:16: note: Value stored to 'preempt_disable_ip' during its initialization is never read
           unsigned long preempt_disable_ip = get_preempt_disable_ip(current);
                         ^~~~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/sched/core.c:7096:3: warning: Value stored to 'ptr' is never read [clang-analyzer-deadcode.DeadStores]
                   ptr += nr_cpu_ids * sizeof(void **);
                   ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/sched/core.c:7096:3: note: Value stored to 'ptr' is never read
                   ptr += nr_cpu_ids * sizeof(void **);
                   ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 16 warnings (14 in non-user code, 2 with check filters).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   13 warnings generated.
   Suppressed 13 warnings (13 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.
   13 warnings generated.
   Suppressed 13 warnings (13 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/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 6 warnings (6 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.
   Suppressed 7 warnings (7 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.
   Suppressed 7 warnings (7 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.
   11 warnings generated.
   drivers/fsi/fsi-core.c:719:4: warning: Value stored to 'rc' is never read [clang-analyzer-deadcode.DeadStores]
                           rc = -EFAULT;
                           ^    ~~~~~~~
   drivers/fsi/fsi-core.c:719:4: note: Value stored to 'rc' is never read
                           rc = -EFAULT;
                           ^    ~~~~~~~
   drivers/fsi/fsi-core.c:724:2: warning: Value stored to 'rc' is never read [clang-analyzer-deadcode.DeadStores]
           rc = count;
           ^    ~~~~~
   drivers/fsi/fsi-core.c:724:2: note: Value stored to 'rc' is never read
           rc = count;
           ^    ~~~~~
   drivers/fsi/fsi-core.c:753:4: warning: Value stored to 'rc' is never read [clang-analyzer-deadcode.DeadStores]
                           rc = -EFAULT;
                           ^    ~~~~~~~
   drivers/fsi/fsi-core.c:753:4: note: Value stored to 'rc' is never read
                           rc = -EFAULT;
                           ^    ~~~~~~~
   drivers/fsi/fsi-core.c:761:2: warning: Value stored to 'rc' is never read [clang-analyzer-deadcode.DeadStores]
           rc = count;
           ^    ~~~~~
   drivers/fsi/fsi-core.c:761:2: note: Value stored to 'rc' is never read
           rc = count;
           ^    ~~~~~
   Suppressed 7 warnings (7 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.
   Suppressed 7 warnings (7 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.
   Suppressed 6 warnings (6 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.
   Suppressed 6 warnings (6 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.
   5 warnings generated.
   Suppressed 5 warnings (5 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.
   Suppressed 6 warnings (6 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.
   Suppressed 6 warnings (6 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.
   5 warnings generated.
   Suppressed 5 warnings (5 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.
--
                               ^~~
   Suppressed 5 warnings (5 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.
   Suppressed 6 warnings (6 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.
   Suppressed 7 warnings (7 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.
   Suppressed 7 warnings (7 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   Suppressed 7 warnings (7 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.
   Suppressed 7 warnings (7 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.
   Suppressed 6 warnings (6 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   Suppressed 7 warnings (7 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.
   Suppressed 7 warnings (7 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.
   Suppressed 7 warnings (7 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.
   Suppressed 7 warnings (7 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.
   Suppressed 7 warnings (7 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.
   Suppressed 7 warnings (7 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.
   8 warnings generated.
   drivers/hwmon/adm9240.c:157:2: warning: Value stored to 'old' is never read [clang-analyzer-deadcode.DeadStores]
           old = (reg >> shift) & 3;
           ^     ~~~~~~~~~~~~~~~~~~
   drivers/hwmon/adm9240.c:157:2: note: Value stored to 'old' is never read
           old = (reg >> shift) & 3;
           ^     ~~~~~~~~~~~~~~~~~~
   drivers/hwmon/adm9240.c:510:21: warning: Value stored to 'client' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct i2c_client *client = data->client;
                              ^~~~~~   ~~~~~~~~~~~~
   drivers/hwmon/adm9240.c:510:21: note: Value stored to 'client' during its initialization is never read
           struct i2c_client *client = data->client;
                              ^~~~~~   ~~~~~~~~~~~~
   Suppressed 6 warnings (6 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.
   8 warnings generated.
   Suppressed 8 warnings (7 in non-user code, 1 with check filters).
   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.
   Suppressed 6 warnings (6 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   Suppressed 6 warnings (6 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.
   Suppressed 7 warnings (7 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.
   Suppressed 6 warnings (6 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.
   Suppressed 7 warnings (7 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.
   Suppressed 6 warnings (6 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   Suppressed 7 warnings (7 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.
   Suppressed 6 warnings (6 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.
   Suppressed 7 warnings (7 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.
   Suppressed 6 warnings (6 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/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 6 warnings (6 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.
   Suppressed 7 warnings (7 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.
   Suppressed 7 warnings (7 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.
   Suppressed 7 warnings (7 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.
   Suppressed 7 warnings (7 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.
   5 warnings generated.
   Suppressed 5 warnings (5 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.
   Suppressed 7 warnings (7 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.
   8 warnings generated.
   fs/hfsplus/bnode.c:328:4: warning: Value stored to 'tmp' is never read [clang-analyzer-deadcode.DeadStores]
                           tmp = hfs_bnode_read_u16(node, key_off);
                           ^
   fs/hfsplus/bnode.c:328:4: note: Value stored to 'tmp' is never read
   Suppressed 7 warnings (7 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.
   5 warnings generated.
   Suppressed 5 warnings (5 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.
   8 warnings generated.
   fs/hfsplus/bfind.c:73:3: warning: Value stored to 'cur_cnid' is never read [clang-analyzer-deadcode.DeadStores]
                   cur_cnid = 0;   /* used-uninitialized warning */
                   ^          ~
   fs/hfsplus/bfind.c:73:3: note: Value stored to 'cur_cnid' is never read
                   cur_cnid = 0;   /* used-uninitialized warning */
                   ^          ~
   fs/hfsplus/bfind.c:74:3: warning: Value stored to 'search_cnid' is never read [clang-analyzer-deadcode.DeadStores]
                   search_cnid = 0;
                   ^             ~
   fs/hfsplus/bfind.c:74:3: note: Value stored to 'search_cnid' is never read
                   search_cnid = 0;
                   ^             ~
   fs/hfsplus/bfind.c:180:2: warning: Value stored to 'res' is never read [clang-analyzer-deadcode.DeadStores]
           res = 0;
           ^     ~
   fs/hfsplus/bfind.c:180:2: note: Value stored to 'res' is never read
           res = 0;
           ^     ~
   Suppressed 5 warnings (5 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.
   Suppressed 6 warnings (6 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.
   Suppressed 6 warnings (6 in non-user code).

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/kbuild-all@lists.01.org

^ permalink raw reply	[flat|nested] 4+ messages in thread

* sound/soc/codecs/max98373-sdw.c:789:26: warning: Assigned value is garbage or undefined [clang-analyzer-core.uninitialized.Assign]
@ 2021-11-28 12:59 kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2021-11-28 12:59 UTC (permalink / raw)
  To: kbuild

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

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Bard Liao <yung-chuan.liao@linux.intel.com>
CC: Mark Brown <broonie@kernel.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   3498e7f2bb415e447354a3debef6738d9655768c
commit: 349dd23931d1943b1083182e35715eba8b150fe1 ASoC: max98373: don't access volatile registers in bias level off
date:   12 months ago
:::::: branch date: 14 hours ago
:::::: commit date: 12 months ago
config: riscv-randconfig-c006-20211118 (https://download.01.org/0day-ci/archive/20211128/202111282034.Bijgdank-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c46becf500df2a7fb4b4fce16178a036c344315a)
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 riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # 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 config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
   temp_fixed_num, 
   pwm_num, 
   target_temp_mask, 
   speed_tolerance_limit, 
   tolerance_mask, 
   vid, 
   vrm, 
   have_vid, 
   vbat, 
   fandiv1, 
   fandiv2, 
   sio_reg_enable, 
   temp_type, 
   temp_offset, 
   fan_pulses, 
   fan_div, 
   pwm_mode, 
   target_temp, 
   pwm_temp_sel, 
   pwm_weight_temp_sel, 
   temp_src, 
   temp_tolerance, 
   fan_time, 
   weight_temp, 
   in, 
   pwm, 
   auto_pwm, 
   auto_temp, 
   consider reordering the fields or adding explicit padding members [clang-analyzer-optin.performance.Padding]
   struct nct6775_data {
   ~~~~~~~^~~~~~~~~~~~~~
   drivers/hwmon/nct6775.c:1069:8: note: Excessive padding in 'struct nct6775_data' (35 padding bytes, where 3 is optimal). Optimal fields order: name, temp_label, ALARM_BITS, BEEP_BITS, REG_VIN, REG_TARGET, REG_FAN, REG_FAN_MODE, REG_FAN_MIN, REG_FAN_PULSES, FAN_PULSE_SHIFT, REG_TOLERANCE_H, REG_PWM_MODE, PWM_MODE_MASK, REG_PWM_READ, REG_CRITICAL_PWM_ENABLE, REG_CRITICAL_PWM, REG_AUTO_TEMP, REG_AUTO_PWM, REG_CRITICAL_TEMP, REG_CRITICAL_TEMP_TOLERANCE, REG_TEMP_SOURCE, REG_TEMP_SEL, REG_WEIGHT_TEMP_SEL, REG_TEMP_OFFSET, REG_ALARM, REG_BEEP, fan_from_reg, fan_from_reg_min, last_updated, alarms, beeps, REG_IN_MINMAX, REG_FAN_TIME, REG_WEIGHT_TEMP, groups, REG_PWM, update_lock, addr, sioreg, kind, temp_mask, virt_temp_mask, auto_pwm_num, rpm, pwm_enable, target_speed, target_speed_tolerance, REG_CONFIG, REG_VBAT, REG_DIODE, have_temp, have_temp_fixed, have_in, fan_min, reg_temp_config, reg_temp, temp, DIODE_MASK, CRITICAL_PWM_ENABLE_MASK, valid, bank, in_num, has_pwm, has_fan, has_fan_min, has_fan_div, num_temp_alarms, num_temp_beeps, temp_fixed_num, pwm_num, target_temp_mask, speed_tolerance_limit, tolerance_mask, vid, vrm, have_vid, vbat, fandiv1, fandiv2, sio_reg_enable, temp_type, temp_offset, fan_pulses, fan_div, pwm_mode, target_temp, pwm_temp_sel, pwm_weight_temp_sel, temp_src, temp_tolerance, fan_time, weight_temp, in, pwm, auto_pwm, auto_temp, consider reordering the fields or adding explicit padding members
   struct nct6775_data {
   ~~~~~~~^~~~~~~~~~~~~~
   Suppressed 6 warnings (6 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.
   drivers/usb/mon/mon_bin.c:848:3: warning: Value stored to 'nbytes' is never read [clang-analyzer-deadcode.DeadStores]
                   nbytes -= step_len;
                   ^         ~~~~~~~~
   drivers/usb/mon/mon_bin.c:848:3: note: Value stored to 'nbytes' is never read
                   nbytes -= step_len;
                   ^         ~~~~~~~~
   drivers/usb/mon/mon_bin.c:849:3: warning: Value stored to 'buf' is never read [clang-analyzer-deadcode.DeadStores]
                   buf += step_len;
                   ^      ~~~~~~~~
   drivers/usb/mon/mon_bin.c:849:3: note: Value stored to 'buf' is never read
                   buf += step_len;
                   ^      ~~~~~~~~
   Suppressed 5 warnings (5 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.
   Suppressed 7 warnings (7 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.
   Suppressed 6 warnings (6 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.
   Suppressed 7 warnings (7 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.
   Suppressed 6 warnings (6 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.
   Suppressed 6 warnings (6 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/bcm/bcm63xx-pcm-whistler.c:281:31: warning: The left operand of '+' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
                   prtd->dma_addr_next = val_1 + val_2;
                                         ~~~~~ ^
   sound/soc/bcm/bcm63xx-pcm-whistler.c:252:59: note: 'val_1' declared without an initial value
           unsigned int availdepth, ifflevel, offlevel, int_status, val_1, val_2;
                                                                    ^~~~~
   sound/soc/bcm/bcm63xx-pcm-whistler.c:267:6: note: Assuming the condition is true
           if (int_status & I2S_RX_DESC_OFF_INTR_EN_MSK) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/bcm/bcm63xx-pcm-whistler.c:267:2: note: Taking true branch
           if (int_status & I2S_RX_DESC_OFF_INTR_EN_MSK) {
           ^
   sound/soc/bcm/bcm63xx-pcm-whistler.c:276:3: note: Loop condition is false. Execution continues on line 281
                   while (offlevel) {
                   ^
   sound/soc/bcm/bcm63xx-pcm-whistler.c:281:31: note: The left operand of '+' is a garbage value
                   prtd->dma_addr_next = val_1 + val_2;
                                         ~~~~~ ^
   Suppressed 6 warnings (6 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.
   9 warnings generated.
   Suppressed 9 warnings (6 in non-user code, 3 with check filters).
   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.
   Suppressed 7 warnings (7 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.
   Suppressed 6 warnings (6 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.
   Suppressed 6 warnings (6 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/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 6 warnings (6 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.
   Suppressed 7 warnings (7 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.
   Suppressed 7 warnings (7 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.
   Suppressed 7 warnings (7 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.
   Suppressed 7 warnings (7 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.
   Suppressed 6 warnings (6 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.
   Suppressed 6 warnings (6 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.
   drivers/usb/gadget/function/uvc_configfs.c:2042:30: warning: Value stored to 'u' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
                           struct uvcg_uncompressed *u =
                                                     ^
   drivers/usb/gadget/function/uvc_configfs.c:2042:30: note: Value stored to 'u' during its initialization is never read
                           struct uvcg_uncompressed *u =
                                                     ^
   drivers/usb/gadget/function/uvc_configfs.c:2048:23: warning: Value stored to 'm' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
                           struct uvcg_mjpeg *m =
                                              ^
   drivers/usb/gadget/function/uvc_configfs.c:2048:23: note: Value stored to 'm' during its initialization is never read
                           struct uvcg_mjpeg *m =
                                              ^
   Suppressed 5 warnings (5 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.
   14 warnings generated.
   drivers/usb/gadget/function/f_midi.c:420:28: warning: Value stored to 'cdev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct usb_composite_dev *cdev = f->config->cdev;
                                     ^~~~   ~~~~~~~~~~~~~~~
   drivers/usb/gadget/function/f_midi.c:420:28: note: Value stored to 'cdev' during its initialization is never read
           struct usb_composite_dev *cdev = f->config->cdev;
                                     ^~~~   ~~~~~~~~~~~~~~~
   drivers/usb/gadget/function/f_midi.c:724:17: warning: Value stored to 'midi' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct f_midi *midi = substream->rmidi->private_data;
                          ^~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/function/f_midi.c:724:17: note: Value stored to 'midi' during its initialization is never read
           struct f_midi *midi = substream->rmidi->private_data;
                          ^~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/function/f_midi.c:757:17: warning: Value stored to 'midi' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct f_midi *midi = substream->rmidi->private_data;
                          ^~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/function/f_midi.c:757:17: note: Value stored to 'midi' during its initialization is never read
           struct f_midi *midi = substream->rmidi->private_data;
                          ^~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/function/f_midi.c:819:2: warning: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
           strcpy(card->driver, f_midi_longname);
--
                      ^
   include/linux/list.h:522:2: note: expanded from macro 'list_first_entry'
           list_entry((ptr)->next, type, member)
           ^
   include/linux/list.h:511:2: note: expanded from macro 'list_entry'
           container_of(ptr, type, member)
           ^
   note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/compiler_types.h:319:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:307:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:297:2: note: expanded from macro '__compiletime_assert'
           do {                                                            \
           ^
   drivers/soundwire/stream.c:1011:2: note: Loop condition is true.  Entering loop body
           list_for_each_entry(m_rt, &stream->master_list, stream_node) {
           ^
   include/linux/list.h:628:2: note: expanded from macro 'list_for_each_entry'
           for (pos = list_first_entry(head, typeof(*pos), member);        \
           ^
   drivers/soundwire/stream.c:1012:3: note: Left side of '&&' is false
                   list_for_each_entry(s_rt, &m_rt->slave_rt_list, m_rt_node) {
                   ^
   include/linux/list.h:628:13: note: expanded from macro 'list_for_each_entry'
           for (pos = list_first_entry(head, typeof(*pos), member);        \
                      ^
   include/linux/list.h:522:2: note: expanded from macro 'list_first_entry'
           list_entry((ptr)->next, type, member)
           ^
   include/linux/list.h:511:2: note: expanded from macro 'list_entry'
           container_of(ptr, type, member)
           ^
   include/linux/kernel.h:853:61: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
                                                                      ^
   drivers/soundwire/stream.c:1012:3: note: Taking false branch
                   list_for_each_entry(s_rt, &m_rt->slave_rt_list, m_rt_node) {
                   ^
   include/linux/list.h:628:13: note: expanded from macro 'list_for_each_entry'
           for (pos = list_first_entry(head, typeof(*pos), member);        \
                      ^
   include/linux/list.h:522:2: note: expanded from macro 'list_first_entry'
           list_entry((ptr)->next, type, member)
           ^
   include/linux/list.h:511:2: note: expanded from macro 'list_entry'
           container_of(ptr, type, member)
           ^
   note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/compiler_types.h:319:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:307:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:299:3: note: expanded from macro '__compiletime_assert'
                   if (!(condition))                                       \
                   ^
   drivers/soundwire/stream.c:1012:3: note: Loop condition is false.  Exiting loop
                   list_for_each_entry(s_rt, &m_rt->slave_rt_list, m_rt_node) {
                   ^
   include/linux/list.h:628:13: note: expanded from macro 'list_for_each_entry'
           for (pos = list_first_entry(head, typeof(*pos), member);        \
                      ^
   include/linux/list.h:522:2: note: expanded from macro 'list_first_entry'
           list_entry((ptr)->next, type, member)
           ^
   include/linux/list.h:511:2: note: expanded from macro 'list_entry'
           container_of(ptr, type, member)
           ^
   note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/compiler_types.h:319:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:307:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:297:2: note: expanded from macro '__compiletime_assert'
           do {                                                            \
           ^
   drivers/soundwire/stream.c:1012:3: note: Loop condition is true.  Entering loop body
                   list_for_each_entry(s_rt, &m_rt->slave_rt_list, m_rt_node) {
                   ^
   include/linux/list.h:628:2: note: expanded from macro 'list_for_each_entry'
           for (pos = list_first_entry(head, typeof(*pos), member);        \
           ^
   drivers/soundwire/stream.c:1013:8: note: Use of memory after it is freed
                           if (s_rt->slave != slave)
                               ^~~~~~~~~~~
   Suppressed 6 warnings (6 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.
   5 warnings generated.
   Suppressed 5 warnings (5 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.
   Suppressed 6 warnings (6 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/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 6 warnings (6 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.
   Suppressed 7 warnings (7 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.
   Suppressed 7 warnings (7 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.
   Suppressed 7 warnings (7 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.
   10 warnings generated.
   drivers/most/configfs.c:173:2: warning: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
           strcpy(mdev_link->direction, page);
           ^~~~~~
   drivers/most/configfs.c:173:2: note: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119
           strcpy(mdev_link->direction, page);
           ^~~~~~
   drivers/most/configfs.c:192:2: warning: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
           strcpy(mdev_link->datatype, page);
           ^~~~~~
   drivers/most/configfs.c:192:2: note: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119
           strcpy(mdev_link->datatype, page);
           ^~~~~~
   drivers/most/configfs.c:446:2: warning: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
           strcpy(mdev_link->name, name);
           ^~~~~~
   drivers/most/configfs.c:446:2: note: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119
           strcpy(mdev_link->name, name);
           ^~~~~~
   drivers/most/configfs.c:535:2: warning: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
           strcpy(mdev_link->name, name);
           ^~~~~~
   drivers/most/configfs.c:535:2: note: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119
           strcpy(mdev_link->name, name);
           ^~~~~~
   Suppressed 6 warnings (6 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.
   Suppressed 6 warnings (6 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.
   Suppressed 6 warnings (6 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.
   Suppressed 6 warnings (6 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.
   Suppressed 6 warnings (6 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.
   Suppressed 7 warnings (7 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.
   Suppressed 6 warnings (6 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.

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/kbuild-all@lists.01.org

^ permalink raw reply	[flat|nested] 4+ messages in thread

* sound/soc/codecs/max98373-sdw.c:789:26: warning: Assigned value is garbage or undefined [clang-analyzer-core.uninitialized.Assign]
@ 2021-08-22 20:14 kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2021-08-22 20:14 UTC (permalink / raw)
  To: kbuild

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

CC: clang-built-linux(a)googlegroups.com
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Bard Liao <yung-chuan.liao@linux.intel.com>
CC: Mark Brown <broonie@kernel.org>

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 <lkp@intel.com>


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/kbuild-all@lists.01.org

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* sound/soc/codecs/max98373-sdw.c:789:26: warning: Assigned value is garbage or undefined [clang-analyzer-core.uninitialized.Assign]
@ 2021-08-18  2:09 kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2021-08-18  2:09 UTC (permalink / raw)
  To: kbuild

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

CC: clang-built-linux(a)googlegroups.com
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Bard Liao <yung-chuan.liao@linux.intel.com>
CC: Mark Brown <broonie@kernel.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   614cb2751d3150850d459bee596c397f344a7936
commit: 349dd23931d1943b1083182e35715eba8b150fe1 ASoC: max98373: don't access volatile registers in bias level off
date:   8 months ago
:::::: branch date: 6 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 <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/bus/mhi/core/boot.c:140:2: note: Value stored to 'ret' is never read
           ret = mhi_read_reg(mhi_cntrl, base, BHIE_RXVECSTATUS_OFFS, &rx_status);
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/bus/mhi/core/boot.c:153:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct device *dev = &mhi_cntrl->mhi_dev->dev;
                          ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/bus/mhi/core/boot.c:153:17: note: Value stored to 'dev' during its initialization is never read
           struct device *dev = &mhi_cntrl->mhi_dev->dev;
                          ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/bus/mhi/core/boot.c:178:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct device *dev = &mhi_cntrl->mhi_dev->dev;
                          ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/bus/mhi/core/boot.c:178:17: note: Value stored to 'dev' during its initialization is never read
           struct device *dev = &mhi_cntrl->mhi_dev->dev;
                          ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~
   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.
   3 warnings generated.
   drivers/base/regmap/regcache.c:137:7: warning: Dereference of null pointer [clang-analyzer-core.NullDereference]
                   if (config->reg_defaults[i].reg % map->reg_stride)
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/base/regmap/regcache.c:121:6: note: Assuming field 'cache_type' is not equal to REGCACHE_NONE
           if (map->cache_type == REGCACHE_NONE) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/base/regmap/regcache.c:121:2: note: Taking false branch
           if (map->cache_type == REGCACHE_NONE) {
           ^
   drivers/base/regmap/regcache.c:130:6: note: Assuming field 'reg_defaults' is null
           if (config->reg_defaults && !config->num_reg_defaults) {
               ^~~~~~~~~~~~~~~~~~~~
   drivers/base/regmap/regcache.c:130:27: note: Left side of '&&' is false
           if (config->reg_defaults && !config->num_reg_defaults) {
                                    ^
   drivers/base/regmap/regcache.c:136:14: note: Assuming 'i' is < field 'num_reg_defaults'
           for (i = 0; i < config->num_reg_defaults; i++)
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/base/regmap/regcache.c:136:2: note: Loop condition is true.  Entering loop body
           for (i = 0; i < config->num_reg_defaults; i++)
           ^
   drivers/base/regmap/regcache.c:137:7: note: Dereference of null pointer
                   if (config->reg_defaults[i].reg % map->reg_stride)
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 2 warnings (2 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.
   2 warnings generated.
   Suppressed 2 warnings (2 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.
   2 warnings generated.
   Suppressed 2 warnings (2 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 (2 in non-user code, 1 with check filters).
   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.
   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.
   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.
   2 warnings generated.
   Suppressed 2 warnings (2 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.
   2 warnings generated.
   Suppressed 2 warnings (2 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.
   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.
>> 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.
   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.
   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.
   2 warnings generated.
   Suppressed 2 warnings (2 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.
   2 warnings generated.
   Suppressed 2 warnings (2 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.
   drivers/rpmsg/qcom_glink_native.c:432:2: warning: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
           strcpy(req.name, channel->name);
           ^~~~~~
   drivers/rpmsg/qcom_glink_native.c:432:2: note: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119
           strcpy(req.name, channel->name);
           ^~~~~~
   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 (3 in non-user code, 1 with check filters).
   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.
   drivers/soundwire/qcom.c:773:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
           ret = of_property_read_u8_array(np, "qcom,ports-block-pack-mode",
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/soundwire/qcom.c:773:2: note: Value stored to 'ret' is never read
           ret = of_property_read_u8_array(np, "qcom,ports-block-pack-mode",
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   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.
   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.

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/kbuild-all@lists.01.org

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-12-01 14:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-01 14:05 sound/soc/codecs/max98373-sdw.c:789:26: warning: Assigned value is garbage or undefined [clang-analyzer-core.uninitialized.Assign] kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2021-11-28 12:59 kernel test robot
2021-08-22 20:14 kernel test robot
2021-08-18  2:09 kernel test robot

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.