All of lore.kernel.org
 help / color / mirror / Atom feed
* sound/soc/codecs/ak4375.c:343:3: warning: Value stored to 'mclk' is never read [clang-analyzer-deadcode.DeadStores]
@ 2022-01-15 15:02 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2022-01-15 15:02 UTC (permalink / raw)
  To: kbuild

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

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Vincent Knecht <vincent.knecht@mailoo.org>
CC: Mark Brown <broonie@kernel.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   a33f5c380c4bd3fa5278d690421b72052456d9fe
commit: 53778b8292b5492ec3ecf1efb84163eac2a6e422 ASoC: Add AK4375 support
date:   4 weeks ago
:::::: branch date: 9 hours ago
:::::: commit date: 4 weeks ago
config: arm-randconfig-c002-20220111 (https://download.01.org/0day-ci/archive/20220115/202201152210.0zTOGFme-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 244dd2913a43a200f5a6544d424cdc37b771028b)
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=53778b8292b5492ec3ecf1efb84163eac2a6e422
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 53778b8292b5492ec3ecf1efb84163eac2a6e422
        # save the config file 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 >>)
                   ^
   include/asm-generic/bug.h:123:3: note: expanded from macro 'WARN_ON'
                   __WARN();                                               \
                   ^
   include/asm-generic/bug.h:88:19: note: expanded from macro '__WARN'
   #define __WARN()                __WARN_printf(TAINT_WARN, NULL)
                                   ^
   include/asm-generic/bug.h:90:3: note: expanded from macro '__WARN_printf'
                   instrumentation_begin();                                \
                   ^
   include/linux/instrumentation.h:57:34: note: expanded from macro 'instrumentation_begin'
   # define instrumentation_begin()        do { } while(0)
                                           ^
   fs/btrfs/disk-io.c:2178:3: note: Loop condition is false.  Exiting loop
                   WARN_ON(test_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state));
                   ^
   include/asm-generic/bug.h:123:3: note: expanded from macro 'WARN_ON'
                   __WARN();                                               \
                   ^
   include/asm-generic/bug.h:88:19: note: expanded from macro '__WARN'
   #define __WARN()                __WARN_printf(TAINT_WARN, NULL)
                                   ^
   include/asm-generic/bug.h:92:3: note: expanded from macro '__WARN_printf'
                   instrumentation_end();                                  \
                   ^
   include/linux/instrumentation.h:58:33: note: expanded from macro 'instrumentation_end'
   # define instrumentation_end()          do { } while(0)
                                           ^
   fs/btrfs/disk-io.c:2178:3: note: Loop condition is false.  Exiting loop
                   WARN_ON(test_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state));
                   ^
   include/asm-generic/bug.h:123:3: note: expanded from macro 'WARN_ON'
                   __WARN();                                               \
                   ^
   include/asm-generic/bug.h:88:19: note: expanded from macro '__WARN'
   #define __WARN()                __WARN_printf(TAINT_WARN, NULL)
                                   ^
   include/asm-generic/bug.h:89:38: note: expanded from macro '__WARN_printf'
   #define __WARN_printf(taint, arg...) do {                               \
                                        ^
   fs/btrfs/disk-io.c:2179:7: note: Assuming field 'anon_dev' is 0
                   if (root->anon_dev)
                       ^~~~~~~~~~~~~~
   fs/btrfs/disk-io.c:2179:3: note: Taking false branch
                   if (root->anon_dev)
                   ^
   fs/btrfs/disk-io.c:2188:3: note: Memory is released
                   kfree(root);
                   ^~~~~~~~~~~
   fs/btrfs/disk-io.c:2205:3: note: Returning; memory was released
                   btrfs_put_root(gang[0]);
                   ^~~~~~~~~~~~~~~~~~~~~~~
   fs/btrfs/disk-io.c:2198:2: note: Loop condition is true.  Entering loop body
           while (!list_empty(&fs_info->dead_roots)) {
           ^
   fs/btrfs/disk-io.c:2201:3: note: Calling 'list_del'
                   list_del(&gang[0]->root_list);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/list.h:149:14: note: Use of memory after it is freed
           entry->next = LIST_POISON1;
           ~~~~~~~~~~~ ^
   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.
   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.
   4 warnings generated.
   drivers/media/i2c/rj54n1cb0c.c:687:3: warning: Value stored to 'input_w' is never read [clang-analyzer-deadcode.DeadStores]
                   input_w = output_w;
                   ^         ~~~~~~~~
   drivers/media/i2c/rj54n1cb0c.c:687:3: note: Value stored to 'input_w' is never read
                   input_w = output_w;
                   ^         ~~~~~~~~
   drivers/media/i2c/rj54n1cb0c.c:688:3: warning: Value stored to 'input_h' is never read [clang-analyzer-deadcode.DeadStores]
                   input_h = output_h;
                   ^         ~~~~~~~~
   drivers/media/i2c/rj54n1cb0c.c:688:3: note: Value stored to 'input_h' is never read
                   input_h = output_h;
                   ^         ~~~~~~~~
   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.
   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.
   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.
   4 warnings generated.
>> sound/soc/codecs/ak4375.c:343:3: warning: Value stored to 'mclk' is never read [clang-analyzer-deadcode.DeadStores]
                   mclk = 128 * ak4375->rate;
                   ^      ~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/ak4375.c:343:3: note: Value stored to 'mclk' is never read
                   mclk = 128 * ak4375->rate;
                   ^      ~~~~~~~~~~~~~~~~~~
   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.
   sound/soc/codecs/alc5623.c:700:23: warning: Value stored to 'alc5623' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct alc5623_priv *alc5623 = snd_soc_component_get_drvdata(component);
                                ^~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/alc5623.c:700:23: note: Value stored to 'alc5623' during its initialization is never read
           struct alc5623_priv *alc5623 = snd_soc_component_get_drvdata(component);
                                ^~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   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.
   4 warnings generated.
   sound/soc/codecs/lpass-tx-macro.c:771:4: warning: 2nd function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
                           snd_soc_component_write_field(component, mic_sel_reg,
                           ^                                        ~~~~~~~~~~~
   sound/soc/codecs/lpass-tx-macro.c:736:2: note: 'mic_sel_reg' declared without an initial value
           u16 mic_sel_reg;
           ^~~~~~~~~~~~~~~
   sound/soc/codecs/lpass-tx-macro.c:742:2: note: 'Default' branch taken. Execution continues on line 769
           switch (e->reg) {
           ^
   sound/soc/codecs/lpass-tx-macro.c:769:6: note: Assuming 'val' is not equal to 0
           if (val != 0) {
               ^~~~~~~~
   sound/soc/codecs/lpass-tx-macro.c:769:2: note: Taking true branch
           if (val != 0) {
           ^
   sound/soc/codecs/lpass-tx-macro.c:770:7: note: Assuming 'val' is < 5
                   if (val < 5) {
                       ^~~~~~~
   sound/soc/codecs/lpass-tx-macro.c:770:3: note: Taking true branch
                   if (val < 5) {
                   ^
   sound/soc/codecs/lpass-tx-macro.c:771:4: note: 2nd function call argument is an uninitialized value
                           snd_soc_component_write_field(component, mic_sel_reg,
                           ^                                        ~~~~~~~~~~~
   sound/soc/codecs/lpass-tx-macro.c:774:4: warning: 2nd function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
                           snd_soc_component_write_field(component, mic_sel_reg,
                           ^                                        ~~~~~~~~~~~
   sound/soc/codecs/lpass-tx-macro.c:736:2: note: 'mic_sel_reg' declared without an initial value
           u16 mic_sel_reg;
           ^~~~~~~~~~~~~~~
   sound/soc/codecs/lpass-tx-macro.c:742:2: note: 'Default' branch taken. Execution continues on line 769
           switch (e->reg) {
           ^
   sound/soc/codecs/lpass-tx-macro.c:769:6: note: Assuming 'val' is not equal to 0
           if (val != 0) {
               ^~~~~~~~
   sound/soc/codecs/lpass-tx-macro.c:769:2: note: Taking true branch
           if (val != 0) {
           ^
   sound/soc/codecs/lpass-tx-macro.c:770:7: note: Assuming 'val' is >= 5
                   if (val < 5) {
                       ^~~~~~~
   sound/soc/codecs/lpass-tx-macro.c:770:3: note: Taking false branch
                   if (val < 5) {
                   ^
   sound/soc/codecs/lpass-tx-macro.c:774:4: note: 2nd function call argument is an uninitialized value
                           snd_soc_component_write_field(component, mic_sel_reg,
                           ^                                        ~~~~~~~~~~~
   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.
   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.
   4 warnings generated.
   sound/isa/gus/gus_mem.c:84:21: warning: Access to field 'prev' results in a dereference of a null pointer (loaded from field 'next') [clang-analyzer-core.NullDereference]
                   block->next->prev = block->prev;
                                     ^
   sound/isa/gus/gus_mem.c:261:2: note: Loop condition is true.  Entering loop body
           while (block) {
           ^
   sound/isa/gus/gus_mem.c:263:3: note: Calling 'snd_gf1_mem_xfree'
                   snd_gf1_mem_xfree(alloc, block);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/isa/gus/gus_mem.c:65:6: note: Assuming field 'share' is 0
           if (block->share) {     /* ok.. shared block */
               ^~~~~~~~~~~~
   sound/isa/gus/gus_mem.c:65:2: note: Taking false branch
           if (block->share) {     /* ok.. shared block */
           ^
   sound/isa/gus/gus_mem.c:70:22: note: 'block' is equal to field 'first'
           if (alloc->first == block) {
                               ^~~~~
   sound/isa/gus/gus_mem.c:70:2: note: Taking true branch
           if (alloc->first == block) {
           ^
   sound/isa/gus/gus_mem.c:72:7: note: Assuming field 'next' is null
                   if (block->next)
--
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/slab.h:724:2: note: Returning pointer, which participates in a condition later
           return kmalloc(size, flags | __GFP_ZERO);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/slab.h:724:2: note: Returning pointer
           return kmalloc(size, flags | __GFP_ZERO);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/target/target_core_transport.c:1493:21: note: Returning from 'kzalloc'
                   cmd->t_task_cdb = kzalloc(scsi_command_size(cdb), gfp);
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/target/target_core_transport.c:1493:3: note: Value assigned to field 't_task_cdb'
                   cmd->t_task_cdb = kzalloc(scsi_command_size(cdb), gfp);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/target/target_core_transport.c:1494:7: note: Assuming field 't_task_cdb' is null
                   if (!cmd->t_task_cdb) {
                       ^~~~~~~~~~~~~~~~
   drivers/target/target_core_transport.c:1494:7: note: Assuming pointer value is null
                   if (!cmd->t_task_cdb) {
                       ^~~~~~~~~~~~~~~~
   drivers/target/target_core_transport.c:1494:3: note: Taking true branch
                   if (!cmd->t_task_cdb) {
                   ^
   drivers/target/target_core_transport.c:1495:4: note: Loop condition is false.  Exiting loop
                           pr_err("Unable to allocate cmd->t_task_cdb"
                           ^
   include/linux/printk.h:489:2: note: expanded from macro 'pr_err'
           printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:392:34: note: expanded from macro '__printk_index_emit'
   #define __printk_index_emit(...) do {} while (0)
                                    ^
   drivers/target/target_core_transport.c:1500:4: note: Control jumps to line 1516
                           goto err;
                           ^
   drivers/target/target_core_transport.c:1516:31: note: Assuming '__UNIQUE_ID___x517' is >= '__UNIQUE_ID___y518'
           memcpy(cmd->t_task_cdb, cdb, min(scsi_command_size(cdb),
                                        ^
   include/linux/minmax.h:45:19: note: expanded from macro 'min'
   #define min(x, y)       __careful_cmp(x, y, <)
                           ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:38:3: note: expanded from macro '__careful_cmp'
                   __cmp_once(x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y), op))
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:33:3: note: expanded from macro '__cmp_once'
                   __cmp(unique_x, unique_y, op); })
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:28:26: note: expanded from macro '__cmp'
   #define __cmp(x, y, op) ((x) op (y) ? (x) : (y))
                            ^~~~~~~~~~
   drivers/target/target_core_transport.c:1516:31: note: '?' condition is false
           memcpy(cmd->t_task_cdb, cdb, min(scsi_command_size(cdb),
                                        ^
   include/linux/minmax.h:45:19: note: expanded from macro 'min'
   #define min(x, y)       __careful_cmp(x, y, <)
                           ^
   include/linux/minmax.h:38:3: note: expanded from macro '__careful_cmp'
                   __cmp_once(x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y), op))
                   ^
   include/linux/minmax.h:33:3: note: expanded from macro '__cmp_once'
                   __cmp(unique_x, unique_y, op); })
                   ^
   include/linux/minmax.h:28:26: note: expanded from macro '__cmp'
   #define __cmp(x, y, op) ((x) op (y) ? (x) : (y))
                            ^
   drivers/target/target_core_transport.c:1516:2: note: Null pointer passed as 1st argument to memory copy function
           memcpy(cmd->t_task_cdb, cdb, min(scsi_command_size(cdb),
           ^      ~~~~~~~~~~~~~~~
   drivers/target/target_core_transport.c:3105:12: warning: Value stored to 'cdb' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           const u8 *cdb = cmd->t_task_cdb;
                     ^~~   ~~~~~~~~~~~~~~~
   drivers/target/target_core_transport.c:3105:12: note: Value stored to 'cdb' during its initialization is never read
           const u8 *cdb = cmd->t_task_cdb;
                     ^~~   ~~~~~~~~~~~~~~~
   drivers/target/target_core_transport.c:3106:21: warning: Value stored to 'tmf' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct se_tmr_req *tmf = cmd->se_tmr_req;
                              ^~~   ~~~~~~~~~~~~~~~
   drivers/target/target_core_transport.c:3106:21: note: Value stored to 'tmf' during its initialization is never read
           struct se_tmr_req *tmf = cmd->se_tmr_req;
                              ^~~   ~~~~~~~~~~~~~~~
   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.
   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.
   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.
   4 warnings generated.
>> sound/soc/codecs/ak4375.c:343:3: warning: Value stored to 'mclk' is never read [clang-analyzer-deadcode.DeadStores]
                   mclk = 128 * ak4375->rate;
                   ^      ~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/ak4375.c:343:3: note: Value stored to 'mclk' is never read
                   mclk = 128 * ak4375->rate;
                   ^      ~~~~~~~~~~~~~~~~~~
   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.
   sound/soc/codecs/alc5623.c:700:23: warning: Value stored to 'alc5623' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct alc5623_priv *alc5623 = snd_soc_component_get_drvdata(component);
                                ^~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/alc5623.c:700:23: note: Value stored to 'alc5623' during its initialization is never read
           struct alc5623_priv *alc5623 = snd_soc_component_get_drvdata(component);
                                ^~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   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.
   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.
   sound/soc/codecs/cs35l34.c:260:3: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
                   ret = regmap_update_bits(priv->regmap, CS35L34_PWRCTL1,
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/cs35l34.c:260:3: note: Value stored to 'ret' is never read
                   ret = regmap_update_bits(priv->regmap, CS35L34_PWRCTL1,
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   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.
   6 warnings generated.
   sound/pci/lx6464es/lx6464es.c:428:3: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
                   err = lx_buffer_ask(chip, 0, is_capture, &needed, &freed,
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/pci/lx6464es/lx6464es.c:428:3: note: Value stored to 'err' is never read
                   err = lx_buffer_ask(chip, 0, is_capture, &needed, &freed,
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/pci/lx6464es/lx6464es.c:433:3: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
                   err = lx_buffer_give(chip, 0, is_capture, period_bytes,
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/pci/lx6464es/lx6464es.c:433:3: note: Value stored to 'err' is never read
                   err = lx_buffer_give(chip, 0, is_capture, period_bytes,
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/pci/lx6464es/lx6464es.c:442:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
           err = lx_buffer_ask(chip, 0, is_capture, &needed, &freed, size_array);
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/pci/lx6464es/lx6464es.c:442:2: note: Value stored to 'err' is never read
           err = lx_buffer_ask(chip, 0, is_capture, &needed, &freed, size_array);
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/pci/lx6464es/lx6464es.c:817: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(pcm->name, card_name);
           ^~~~~~
   sound/pci/lx6464es/lx6464es.c:817: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(pcm->name, card_name);
           ^~~~~~
   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.
   7 warnings generated.
   sound/pci/lx6464es/lx_core.c:995:44: warning: The left operand of '<<' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
                   *r_notified_in_pipe_mask = ((u64)stat[3] << 32)
                                                            ^
   sound/pci/lx6464es/lx_core.c:1113:8: note: Calling 'lx_interrupt_handle_async_events'
           err = lx_interrupt_handle_async_events(chip, chip->irqsrc,
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/pci/lx6464es/lx_core.c:985:24: note: Assuming the condition is false
           int eb_pending_out = (irqsrc & MASK_SYS_STATUS_EOBO) ? 1 : 0;
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/pci/lx6464es/lx_core.c:985:23: note: '?' condition is false
           int eb_pending_out = (irqsrc & MASK_SYS_STATUS_EOBO) ? 1 : 0;
                                ^
   sound/pci/lx6464es/lx_core.c:986:24: note: Assuming the condition is true
           int eb_pending_in  = (irqsrc & MASK_SYS_STATUS_EOBI) ? 1 : 0;
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/pci/lx6464es/lx_core.c:986:23: note: '?' condition is true
           int eb_pending_in  = (irqsrc & MASK_SYS_STATUS_EOBI) ? 1 : 0;
                                ^
   sound/pci/lx6464es/lx_core.c:988:21: note: Assuming the condition is false
           *r_freq_changed = (irqsrc & MASK_SYS_STATUS_FREQ) ? 1 : 0;
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/pci/lx6464es/lx_core.c:988:20: note: '?' condition is false
           *r_freq_changed = (irqsrc & MASK_SYS_STATUS_FREQ) ? 1 : 0;
                             ^
   sound/pci/lx6464es/lx_core.c:990:8: note: Calling 'lx_dsp_read_async_events'
           err = lx_dsp_read_async_events(chip, stat);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/pci/lx6464es/lx_core.c:407:6: note: Assuming 'ret' is not equal to 0
           if (!ret)
               ^~~~
   sound/pci/lx6464es/lx_core.c:407:2: note: Taking false branch
           if (!ret)
           ^
   sound/pci/lx6464es/lx_core.c:990:8: note: Returning from 'lx_dsp_read_async_events'
           err = lx_dsp_read_async_events(chip, stat);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/pci/lx6464es/lx_core.c:991:6: note: Assuming 'err' is >= 0
           if (err < 0)

vim +/mclk +343 sound/soc/codecs/ak4375.c

53778b8292b549 Vincent Knecht 2021-12-20  280  
53778b8292b549 Vincent Knecht 2021-12-20  281  static int ak4375_dai_set_pll(struct snd_soc_dai *dai, int pll_id, int source,
53778b8292b549 Vincent Knecht 2021-12-20  282  			      unsigned int freq_in, unsigned int freq_out)
53778b8292b549 Vincent Knecht 2021-12-20  283  {
53778b8292b549 Vincent Knecht 2021-12-20  284  	struct snd_soc_component *component = dai->component;
53778b8292b549 Vincent Knecht 2021-12-20  285  	struct ak4375_priv *ak4375 = snd_soc_component_get_drvdata(component);
53778b8292b549 Vincent Knecht 2021-12-20  286  	unsigned int mclk, plm, mdiv, div;
53778b8292b549 Vincent Knecht 2021-12-20  287  	u8 cms, fs, cm;
53778b8292b549 Vincent Knecht 2021-12-20  288  
53778b8292b549 Vincent Knecht 2021-12-20  289  	cms = snd_soc_component_read(component, AK4375_05_CLOCK_MODE_SELECT);
53778b8292b549 Vincent Knecht 2021-12-20  290  	fs = cms & ~FS_MASK;
53778b8292b549 Vincent Knecht 2021-12-20  291  	cm = cms & ~CM_MASK;
53778b8292b549 Vincent Knecht 2021-12-20  292  
53778b8292b549 Vincent Knecht 2021-12-20  293  	switch (ak4375->rate) {
53778b8292b549 Vincent Knecht 2021-12-20  294  	case 8000:
53778b8292b549 Vincent Knecht 2021-12-20  295  		fs |= FS_8KHZ;
53778b8292b549 Vincent Knecht 2021-12-20  296  		break;
53778b8292b549 Vincent Knecht 2021-12-20  297  	case 11025:
53778b8292b549 Vincent Knecht 2021-12-20  298  		fs |= FS_11_025KHZ;
53778b8292b549 Vincent Knecht 2021-12-20  299  		break;
53778b8292b549 Vincent Knecht 2021-12-20  300  	case 16000:
53778b8292b549 Vincent Knecht 2021-12-20  301  		fs |= FS_16KHZ;
53778b8292b549 Vincent Knecht 2021-12-20  302  		break;
53778b8292b549 Vincent Knecht 2021-12-20  303  	case 22050:
53778b8292b549 Vincent Knecht 2021-12-20  304  		fs |= FS_22_05KHZ;
53778b8292b549 Vincent Knecht 2021-12-20  305  		break;
53778b8292b549 Vincent Knecht 2021-12-20  306  	case 32000:
53778b8292b549 Vincent Knecht 2021-12-20  307  		fs |= FS_32KHZ;
53778b8292b549 Vincent Knecht 2021-12-20  308  		break;
53778b8292b549 Vincent Knecht 2021-12-20  309  	case 44100:
53778b8292b549 Vincent Knecht 2021-12-20  310  		fs |= FS_44_1KHZ;
53778b8292b549 Vincent Knecht 2021-12-20  311  		break;
53778b8292b549 Vincent Knecht 2021-12-20  312  	case 48000:
53778b8292b549 Vincent Knecht 2021-12-20  313  		fs |= FS_48KHZ;
53778b8292b549 Vincent Knecht 2021-12-20  314  		break;
53778b8292b549 Vincent Knecht 2021-12-20  315  	case 88200:
53778b8292b549 Vincent Knecht 2021-12-20  316  		fs |= FS_88_2KHZ;
53778b8292b549 Vincent Knecht 2021-12-20  317  		break;
53778b8292b549 Vincent Knecht 2021-12-20  318  	case 96000:
53778b8292b549 Vincent Knecht 2021-12-20  319  		fs |= FS_96KHZ;
53778b8292b549 Vincent Knecht 2021-12-20  320  		break;
53778b8292b549 Vincent Knecht 2021-12-20  321  	case 176400:
53778b8292b549 Vincent Knecht 2021-12-20  322  		fs |= FS_176_4KHZ;
53778b8292b549 Vincent Knecht 2021-12-20  323  		break;
53778b8292b549 Vincent Knecht 2021-12-20  324  	case 192000:
53778b8292b549 Vincent Knecht 2021-12-20  325  		fs |= FS_192KHZ;
53778b8292b549 Vincent Knecht 2021-12-20  326  		break;
53778b8292b549 Vincent Knecht 2021-12-20  327  	default:
53778b8292b549 Vincent Knecht 2021-12-20  328  		return -EINVAL;
53778b8292b549 Vincent Knecht 2021-12-20  329  	}
53778b8292b549 Vincent Knecht 2021-12-20  330  
53778b8292b549 Vincent Knecht 2021-12-20  331  	if (ak4375->rate <= 24000) {
53778b8292b549 Vincent Knecht 2021-12-20  332  		cm |= CM_1;
53778b8292b549 Vincent Knecht 2021-12-20  333  		mclk = 512 * ak4375->rate;
53778b8292b549 Vincent Knecht 2021-12-20  334  		mdiv = freq_out / mclk - 1;
53778b8292b549 Vincent Knecht 2021-12-20  335  		div = 0;
53778b8292b549 Vincent Knecht 2021-12-20  336  	} else if (ak4375->rate <= 96000) {
53778b8292b549 Vincent Knecht 2021-12-20  337  		cm |= CM_0;
53778b8292b549 Vincent Knecht 2021-12-20  338  		mclk = 256 * ak4375->rate;
53778b8292b549 Vincent Knecht 2021-12-20  339  		mdiv = freq_out / mclk - 1;
53778b8292b549 Vincent Knecht 2021-12-20  340  		div = 0;
53778b8292b549 Vincent Knecht 2021-12-20  341  	} else {
53778b8292b549 Vincent Knecht 2021-12-20  342  		cm |= CM_3;
53778b8292b549 Vincent Knecht 2021-12-20 @343  		mclk = 128 * ak4375->rate;
53778b8292b549 Vincent Knecht 2021-12-20  344  		mdiv = 4;
53778b8292b549 Vincent Knecht 2021-12-20  345  		div = 1;
53778b8292b549 Vincent Knecht 2021-12-20  346  	}
53778b8292b549 Vincent Knecht 2021-12-20  347  
53778b8292b549 Vincent Knecht 2021-12-20  348  	/* Writing both fields in one go seems to make playback choppy on start */
53778b8292b549 Vincent Knecht 2021-12-20  349  	snd_soc_component_update_bits(component, AK4375_05_CLOCK_MODE_SELECT, FS_MASK, fs);
53778b8292b549 Vincent Knecht 2021-12-20  350  	snd_soc_component_update_bits(component, AK4375_05_CLOCK_MODE_SELECT, CM_MASK, cm);
53778b8292b549 Vincent Knecht 2021-12-20  351  
53778b8292b549 Vincent Knecht 2021-12-20  352  	snd_soc_component_write(component, AK4375_0F_PLL_REF_CLK_DIVIDER1,
53778b8292b549 Vincent Knecht 2021-12-20  353  				(ak4375->pld & 0xff00) >> 8);
53778b8292b549 Vincent Knecht 2021-12-20  354  	snd_soc_component_write(component, AK4375_10_PLL_REF_CLK_DIVIDER2,
53778b8292b549 Vincent Knecht 2021-12-20  355  				ak4375->pld & 0x00ff);
53778b8292b549 Vincent Knecht 2021-12-20  356  
53778b8292b549 Vincent Knecht 2021-12-20  357  	plm = freq_out / freq_in - 1;
53778b8292b549 Vincent Knecht 2021-12-20  358  	snd_soc_component_write(component, AK4375_11_PLL_FB_CLK_DIVIDER1, (plm & 0xff00) >> 8);
53778b8292b549 Vincent Knecht 2021-12-20  359  	snd_soc_component_write(component, AK4375_12_PLL_FB_CLK_DIVIDER2, plm & 0x00ff);
53778b8292b549 Vincent Knecht 2021-12-20  360  
53778b8292b549 Vincent Knecht 2021-12-20  361  	snd_soc_component_update_bits(component, AK4375_13_SRC_CLK_SOURCE, DIV, div);
53778b8292b549 Vincent Knecht 2021-12-20  362  
53778b8292b549 Vincent Knecht 2021-12-20  363  	/* SRCCKS bit: force to 1 for SRC PLL source clock */
53778b8292b549 Vincent Knecht 2021-12-20  364  	snd_soc_component_update_bits(component, AK4375_13_SRC_CLK_SOURCE, SRCCKS, SRCCKS);
53778b8292b549 Vincent Knecht 2021-12-20  365  
53778b8292b549 Vincent Knecht 2021-12-20  366  	snd_soc_component_write(component, AK4375_14_DAC_CLK_DIVIDER, mdiv);
53778b8292b549 Vincent Knecht 2021-12-20  367  
53778b8292b549 Vincent Knecht 2021-12-20  368  	dev_dbg(ak4375->dev, "rate=%d mclk=%d f_in=%d f_out=%d PLD=%d PLM=%d MDIV=%d DIV=%d\n",
53778b8292b549 Vincent Knecht 2021-12-20  369  		ak4375->rate, mclk, freq_in, freq_out, ak4375->pld, plm, mdiv, div);
53778b8292b549 Vincent Knecht 2021-12-20  370  
53778b8292b549 Vincent Knecht 2021-12-20  371  	return 0;
53778b8292b549 Vincent Knecht 2021-12-20  372  }
53778b8292b549 Vincent Knecht 2021-12-20  373  

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

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

* sound/soc/codecs/ak4375.c:343:3: warning: Value stored to 'mclk' is never read [clang-analyzer-deadcode.DeadStores]
@ 2022-01-28  5:00 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2022-01-28  5:00 UTC (permalink / raw)
  To: kbuild

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

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Vincent Knecht <vincent.knecht@mailoo.org>
CC: Mark Brown <broonie@kernel.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   23a46422c56144939c091c76cf389aa863ce9c18
commit: 53778b8292b5492ec3ecf1efb84163eac2a6e422 ASoC: Add AK4375 support
date:   5 weeks ago
:::::: branch date: 10 hours ago
:::::: commit date: 5 weeks ago
config: arm-randconfig-c002-20220125 (https://download.01.org/0day-ci/archive/20220128/202201281208.amOQKI90-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 997e128e2a78f5a5434fc75997441ae1ee76f8a4)
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=53778b8292b5492ec3ecf1efb84163eac2a6e422
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 53778b8292b5492ec3ecf1efb84163eac2a6e422
        # save the config file 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 >>)
   include/linux/minmax.h:28:26: note: expanded from macro '__cmp'
   #define __cmp(x, y, op) ((x) op (y) ? (x) : (y))
                            ^
   drivers/hwmon/lm75.h:27:14: note: '__UNIQUE_ID___x267' is < '__UNIQUE_ID___y268'
           int ntemp = clamp_val(temp, LM75_TEMP_MIN, LM75_TEMP_MAX);
                       ^
   include/linux/minmax.h:137:32: note: expanded from macro 'clamp_val'
   #define clamp_val(val, lo, hi) clamp_t(typeof(val), val, lo, hi)
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:124:36: note: expanded from macro 'clamp_t'
   #define clamp_t(type, val, lo, hi) min_t(type, max_t(type, val, lo), hi)
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:104:27: note: expanded from macro 'min_t'
   #define min_t(type, x, y)       __careful_cmp((type)(x), (type)(y), <)
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:38:3: note: expanded from macro '__careful_cmp'
                   __cmp_once(x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y), op))
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:33:3: note: expanded from macro '__cmp_once'
                   __cmp(unique_x, unique_y, op); })
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:28:26: note: expanded from macro '__cmp'
   #define __cmp(x, y, op) ((x) op (y) ? (x) : (y))
                            ^~~
   drivers/hwmon/lm75.h:27:14: note: '?' condition is true
           int ntemp = clamp_val(temp, LM75_TEMP_MIN, LM75_TEMP_MAX);
                       ^
   include/linux/minmax.h:137:32: note: expanded from macro 'clamp_val'
   #define clamp_val(val, lo, hi) clamp_t(typeof(val), val, lo, hi)
                                  ^
   include/linux/minmax.h:124:36: note: expanded from macro 'clamp_t'
   #define clamp_t(type, val, lo, hi) min_t(type, max_t(type, val, lo), hi)
                                      ^
   include/linux/minmax.h:104:27: note: expanded from macro 'min_t'
   #define min_t(type, x, y)       __careful_cmp((type)(x), (type)(y), <)
                                   ^
   include/linux/minmax.h:38:3: note: expanded from macro '__careful_cmp'
                   __cmp_once(x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y), op))
                   ^
   include/linux/minmax.h:33:3: note: expanded from macro '__cmp_once'
                   __cmp(unique_x, unique_y, op); })
                   ^
   include/linux/minmax.h:28:26: note: expanded from macro '__cmp'
   #define __cmp(x, y, op) ((x) op (y) ? (x) : (y))
                            ^
   drivers/hwmon/lm75.h:29:12: note: 'ntemp' is < 0
           ntemp += (ntemp < 0 ? -250 : 250);
                     ^~~~~
   drivers/hwmon/lm75.h:29:12: note: '?' condition is true
   drivers/hwmon/lm75.h:30:29: note: The result of the left shift is undefined because the left operand is negative
           return (u16)((ntemp / 500) << 7);
                        ~~~~~~~~~~~~~ ^
   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.
   drivers/of/device.c:59:29: warning: Value stored to 'of_node' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct device_node *node, *of_node = dev->of_node;
                                      ^~~~~~~   ~~~~~~~~~~~~
   drivers/of/device.c:59:29: note: Value stored to 'of_node' during its initialization is never read
           struct device_node *node, *of_node = dev->of_node;
                                      ^~~~~~~   ~~~~~~~~~~~~
   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.
   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.
   9 warnings generated.
   sound/soc/codecs/adau7118.c:127:24: warning: Value stored to 'st' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct adau7118_data *st =
                                 ^~
   sound/soc/codecs/adau7118.c:127:24: note: Value stored to 'st' during its initialization is never read
           struct adau7118_data *st =
                                 ^~
   sound/soc/codecs/adau7118.c:210:24: warning: Value stored to 'st' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct adau7118_data *st =
                                 ^~
   sound/soc/codecs/adau7118.c:210:24: note: Value stored to 'st' during its initialization is never read
           struct adau7118_data *st =
                                 ^~
   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.
>> sound/soc/codecs/ak4375.c:343:3: warning: Value stored to 'mclk' is never read [clang-analyzer-deadcode.DeadStores]
                   mclk = 128 * ak4375->rate;
                   ^      ~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/ak4375.c:343:3: note: Value stored to 'mclk' is never read
                   mclk = 128 * ak4375->rate;
                   ^      ~~~~~~~~~~~~~~~~~~
   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.
   sound/soc/codecs/ak4613.c:402:2: warning: Value stored to 'fmt_ctrl' is never read [clang-analyzer-deadcode.DeadStores]
           fmt_ctrl = NO_FMT;
           ^
   sound/soc/codecs/ak4613.c:402:2: note: Value stored to 'fmt_ctrl' 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.
   8 warnings generated.
   sound/soc/codecs/ak4642.c:410:2: warning: Value stored to 'data' is never read [clang-analyzer-deadcode.DeadStores]
           data = 0;
           ^      ~
   sound/soc/codecs/ak4642.c:410:2: note: Value stored to 'data' is never read
           data = 0;
           ^      ~
   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/regulator/mc13xxx-regulator-core.c:115:6: warning: Value stored to 'id' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           int id = rdev_get_id(rdev);
               ^~   ~~~~~~~~~~~~~~~~~
   drivers/regulator/mc13xxx-regulator-core.c:115:6: note: Value stored to 'id' during its initialization is never read
           int id = rdev_get_id(rdev);
               ^~   ~~~~~~~~~~~~~~~~~
   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/base/power/main.c:465:3: warning: Value stored to 'usecs' is never read [clang-analyzer-deadcode.DeadStores]
                   usecs = 1;
                   ^       ~
   drivers/base/power/main.c:465:3: note: Value stored to 'usecs' is never read
                   usecs = 1;
                   ^       ~
   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.
   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.
   25 warnings generated.
   drivers/base/regmap/regmap.c:1933:2: warning: Called function pointer is null (null dereference) [clang-analyzer-core.CallAndMessage]
           map->format.format_val(map->work_buf + map->format.reg_bytes
           ^~~~~~~~~~~~~~~~~~~~~~
   drivers/base/regmap/regmap.c:1931:10: note: Assuming field 'bus' is non-null
           WARN_ON(!map->bus || !map->format.format_val);
                   ^
   include/asm-generic/bug.h:121:25: note: expanded from macro 'WARN_ON'
           int __ret_warn_on = !!(condition);                              \
                                  ^~~~~~~~~
   drivers/base/regmap/regmap.c:1931:10: note: Left side of '||' is false
           WARN_ON(!map->bus || !map->format.format_val);
                   ^
   drivers/base/regmap/regmap.c:1931:23: note: Assuming field 'format_val' is null
           WARN_ON(!map->bus || !map->format.format_val);
                                ^
   include/asm-generic/bug.h:121:25: note: expanded from macro 'WARN_ON'
           int __ret_warn_on = !!(condition);                              \
                                  ^~~~~~~~~
   drivers/base/regmap/regmap.c:1931:2: note: Taking true branch
           WARN_ON(!map->bus || !map->format.format_val);
           ^
   include/asm-generic/bug.h:122:2: note: expanded from macro 'WARN_ON'

vim +/mclk +343 sound/soc/codecs/ak4375.c

53778b8292b5492 Vincent Knecht 2021-12-20  280  
53778b8292b5492 Vincent Knecht 2021-12-20  281  static int ak4375_dai_set_pll(struct snd_soc_dai *dai, int pll_id, int source,
53778b8292b5492 Vincent Knecht 2021-12-20  282  			      unsigned int freq_in, unsigned int freq_out)
53778b8292b5492 Vincent Knecht 2021-12-20  283  {
53778b8292b5492 Vincent Knecht 2021-12-20  284  	struct snd_soc_component *component = dai->component;
53778b8292b5492 Vincent Knecht 2021-12-20  285  	struct ak4375_priv *ak4375 = snd_soc_component_get_drvdata(component);
53778b8292b5492 Vincent Knecht 2021-12-20  286  	unsigned int mclk, plm, mdiv, div;
53778b8292b5492 Vincent Knecht 2021-12-20  287  	u8 cms, fs, cm;
53778b8292b5492 Vincent Knecht 2021-12-20  288  
53778b8292b5492 Vincent Knecht 2021-12-20  289  	cms = snd_soc_component_read(component, AK4375_05_CLOCK_MODE_SELECT);
53778b8292b5492 Vincent Knecht 2021-12-20  290  	fs = cms & ~FS_MASK;
53778b8292b5492 Vincent Knecht 2021-12-20  291  	cm = cms & ~CM_MASK;
53778b8292b5492 Vincent Knecht 2021-12-20  292  
53778b8292b5492 Vincent Knecht 2021-12-20  293  	switch (ak4375->rate) {
53778b8292b5492 Vincent Knecht 2021-12-20  294  	case 8000:
53778b8292b5492 Vincent Knecht 2021-12-20  295  		fs |= FS_8KHZ;
53778b8292b5492 Vincent Knecht 2021-12-20  296  		break;
53778b8292b5492 Vincent Knecht 2021-12-20  297  	case 11025:
53778b8292b5492 Vincent Knecht 2021-12-20  298  		fs |= FS_11_025KHZ;
53778b8292b5492 Vincent Knecht 2021-12-20  299  		break;
53778b8292b5492 Vincent Knecht 2021-12-20  300  	case 16000:
53778b8292b5492 Vincent Knecht 2021-12-20  301  		fs |= FS_16KHZ;
53778b8292b5492 Vincent Knecht 2021-12-20  302  		break;
53778b8292b5492 Vincent Knecht 2021-12-20  303  	case 22050:
53778b8292b5492 Vincent Knecht 2021-12-20  304  		fs |= FS_22_05KHZ;
53778b8292b5492 Vincent Knecht 2021-12-20  305  		break;
53778b8292b5492 Vincent Knecht 2021-12-20  306  	case 32000:
53778b8292b5492 Vincent Knecht 2021-12-20  307  		fs |= FS_32KHZ;
53778b8292b5492 Vincent Knecht 2021-12-20  308  		break;
53778b8292b5492 Vincent Knecht 2021-12-20  309  	case 44100:
53778b8292b5492 Vincent Knecht 2021-12-20  310  		fs |= FS_44_1KHZ;
53778b8292b5492 Vincent Knecht 2021-12-20  311  		break;
53778b8292b5492 Vincent Knecht 2021-12-20  312  	case 48000:
53778b8292b5492 Vincent Knecht 2021-12-20  313  		fs |= FS_48KHZ;
53778b8292b5492 Vincent Knecht 2021-12-20  314  		break;
53778b8292b5492 Vincent Knecht 2021-12-20  315  	case 88200:
53778b8292b5492 Vincent Knecht 2021-12-20  316  		fs |= FS_88_2KHZ;
53778b8292b5492 Vincent Knecht 2021-12-20  317  		break;
53778b8292b5492 Vincent Knecht 2021-12-20  318  	case 96000:
53778b8292b5492 Vincent Knecht 2021-12-20  319  		fs |= FS_96KHZ;
53778b8292b5492 Vincent Knecht 2021-12-20  320  		break;
53778b8292b5492 Vincent Knecht 2021-12-20  321  	case 176400:
53778b8292b5492 Vincent Knecht 2021-12-20  322  		fs |= FS_176_4KHZ;
53778b8292b5492 Vincent Knecht 2021-12-20  323  		break;
53778b8292b5492 Vincent Knecht 2021-12-20  324  	case 192000:
53778b8292b5492 Vincent Knecht 2021-12-20  325  		fs |= FS_192KHZ;
53778b8292b5492 Vincent Knecht 2021-12-20  326  		break;
53778b8292b5492 Vincent Knecht 2021-12-20  327  	default:
53778b8292b5492 Vincent Knecht 2021-12-20  328  		return -EINVAL;
53778b8292b5492 Vincent Knecht 2021-12-20  329  	}
53778b8292b5492 Vincent Knecht 2021-12-20  330  
53778b8292b5492 Vincent Knecht 2021-12-20  331  	if (ak4375->rate <= 24000) {
53778b8292b5492 Vincent Knecht 2021-12-20  332  		cm |= CM_1;
53778b8292b5492 Vincent Knecht 2021-12-20  333  		mclk = 512 * ak4375->rate;
53778b8292b5492 Vincent Knecht 2021-12-20  334  		mdiv = freq_out / mclk - 1;
53778b8292b5492 Vincent Knecht 2021-12-20  335  		div = 0;
53778b8292b5492 Vincent Knecht 2021-12-20  336  	} else if (ak4375->rate <= 96000) {
53778b8292b5492 Vincent Knecht 2021-12-20  337  		cm |= CM_0;
53778b8292b5492 Vincent Knecht 2021-12-20  338  		mclk = 256 * ak4375->rate;
53778b8292b5492 Vincent Knecht 2021-12-20  339  		mdiv = freq_out / mclk - 1;
53778b8292b5492 Vincent Knecht 2021-12-20  340  		div = 0;
53778b8292b5492 Vincent Knecht 2021-12-20  341  	} else {
53778b8292b5492 Vincent Knecht 2021-12-20  342  		cm |= CM_3;
53778b8292b5492 Vincent Knecht 2021-12-20 @343  		mclk = 128 * ak4375->rate;
53778b8292b5492 Vincent Knecht 2021-12-20  344  		mdiv = 4;
53778b8292b5492 Vincent Knecht 2021-12-20  345  		div = 1;
53778b8292b5492 Vincent Knecht 2021-12-20  346  	}
53778b8292b5492 Vincent Knecht 2021-12-20  347  
53778b8292b5492 Vincent Knecht 2021-12-20  348  	/* Writing both fields in one go seems to make playback choppy on start */
53778b8292b5492 Vincent Knecht 2021-12-20  349  	snd_soc_component_update_bits(component, AK4375_05_CLOCK_MODE_SELECT, FS_MASK, fs);
53778b8292b5492 Vincent Knecht 2021-12-20  350  	snd_soc_component_update_bits(component, AK4375_05_CLOCK_MODE_SELECT, CM_MASK, cm);
53778b8292b5492 Vincent Knecht 2021-12-20  351  
53778b8292b5492 Vincent Knecht 2021-12-20  352  	snd_soc_component_write(component, AK4375_0F_PLL_REF_CLK_DIVIDER1,
53778b8292b5492 Vincent Knecht 2021-12-20  353  				(ak4375->pld & 0xff00) >> 8);
53778b8292b5492 Vincent Knecht 2021-12-20  354  	snd_soc_component_write(component, AK4375_10_PLL_REF_CLK_DIVIDER2,
53778b8292b5492 Vincent Knecht 2021-12-20  355  				ak4375->pld & 0x00ff);
53778b8292b5492 Vincent Knecht 2021-12-20  356  
53778b8292b5492 Vincent Knecht 2021-12-20  357  	plm = freq_out / freq_in - 1;
53778b8292b5492 Vincent Knecht 2021-12-20  358  	snd_soc_component_write(component, AK4375_11_PLL_FB_CLK_DIVIDER1, (plm & 0xff00) >> 8);
53778b8292b5492 Vincent Knecht 2021-12-20  359  	snd_soc_component_write(component, AK4375_12_PLL_FB_CLK_DIVIDER2, plm & 0x00ff);
53778b8292b5492 Vincent Knecht 2021-12-20  360  
53778b8292b5492 Vincent Knecht 2021-12-20  361  	snd_soc_component_update_bits(component, AK4375_13_SRC_CLK_SOURCE, DIV, div);
53778b8292b5492 Vincent Knecht 2021-12-20  362  
53778b8292b5492 Vincent Knecht 2021-12-20  363  	/* SRCCKS bit: force to 1 for SRC PLL source clock */
53778b8292b5492 Vincent Knecht 2021-12-20  364  	snd_soc_component_update_bits(component, AK4375_13_SRC_CLK_SOURCE, SRCCKS, SRCCKS);
53778b8292b5492 Vincent Knecht 2021-12-20  365  
53778b8292b5492 Vincent Knecht 2021-12-20  366  	snd_soc_component_write(component, AK4375_14_DAC_CLK_DIVIDER, mdiv);
53778b8292b5492 Vincent Knecht 2021-12-20  367  
53778b8292b5492 Vincent Knecht 2021-12-20  368  	dev_dbg(ak4375->dev, "rate=%d mclk=%d f_in=%d f_out=%d PLD=%d PLM=%d MDIV=%d DIV=%d\n",
53778b8292b5492 Vincent Knecht 2021-12-20  369  		ak4375->rate, mclk, freq_in, freq_out, ak4375->pld, plm, mdiv, div);
53778b8292b5492 Vincent Knecht 2021-12-20  370  
53778b8292b5492 Vincent Knecht 2021-12-20  371  	return 0;
53778b8292b5492 Vincent Knecht 2021-12-20  372  }
53778b8292b5492 Vincent Knecht 2021-12-20  373  

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

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

* sound/soc/codecs/ak4375.c:343:3: warning: Value stored to 'mclk' is never read [clang-analyzer-deadcode.DeadStores]
@ 2022-01-28  0:14 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2022-01-28  0:14 UTC (permalink / raw)
  To: kbuild

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

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Vincent Knecht <vincent.knecht@mailoo.org>
CC: Mark Brown <broonie@kernel.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   626b2dda7651a7c766108db4cdc0825db05b980d
commit: 53778b8292b5492ec3ecf1efb84163eac2a6e422 ASoC: Add AK4375 support
date:   5 weeks ago
:::::: branch date: 15 hours ago
:::::: commit date: 5 weeks ago
config: riscv-randconfig-c006-20220126 (https://download.01.org/0day-ci/archive/20220128/202201280858.hYBJaCzK-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 2a1b7aa016c0f4b5598806205bdfbab1ea2d92c4)
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=53778b8292b5492ec3ecf1efb84163eac2a6e422
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 53778b8292b5492ec3ecf1efb84163eac2a6e422
        # 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 >>)
                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/src.c:117:29: note: RSND_MOD_SRC is < RSND_MOD_MAX
           struct rsnd_mod *src_mod = rsnd_io_to_mod_src(io);
                                      ^
   sound/soc/sh/rcar/rsnd.h:521:32: note: expanded from macro 'rsnd_io_to_mod_src'
   #define rsnd_io_to_mod_src(io)  rsnd_io_to_mod((io), RSND_MOD_SRC)
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/rsnd.h:517:32: note: expanded from macro 'rsnd_io_to_mod'
   #define rsnd_io_to_mod(io, i)   ((i) < RSND_MOD_MAX ? (io)->mod[(i)] : NULL)
                                    ^~~
   sound/soc/sh/rcar/src.c:117:29: note: '?' condition is true
           struct rsnd_mod *src_mod = rsnd_io_to_mod_src(io);
                                      ^
   sound/soc/sh/rcar/rsnd.h:521:32: note: expanded from macro 'rsnd_io_to_mod_src'
   #define rsnd_io_to_mod_src(io)  rsnd_io_to_mod((io), RSND_MOD_SRC)
                                   ^
   sound/soc/sh/rcar/rsnd.h:517:32: note: expanded from macro 'rsnd_io_to_mod'
   #define rsnd_io_to_mod(io, i)   ((i) < RSND_MOD_MAX ? (io)->mod[(i)] : NULL)
                                    ^
   sound/soc/sh/rcar/src.c:118:36: note: Field 'substream' is non-null
           struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
                                             ^
   sound/soc/sh/rcar/rsnd.h:529:39: note: expanded from macro 'rsnd_io_to_runtime'
   #define rsnd_io_to_runtime(io) ((io)->substream ? \
                                         ^
   sound/soc/sh/rcar/src.c:118:36: note: '?' condition is true
           struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
                                             ^
   sound/soc/sh/rcar/rsnd.h:529:33: note: expanded from macro 'rsnd_io_to_runtime'
   #define rsnd_io_to_runtime(io) ((io)->substream ? \
                                   ^
   sound/soc/sh/rcar/src.c:130:6: note: Assuming 'is_play' is equal to 'is_in'
           if (is_play == is_in)
               ^~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/src.c:130:2: note: Taking true branch
           if (is_play == is_in)
           ^
   sound/soc/sh/rcar/src.c:131:3: note: Returning zero
                   return runtime->rate;
                   ^~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/src.c:222:9: note: Returning from 'rsnd_src_get_rate'
           fout = rsnd_src_get_out_rate(priv, io);
                  ^
   sound/soc/sh/rcar/rsnd.h:818:41: note: expanded from macro 'rsnd_src_get_out_rate'
   #define rsnd_src_get_out_rate(priv, io) rsnd_src_get_rate(priv, io, 0)
                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/src.c:222:2: note: The value 0 is assigned to 'fout'
           fout = rsnd_src_get_out_rate(priv, io);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/src.c:227:6: note: 'fin' is equal to 'fout'
           if (fin == fout)
               ^~~
   sound/soc/sh/rcar/src.c:227:2: note: Taking true branch
           if (fin == fout)
           ^
   sound/soc/sh/rcar/src.c:234:6: note: 'ratio' is <= 600
           if (ratio > 600) {
               ^~~~~
   sound/soc/sh/rcar/src.c:234:2: note: Taking false branch
           if (ratio > 600) {
           ^
   sound/soc/sh/rcar/src.c:251:6: note: Assuming 'use_src' is not equal to 0
           if (use_src) {
               ^~~~~~~
   sound/soc/sh/rcar/src.c:251:2: note: Taking true branch
           if (use_src) {
           ^
   sound/soc/sh/rcar/src.c:256:3: note: '__base' initialized to 0
                   do_div(n, fout);
                   ^
   include/asm-generic/div64.h:220:2: note: expanded from macro 'do_div'
           uint32_t __base = (base);                       \
           ^~~~~~~~~~~~~~~
   sound/soc/sh/rcar/src.c:256:3: note: Left side of '&&' is false
                   do_div(n, fout);
                   ^
   include/asm-generic/div64.h:223:35: note: expanded from macro 'do_div'
           if (__builtin_constant_p(__base) &&             \
                                            ^
   sound/soc/sh/rcar/src.c:256:3: note: Left side of '&&' is false
                   do_div(n, fout);
                   ^
   include/asm-generic/div64.h:227:42: note: expanded from macro 'do_div'
           } else if (__builtin_constant_p(__base) &&      \
                                                   ^
   sound/soc/sh/rcar/src.c:256:3: note: Taking true branch
                   do_div(n, fout);
                   ^
   include/asm-generic/div64.h:234:9: note: expanded from macro 'do_div'
           } else if (likely(((n) >> 32) == 0)) {          \
                  ^
   sound/soc/sh/rcar/src.c:256:3: note: Division by zero
                   do_div(n, fout);
                   ^
   include/asm-generic/div64.h:235:25: note: expanded from macro 'do_div'
                   __rem = (uint32_t)(n) % __base;         \
                           ~~~~~~~~~~~~~~^~~~~~~~
   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.
>> sound/soc/codecs/ak4375.c:343:3: warning: Value stored to 'mclk' is never read [clang-analyzer-deadcode.DeadStores]
                   mclk = 128 * ak4375->rate;
                   ^      ~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/ak4375.c:343:3: note: Value stored to 'mclk' is never read
                   mclk = 128 * ak4375->rate;
                   ^      ~~~~~~~~~~~~~~~~~~
   Suppressed 7 warnings (6 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.
   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/ak4613.c:402:2: warning: Value stored to 'fmt_ctrl' is never read [clang-analyzer-deadcode.DeadStores]
           fmt_ctrl = NO_FMT;
           ^
   sound/soc/codecs/ak4613.c:402:2: note: Value stored to 'fmt_ctrl' is never read
   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.
   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.
   10 warnings generated.
   sound/soc/codecs/arizona.c:1378:3: warning: Value stored to 'name' is never read [clang-analyzer-deadcode.DeadStores]
                   name = "SYSCLK";
                   ^      ~~~~~~~~
   sound/soc/codecs/arizona.c:1378:3: note: Value stored to 'name' is never read
                   name = "SYSCLK";
                   ^      ~~~~~~~~
   sound/soc/codecs/arizona.c:1384:3: warning: Value stored to 'name' is never read [clang-analyzer-deadcode.DeadStores]
                   name = "ASYNCCLK";
                   ^      ~~~~~~~~~~
   sound/soc/codecs/arizona.c:1384:3: note: Value stored to 'name' is never read
                   name = "ASYNCCLK";
                   ^      ~~~~~~~~~~
   sound/soc/codecs/arizona.c:2333:2: warning: 4th function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
           regmap_update_bits_async(arizona->regmap, base + 3,
           ^
   sound/soc/codecs/arizona.c:2584:6: note: Assuming 'source' is not equal to field 'sync_src'
           if (fll->sync_src == source &&
               ^~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/arizona.c:2584:30: note: Left side of '&&' is false
           if (fll->sync_src == source &&
                                       ^
   sound/soc/codecs/arizona.c:2588:6: note: Assuming 'Fout' is not equal to 0
           if (Fout) {
               ^~~~
   sound/soc/codecs/arizona.c:2588:2: note: Taking true branch
           if (Fout) {
           ^
   sound/soc/codecs/arizona.c:2589:7: note: Assuming field 'ref_src' is < 0
                   if (fll->ref_src >= 0) {
                       ^~~~~~~~~~~~~~~~~
   sound/soc/codecs/arizona.c:2589:3: note: Taking false branch
                   if (fll->ref_src >= 0) {
                   ^
   sound/soc/codecs/arizona.c:2596:7: note: 'ret' is equal to 0
                   if (ret != 0)
                       ^~~
   sound/soc/codecs/arizona.c:2596:3: note: Taking false branch
                   if (ret != 0)
                   ^
   sound/soc/codecs/arizona.c:2604:6: note: 'Fout' is not equal to 0
           if (Fout)
               ^~~~
   sound/soc/codecs/arizona.c:2604:2: note: Taking true branch
           if (Fout)
           ^
   sound/soc/codecs/arizona.c:2605:9: note: Calling 'arizona_enable_fll'
                   ret = arizona_enable_fll(fll);
                         ^~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/arizona.c:2426:6: note: 'already_enabled' is >= 0
           if (already_enabled < 0)
               ^~~~~~~~~~~~~~~
   sound/soc/codecs/arizona.c:2426:2: note: Taking false branch
           if (already_enabled < 0)
           ^
   sound/soc/codecs/arizona.c:2428:6: note: 'sync_enabled' is >= 0
           if (sync_enabled < 0)
               ^~~~~~~~~~~~
   sound/soc/codecs/arizona.c:2428:2: note: Taking false branch
           if (sync_enabled < 0)
           ^
   sound/soc/codecs/arizona.c:2431:6: note: Assuming 'already_enabled' is 0
           if (already_enabled) {
               ^~~~~~~~~~~~~~~
   sound/soc/codecs/arizona.c:2431:2: note: Taking false branch

vim +/mclk +343 sound/soc/codecs/ak4375.c

53778b8292b549 Vincent Knecht 2021-12-20  280  
53778b8292b549 Vincent Knecht 2021-12-20  281  static int ak4375_dai_set_pll(struct snd_soc_dai *dai, int pll_id, int source,
53778b8292b549 Vincent Knecht 2021-12-20  282  			      unsigned int freq_in, unsigned int freq_out)
53778b8292b549 Vincent Knecht 2021-12-20  283  {
53778b8292b549 Vincent Knecht 2021-12-20  284  	struct snd_soc_component *component = dai->component;
53778b8292b549 Vincent Knecht 2021-12-20  285  	struct ak4375_priv *ak4375 = snd_soc_component_get_drvdata(component);
53778b8292b549 Vincent Knecht 2021-12-20  286  	unsigned int mclk, plm, mdiv, div;
53778b8292b549 Vincent Knecht 2021-12-20  287  	u8 cms, fs, cm;
53778b8292b549 Vincent Knecht 2021-12-20  288  
53778b8292b549 Vincent Knecht 2021-12-20  289  	cms = snd_soc_component_read(component, AK4375_05_CLOCK_MODE_SELECT);
53778b8292b549 Vincent Knecht 2021-12-20  290  	fs = cms & ~FS_MASK;
53778b8292b549 Vincent Knecht 2021-12-20  291  	cm = cms & ~CM_MASK;
53778b8292b549 Vincent Knecht 2021-12-20  292  
53778b8292b549 Vincent Knecht 2021-12-20  293  	switch (ak4375->rate) {
53778b8292b549 Vincent Knecht 2021-12-20  294  	case 8000:
53778b8292b549 Vincent Knecht 2021-12-20  295  		fs |= FS_8KHZ;
53778b8292b549 Vincent Knecht 2021-12-20  296  		break;
53778b8292b549 Vincent Knecht 2021-12-20  297  	case 11025:
53778b8292b549 Vincent Knecht 2021-12-20  298  		fs |= FS_11_025KHZ;
53778b8292b549 Vincent Knecht 2021-12-20  299  		break;
53778b8292b549 Vincent Knecht 2021-12-20  300  	case 16000:
53778b8292b549 Vincent Knecht 2021-12-20  301  		fs |= FS_16KHZ;
53778b8292b549 Vincent Knecht 2021-12-20  302  		break;
53778b8292b549 Vincent Knecht 2021-12-20  303  	case 22050:
53778b8292b549 Vincent Knecht 2021-12-20  304  		fs |= FS_22_05KHZ;
53778b8292b549 Vincent Knecht 2021-12-20  305  		break;
53778b8292b549 Vincent Knecht 2021-12-20  306  	case 32000:
53778b8292b549 Vincent Knecht 2021-12-20  307  		fs |= FS_32KHZ;
53778b8292b549 Vincent Knecht 2021-12-20  308  		break;
53778b8292b549 Vincent Knecht 2021-12-20  309  	case 44100:
53778b8292b549 Vincent Knecht 2021-12-20  310  		fs |= FS_44_1KHZ;
53778b8292b549 Vincent Knecht 2021-12-20  311  		break;
53778b8292b549 Vincent Knecht 2021-12-20  312  	case 48000:
53778b8292b549 Vincent Knecht 2021-12-20  313  		fs |= FS_48KHZ;
53778b8292b549 Vincent Knecht 2021-12-20  314  		break;
53778b8292b549 Vincent Knecht 2021-12-20  315  	case 88200:
53778b8292b549 Vincent Knecht 2021-12-20  316  		fs |= FS_88_2KHZ;
53778b8292b549 Vincent Knecht 2021-12-20  317  		break;
53778b8292b549 Vincent Knecht 2021-12-20  318  	case 96000:
53778b8292b549 Vincent Knecht 2021-12-20  319  		fs |= FS_96KHZ;
53778b8292b549 Vincent Knecht 2021-12-20  320  		break;
53778b8292b549 Vincent Knecht 2021-12-20  321  	case 176400:
53778b8292b549 Vincent Knecht 2021-12-20  322  		fs |= FS_176_4KHZ;
53778b8292b549 Vincent Knecht 2021-12-20  323  		break;
53778b8292b549 Vincent Knecht 2021-12-20  324  	case 192000:
53778b8292b549 Vincent Knecht 2021-12-20  325  		fs |= FS_192KHZ;
53778b8292b549 Vincent Knecht 2021-12-20  326  		break;
53778b8292b549 Vincent Knecht 2021-12-20  327  	default:
53778b8292b549 Vincent Knecht 2021-12-20  328  		return -EINVAL;
53778b8292b549 Vincent Knecht 2021-12-20  329  	}
53778b8292b549 Vincent Knecht 2021-12-20  330  
53778b8292b549 Vincent Knecht 2021-12-20  331  	if (ak4375->rate <= 24000) {
53778b8292b549 Vincent Knecht 2021-12-20  332  		cm |= CM_1;
53778b8292b549 Vincent Knecht 2021-12-20  333  		mclk = 512 * ak4375->rate;
53778b8292b549 Vincent Knecht 2021-12-20  334  		mdiv = freq_out / mclk - 1;
53778b8292b549 Vincent Knecht 2021-12-20  335  		div = 0;
53778b8292b549 Vincent Knecht 2021-12-20  336  	} else if (ak4375->rate <= 96000) {
53778b8292b549 Vincent Knecht 2021-12-20  337  		cm |= CM_0;
53778b8292b549 Vincent Knecht 2021-12-20  338  		mclk = 256 * ak4375->rate;
53778b8292b549 Vincent Knecht 2021-12-20  339  		mdiv = freq_out / mclk - 1;
53778b8292b549 Vincent Knecht 2021-12-20  340  		div = 0;
53778b8292b549 Vincent Knecht 2021-12-20  341  	} else {
53778b8292b549 Vincent Knecht 2021-12-20  342  		cm |= CM_3;
53778b8292b549 Vincent Knecht 2021-12-20 @343  		mclk = 128 * ak4375->rate;
53778b8292b549 Vincent Knecht 2021-12-20  344  		mdiv = 4;
53778b8292b549 Vincent Knecht 2021-12-20  345  		div = 1;
53778b8292b549 Vincent Knecht 2021-12-20  346  	}
53778b8292b549 Vincent Knecht 2021-12-20  347  
53778b8292b549 Vincent Knecht 2021-12-20  348  	/* Writing both fields in one go seems to make playback choppy on start */
53778b8292b549 Vincent Knecht 2021-12-20  349  	snd_soc_component_update_bits(component, AK4375_05_CLOCK_MODE_SELECT, FS_MASK, fs);
53778b8292b549 Vincent Knecht 2021-12-20  350  	snd_soc_component_update_bits(component, AK4375_05_CLOCK_MODE_SELECT, CM_MASK, cm);
53778b8292b549 Vincent Knecht 2021-12-20  351  
53778b8292b549 Vincent Knecht 2021-12-20  352  	snd_soc_component_write(component, AK4375_0F_PLL_REF_CLK_DIVIDER1,
53778b8292b549 Vincent Knecht 2021-12-20  353  				(ak4375->pld & 0xff00) >> 8);
53778b8292b549 Vincent Knecht 2021-12-20  354  	snd_soc_component_write(component, AK4375_10_PLL_REF_CLK_DIVIDER2,
53778b8292b549 Vincent Knecht 2021-12-20  355  				ak4375->pld & 0x00ff);
53778b8292b549 Vincent Knecht 2021-12-20  356  
53778b8292b549 Vincent Knecht 2021-12-20  357  	plm = freq_out / freq_in - 1;
53778b8292b549 Vincent Knecht 2021-12-20  358  	snd_soc_component_write(component, AK4375_11_PLL_FB_CLK_DIVIDER1, (plm & 0xff00) >> 8);
53778b8292b549 Vincent Knecht 2021-12-20  359  	snd_soc_component_write(component, AK4375_12_PLL_FB_CLK_DIVIDER2, plm & 0x00ff);
53778b8292b549 Vincent Knecht 2021-12-20  360  
53778b8292b549 Vincent Knecht 2021-12-20  361  	snd_soc_component_update_bits(component, AK4375_13_SRC_CLK_SOURCE, DIV, div);
53778b8292b549 Vincent Knecht 2021-12-20  362  
53778b8292b549 Vincent Knecht 2021-12-20  363  	/* SRCCKS bit: force to 1 for SRC PLL source clock */
53778b8292b549 Vincent Knecht 2021-12-20  364  	snd_soc_component_update_bits(component, AK4375_13_SRC_CLK_SOURCE, SRCCKS, SRCCKS);
53778b8292b549 Vincent Knecht 2021-12-20  365  
53778b8292b549 Vincent Knecht 2021-12-20  366  	snd_soc_component_write(component, AK4375_14_DAC_CLK_DIVIDER, mdiv);
53778b8292b549 Vincent Knecht 2021-12-20  367  
53778b8292b549 Vincent Knecht 2021-12-20  368  	dev_dbg(ak4375->dev, "rate=%d mclk=%d f_in=%d f_out=%d PLD=%d PLM=%d MDIV=%d DIV=%d\n",
53778b8292b549 Vincent Knecht 2021-12-20  369  		ak4375->rate, mclk, freq_in, freq_out, ak4375->pld, plm, mdiv, div);
53778b8292b549 Vincent Knecht 2021-12-20  370  
53778b8292b549 Vincent Knecht 2021-12-20  371  	return 0;
53778b8292b549 Vincent Knecht 2021-12-20  372  }
53778b8292b549 Vincent Knecht 2021-12-20  373  

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

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

end of thread, other threads:[~2022-01-28  5:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-15 15:02 sound/soc/codecs/ak4375.c:343:3: warning: Value stored to 'mclk' is never read [clang-analyzer-deadcode.DeadStores] kernel test robot
2022-01-28  0:14 kernel test robot
2022-01-28  5:00 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.