All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/crypto/qat/qat_4xxx/adf_drv.c:66:3: warning: Value stored to 'instances' is never read [clang-analyzer-deadcode.DeadStores]
@ 2022-05-18  6:15 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2022-05-18  6:15 UTC (permalink / raw)
  To: kbuild

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

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
CC: Herbert Xu <herbert@gondor.apana.org.au>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   210e04ff768142b96452030c4c2627512b30ad95
commit: 8893d27ffcaf6ec6267038a177cb87bcde4dd3de crypto: qat - disable registration of algorithms
date:   2 months ago
:::::: branch date: 6 hours ago
:::::: commit date: 2 months ago
config: x86_64-randconfig-c007-20220516 (https://download.01.org/0day-ci/archive/20220518/202205181417.mD5VBlsM-lkp(a)intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 853fa8ee225edf2d0de94b0dcbd31bea916e825e)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8893d27ffcaf6ec6267038a177cb87bcde4dd3de
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 8893d27ffcaf6ec6267038a177cb87bcde4dd3de
        # save the config file
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 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/scsi/qla4xxx/ql4_nx.c:3052:3: note: Assuming 'ql4xextended_error_logging' is equal to 2
                   DEBUG2(ql4_printk(KERN_INFO, ha,
                   ^
   drivers/scsi/qla4xxx/ql4_dbg.h:25:31: note: expanded from macro 'DEBUG2'
   #define DEBUG2(x)      do {if(ql4xextended_error_logging == 2) x;} while (0);
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/qla4xxx/ql4_nx.c:3052:3: note: Taking true branch
                   DEBUG2(ql4_printk(KERN_INFO, ha,
                   ^
   drivers/scsi/qla4xxx/ql4_dbg.h:25:28: note: expanded from macro 'DEBUG2'
   #define DEBUG2(x)      do {if(ql4xextended_error_logging == 2) x;} while (0);
                              ^
   drivers/scsi/qla4xxx/ql4_nx.c:3052:10: note: Loop condition is false.  Exiting loop
                   DEBUG2(ql4_printk(KERN_INFO, ha,
                          ^
   drivers/scsi/qla4xxx/ql4_def.h:118:2: note: expanded from macro 'ql4_printk'
           dev_printk(level , &((ha)->pdev->dev) , format , ## arg)
           ^
   include/linux/dev_printk.h:128:3: note: expanded from macro 'dev_printk'
                   dev_printk_index_emit(level, fmt);                      \
                   ^
   include/linux/dev_printk.h:105:2: note: expanded from macro 'dev_printk_index_emit'
           printk_index_subsys_emit("%s %s: ", level, fmt)
           ^
   include/linux/printk.h:413:2: note: expanded from macro 'printk_index_subsys_emit'
           __printk_index_emit(fmt, level, subsys_fmt_prefix)
           ^
   include/linux/printk.h:392:34: note: expanded from macro '__printk_index_emit'
   #define __printk_index_emit(...) do {} while (0)
                                    ^
   drivers/scsi/qla4xxx/ql4_nx.c:3052:3: note: Loop condition is false.  Exiting loop
                   DEBUG2(ql4_printk(KERN_INFO, ha,
                   ^
   drivers/scsi/qla4xxx/ql4_dbg.h:25:24: note: expanded from macro 'DEBUG2'
   #define DEBUG2(x)      do {if(ql4xextended_error_logging == 2) x;} while (0);
                          ^
   drivers/scsi/qla4xxx/ql4_nx.c:3060:3: note: Control jumps to 'case 39:'  at line 3163
                   switch (entry_hdr->entry_type) {
                   ^
   drivers/scsi/qla4xxx/ql4_nx.c:3164:11: note: Calling 'qla4_84xx_minidump_process_rdmdio'
                           rval = qla4_84xx_minidump_process_rdmdio(ha, entry_hdr,
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/qla4xxx/ql4_nx.c:2747:21: note: Assuming 'loop_cnt' is < 'count'
           for (loop_cnt = 0; loop_cnt < count; loop_cnt++) {
                              ^~~~~~~~~~~~~~~~
   drivers/scsi/qla4xxx/ql4_nx.c:2747:2: note: Loop condition is true.  Entering loop body
           for (loop_cnt = 0; loop_cnt < count; loop_cnt++) {
           ^
   drivers/scsi/qla4xxx/ql4_nx.c:2748:10: note: Calling 'ql4_84xx_poll_wait_ipmdio_bus_idle'
                   rval = ql4_84xx_poll_wait_ipmdio_bus_idle(ha, addr1, addr2,
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/qla4xxx/ql4_nx.c:1868:2: note: 'temp' declared without an initial value
           uint32_t temp;
           ^~~~~~~~~~~~~
   drivers/scsi/qla4xxx/ql4_nx.c:1873:3: note: Calling 'ql4_84xx_ipmdio_rd_reg'
                   ql4_84xx_ipmdio_rd_reg(ha, addr1, addr3, mask, addr2, &temp);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/qla4xxx/ql4_nx.c:1843:6: note: Assuming 'rval' is not equal to 0
           if (rval)
               ^~~~
   drivers/scsi/qla4xxx/ql4_nx.c:1843:2: note: Taking true branch
           if (rval)
           ^
   drivers/scsi/qla4xxx/ql4_nx.c:1844:3: note: Control jumps to line 1857
                   goto exit_ipmdio_rd_reg;
                   ^
   drivers/scsi/qla4xxx/ql4_nx.c:1857:2: note: Returning without writing to '*data_ptr'
           return rval;
           ^
   drivers/scsi/qla4xxx/ql4_nx.c:1873:3: note: Returning from 'ql4_84xx_ipmdio_rd_reg'
                   ql4_84xx_ipmdio_rd_reg(ha, addr1, addr3, mask, addr2, &temp);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/qla4xxx/ql4_nx.c:1874:13: note: The left operand of '&' is a garbage value
                   if ((temp & 0x1) != 1)
                        ~~~~ ^
   drivers/scsi/qla4xxx/ql4_nx.c:2300:4: warning: Value stored to 'opcode' is never read [clang-analyzer-deadcode.DeadStores]
                           opcode &= ~QLA8XXX_DBG_OPCODE_MDSTATE;
                           ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/qla4xxx/ql4_nx.c:2300:4: note: Value stored to 'opcode' is never read
                           opcode &= ~QLA8XXX_DBG_OPCODE_MDSTATE;
                           ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/qla4xxx/ql4_nx.c:2593:2: warning: Value stored to 'poll_wait' is never read [clang-analyzer-deadcode.DeadStores]
           poll_wait = le32_to_cpu(pollrd_hdr->poll_wait);
           ^
   drivers/scsi/qla4xxx/ql4_nx.c:2593:2: note: Value stored to 'poll_wait' is never read
   drivers/scsi/qla4xxx/ql4_nx.c:2739:2: warning: Value stored to 'stride2' is never read [clang-analyzer-deadcode.DeadStores]
           stride2 = le32_to_cpu(rdmdio->stride_2);
           ^
   drivers/scsi/qla4xxx/ql4_nx.c:2739:2: note: Value stored to 'stride2' is never read
   Suppressed 1 warnings (1 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.
   1 warning generated.
   drivers/crypto/qat/qat_common/adf_gen4_pfvf.c:46:9: warning: Although the value stored to 'sou' is used in the enclosing expression, the value is never actually read from 'sou' [clang-analyzer-deadcode.DeadStores]
           return sou &= ~mask;
                  ^      ~~~~~
   drivers/crypto/qat/qat_common/adf_gen4_pfvf.c:46:9: note: Although the value stored to 'sou' is used in the enclosing expression, the value is never actually read from 'sou'
           return sou &= ~mask;
                  ^      ~~~~~
   2 warnings generated.
>> drivers/crypto/qat/qat_4xxx/adf_drv.c:66:3: warning: Value stored to 'instances' is never read [clang-analyzer-deadcode.DeadStores]
                   instances = min(cpus, banks / 2);
                   ^
   drivers/crypto/qat/qat_4xxx/adf_drv.c:66:3: note: Value stored to 'instances' is never read
   drivers/crypto/qat/qat_4xxx/adf_drv.c:68:3: warning: Value stored to 'instances' is never read [clang-analyzer-deadcode.DeadStores]
                   instances = 0;
                   ^           ~
   drivers/crypto/qat/qat_4xxx/adf_drv.c:68:3: note: Value stored to 'instances' is never read
                   instances = 0;
                   ^           ~
   2 warnings generated.
   drivers/fsi/fsi-sbefifo.c:176:4: warning: Value stored to 'w0' is never read [clang-analyzer-deadcode.DeadStores]
                           w0 = ffdc_sz;
                           ^    ~~~~~~~
   drivers/fsi/fsi-sbefifo.c:176:4: note: Value stored to 'w0' is never read
                           w0 = ffdc_sz;
                           ^    ~~~~~~~
   drivers/fsi/fsi-sbefifo.c:682:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct device *dev = &sbefifo->fsi_dev->dev;
                          ^~~   ~~~~~~~~~~~~~~~~~~~~~~
   drivers/fsi/fsi-sbefifo.c:682:17: note: Value stored to 'dev' during its initialization is never read
           struct device *dev = &sbefifo->fsi_dev->dev;
                          ^~~   ~~~~~~~~~~~~~~~~~~~~~~
   2 warnings generated.
   drivers/tee/tee_core.c:202:9: warning: Value stored to 'grp' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           kgid_t grp = INVALID_GID;
                  ^~~
   drivers/tee/tee_core.c:202:9: note: Value stored to 'grp' during its initialization is never read
           kgid_t grp = INVALID_GID;
                  ^~~
   drivers/tee/tee_core.c:447:11: warning: Access to field 'attr' results in a dereference of a null pointer (loaded from variable 'p') [clang-analyzer-core.NullDereference]
                   switch (p->attr) {
                           ^
   drivers/tee/tee_core.c:826:2: note: Control jumps to 'case 2148574211:'  at line 835
           switch (cmd) {
           ^
   drivers/tee/tee_core.c:836:10: note: Calling 'tee_ioctl_invoke'
                   return tee_ioctl_invoke(ctx, uarg);
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/tee/tee_core.c:555:2: note: 'params' initialized to a null pointer value
           struct tee_param *params = NULL;
           ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/tee/tee_core.c:557:6: note: Assuming field 'invoke_func' is non-null
           if (!ctx->teedev->desc->ops->invoke_func)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/tee/tee_core.c:557:2: note: Taking false branch
           if (!ctx->teedev->desc->ops->invoke_func)
           ^
   drivers/tee/tee_core.c:560:6: note: Assuming the condition is false
           if (copy_from_user(&buf, ubuf, sizeof(buf)))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/tee/tee_core.c:560:2: note: Taking false branch
           if (copy_from_user(&buf, ubuf, sizeof(buf)))
           ^
   drivers/tee/tee_core.c:563:6: note: Assuming field 'buf_len' is <= TEE_MAX_ARG_SIZE
           if (buf.buf_len > TEE_MAX_ARG_SIZE ||
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/tee/tee_core.c:563:6: note: Left side of '||' is false
   drivers/tee/tee_core.c:564:6: note: Assuming the condition is false
               buf.buf_len < sizeof(struct tee_ioctl_invoke_arg))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/tee/tee_core.c:563:2: note: Taking false branch
           if (buf.buf_len > TEE_MAX_ARG_SIZE ||
           ^
   drivers/tee/tee_core.c:568:6: note: Calling 'copy_from_user'
           if (copy_from_user(&arg, uarg, sizeof(arg)))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/uaccess.h:191:2: note: Taking true branch
           if (likely(check_copy_size(to, n, false)))
           ^
   include/linux/uaccess.h:192:7: note: Value assigned to 'arg.num_params', which participates in a condition later
                   n = _copy_from_user(to, from, n);
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/tee/tee_core.c:568:6: note: Returning from 'copy_from_user'
           if (copy_from_user(&arg, uarg, sizeof(arg)))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/tee/tee_core.c:568:6: note: Assuming the condition is false
           if (copy_from_user(&arg, uarg, sizeof(arg)))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/tee/tee_core.c:568:2: note: Taking false branch
           if (copy_from_user(&arg, uarg, sizeof(arg)))
           ^
   drivers/tee/tee_core.c:571:6: note: Assuming the condition is false
           if (sizeof(arg) + TEE_IOCTL_PARAM_SIZE(arg.num_params) != buf.buf_len)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/tee/tee_core.c:571:2: note: Taking false branch
           if (sizeof(arg) + TEE_IOCTL_PARAM_SIZE(arg.num_params) != buf.buf_len)
           ^
   drivers/tee/tee_core.c:574:6: note: Assuming field 'num_params' is 0
           if (arg.num_params) {
               ^~~~~~~~~~~~~~
   drivers/tee/tee_core.c:574:2: note: Taking false branch
           if (arg.num_params) {
           ^
   drivers/tee/tee_core.c:586:6: note: Assuming 'rc' is 0
           if (rc)
               ^~
   drivers/tee/tee_core.c:586:2: note: Taking false branch
           if (rc)
           ^
   drivers/tee/tee_core.c:589:6: note: Assuming the condition is false
--
   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.
   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.
   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.
   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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
   drivers/bcma/main.c:674:3: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
                   err = 0;
                   ^     ~
   drivers/bcma/main.c:674:3: note: Value stored to 'err' is never read
                   err = 0;
                   ^     ~
   Suppressed 1 warnings (1 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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
   sound/drivers/opl3/opl3_lib.c:502: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(hw->name, hw->id);
           ^~~~~~
   sound/drivers/opl3/opl3_lib.c:502: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(hw->name, hw->id);
           ^~~~~~
   sound/drivers/opl3/opl3_lib.c:529: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(opl3->seq_dev->name, hw->name);
                   ^~~~~~
   sound/drivers/opl3/opl3_lib.c:529: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(opl3->seq_dev->name, hw->name);
                   ^~~~~~
   1 warning generated.
   Suppressed 1 warnings (1 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/intel/atom/sst-atom-controls.c:145: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(uinfo->value.enumerated.name,
           ^~~~~~
   sound/soc/intel/atom/sst-atom-controls.c:145: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(uinfo->value.enumerated.name,
           ^~~~~~
   sound/soc/intel/atom/sst-atom-controls.c:442:28: warning: Value stored to 'component' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
                                     ^~~~~~~~~
   sound/soc/intel/atom/sst-atom-controls.c:442:28: note: Value stored to 'component' during its initialization is never read
           struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
                                     ^~~~~~~~~
   Suppressed 1 warnings (1 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.
   1 warning generated.
   sound/soc/intel/atom/sst/sst_acpi.c:315: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(ctx->firmware_name, mach->fw_filename);
           ^~~~~~
   sound/soc/intel/atom/sst/sst_acpi.c:315: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(ctx->firmware_name, mach->fw_filename);
           ^~~~~~
   2 warnings generated.
>> drivers/crypto/qat/qat_common/qat_crypto.c:152:3: warning: Value stored to 'instances' is never read [clang-analyzer-deadcode.DeadStores]
                   instances = min(cpus, banks);
                   ^
   drivers/crypto/qat/qat_common/qat_crypto.c:152:3: note: Value stored to 'instances' is never read
   drivers/crypto/qat/qat_common/qat_crypto.c:154:3: warning: Value stored to 'instances' is never read [clang-analyzer-deadcode.DeadStores]
                   instances = 0;
                   ^           ~
   drivers/crypto/qat/qat_common/qat_crypto.c:154:3: note: Value stored to 'instances' is never read
                   instances = 0;
                   ^           ~
   1 warning generated.
   Suppressed 1 warnings (1 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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
   1 warning generated.
   sound/pci/oxygen/oxygen_pcm.c:758: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(pcm->name, outs ? "Front Panel" : "Analog 2");
                   ^~~~~~
   sound/pci/oxygen/oxygen_pcm.c:758: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(pcm->name, outs ? "Front Panel" : "Analog 2");
                   ^~~~~~
   1 warning generated.
   sound/soc/codecs/cs35l33.c:1161:3: warning: Value stored to 'pdata' is never read [clang-analyzer-deadcode.DeadStores]
                   pdata = &cs35l33->pdata;
                   ^       ~~~~~~~~~~~~~~~
   sound/soc/codecs/cs35l33.c:1161:3: note: Value stored to 'pdata' is never read
                   pdata = &cs35l33->pdata;
                   ^       ~~~~~~~~~~~~~~~
   1 warning 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,
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   5 warnings generated.
   drivers/vme/bridges/vme_fake.c:560:5: warning: Value stored to 'done' is never read [clang-analyzer-deadcode.DeadStores]
                                   done += 1;
                                   ^       ~
   drivers/vme/bridges/vme_fake.c:560:5: note: Value stored to 'done' is never read
                                   done += 1;
                                   ^       ~
   drivers/vme/bridges/vme_fake.c:604:3: warning: Value stored to 'done' is never read [clang-analyzer-deadcode.DeadStores]
                   done += 1;
                   ^       ~
   drivers/vme/bridges/vme_fake.c:604:3: note: Value stored to 'done' is never read
                   done += 1;
                   ^       ~
   drivers/vme/bridges/vme_fake.c:749:5: warning: Value stored to 'done' is never read [clang-analyzer-deadcode.DeadStores]
                                   done += 1;
                                   ^       ~
   drivers/vme/bridges/vme_fake.c:749:5: note: Value stored to 'done' is never read
                                   done += 1;
                                   ^       ~
   drivers/vme/bridges/vme_fake.c:794:3: warning: Value stored to 'done' is never read [clang-analyzer-deadcode.DeadStores]
                   done += 1;
                   ^       ~
   drivers/vme/bridges/vme_fake.c:794:3: note: Value stored to 'done' is never read
                   done += 1;
                   ^       ~
   drivers/vme/bridges/vme_fake.c:1104: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(fake_bridge->name, driver_name);
           ^~~~~~
   drivers/vme/bridges/vme_fake.c:1104: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(fake_bridge->name, driver_name);
           ^~~~~~
   1 warning generated.
   Suppressed 1 warnings (1 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 +/instances +66 drivers/crypto/qat/qat_4xxx/adf_drv.c

0cec19c761e5cc Tomasz Kowalik   2021-12-16   54  
8c8268166e8342 Giovanni Cabiddu 2020-11-13   55  static int adf_crypto_dev_config(struct adf_accel_dev *accel_dev)
8c8268166e8342 Giovanni Cabiddu 2020-11-13   56  {
8c8268166e8342 Giovanni Cabiddu 2020-11-13   57  	char key[ADF_CFG_MAX_KEY_LEN_IN_BYTES];
8c8268166e8342 Giovanni Cabiddu 2020-11-13   58  	int banks = GET_MAX_BANKS(accel_dev);
8c8268166e8342 Giovanni Cabiddu 2020-11-13   59  	int cpus = num_online_cpus();
8c8268166e8342 Giovanni Cabiddu 2020-11-13   60  	unsigned long bank, val;
8c8268166e8342 Giovanni Cabiddu 2020-11-13   61  	int instances;
8c8268166e8342 Giovanni Cabiddu 2020-11-13   62  	int ret;
8c8268166e8342 Giovanni Cabiddu 2020-11-13   63  	int i;
8c8268166e8342 Giovanni Cabiddu 2020-11-13   64  
8c8268166e8342 Giovanni Cabiddu 2020-11-13   65  	if (adf_hw_dev_has_crypto(accel_dev))
8c8268166e8342 Giovanni Cabiddu 2020-11-13  @66  		instances = min(cpus, banks / 2);
8c8268166e8342 Giovanni Cabiddu 2020-11-13   67  	else
8c8268166e8342 Giovanni Cabiddu 2020-11-13   68  		instances = 0;
8c8268166e8342 Giovanni Cabiddu 2020-11-13   69  
8c8268166e8342 Giovanni Cabiddu 2020-11-13   70  	ret = adf_cfg_section_add(accel_dev, ADF_KERNEL_SEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13   71  	if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13   72  		goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13   73  
8c8268166e8342 Giovanni Cabiddu 2020-11-13   74  	ret = adf_cfg_section_add(accel_dev, "Accelerator0");
8c8268166e8342 Giovanni Cabiddu 2020-11-13   75  	if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13   76  		goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13   77  
8893d27ffcaf6e Giovanni Cabiddu 2022-03-04   78  	/* Temporarily set the number of crypto instances to zero to avoid
8893d27ffcaf6e Giovanni Cabiddu 2022-03-04   79  	 * registering the crypto algorithms.
8893d27ffcaf6e Giovanni Cabiddu 2022-03-04   80  	 * This will be removed when the algorithms will support the
8893d27ffcaf6e Giovanni Cabiddu 2022-03-04   81  	 * CRYPTO_TFM_REQ_MAY_BACKLOG flag
8893d27ffcaf6e Giovanni Cabiddu 2022-03-04   82  	 */
8893d27ffcaf6e Giovanni Cabiddu 2022-03-04   83  	instances = 0;
8893d27ffcaf6e Giovanni Cabiddu 2022-03-04   84  
8c8268166e8342 Giovanni Cabiddu 2020-11-13   85  	for (i = 0; i < instances; i++) {
8c8268166e8342 Giovanni Cabiddu 2020-11-13   86  		val = i;
8c8268166e8342 Giovanni Cabiddu 2020-11-13   87  		bank = i * 2;
8c8268166e8342 Giovanni Cabiddu 2020-11-13   88  		snprintf(key, sizeof(key), ADF_CY "%d" ADF_RING_ASYM_BANK_NUM, i);
8c8268166e8342 Giovanni Cabiddu 2020-11-13   89  		ret = adf_cfg_add_key_value_param(accel_dev, ADF_KERNEL_SEC,
8c8268166e8342 Giovanni Cabiddu 2020-11-13   90  						  key, &bank, ADF_DEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13   91  		if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13   92  			goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13   93  
8c8268166e8342 Giovanni Cabiddu 2020-11-13   94  		bank += 1;
8c8268166e8342 Giovanni Cabiddu 2020-11-13   95  		snprintf(key, sizeof(key), ADF_CY "%d" ADF_RING_SYM_BANK_NUM, i);
8c8268166e8342 Giovanni Cabiddu 2020-11-13   96  		ret = adf_cfg_add_key_value_param(accel_dev, ADF_KERNEL_SEC,
8c8268166e8342 Giovanni Cabiddu 2020-11-13   97  						  key, &bank, ADF_DEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13   98  		if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13   99  			goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  100  
8c8268166e8342 Giovanni Cabiddu 2020-11-13  101  		snprintf(key, sizeof(key), ADF_CY "%d" ADF_ETRMGR_CORE_AFFINITY,
8c8268166e8342 Giovanni Cabiddu 2020-11-13  102  			 i);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  103  		ret = adf_cfg_add_key_value_param(accel_dev, ADF_KERNEL_SEC,
8c8268166e8342 Giovanni Cabiddu 2020-11-13  104  						  key, &val, ADF_DEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  105  		if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13  106  			goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  107  
8c8268166e8342 Giovanni Cabiddu 2020-11-13  108  		snprintf(key, sizeof(key), ADF_CY "%d" ADF_RING_ASYM_SIZE, i);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  109  		val = 128;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  110  		ret = adf_cfg_add_key_value_param(accel_dev, ADF_KERNEL_SEC,
8c8268166e8342 Giovanni Cabiddu 2020-11-13  111  						  key, &val, ADF_DEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  112  		if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13  113  			goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  114  
8c8268166e8342 Giovanni Cabiddu 2020-11-13  115  		val = 512;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  116  		snprintf(key, sizeof(key), ADF_CY "%d" ADF_RING_SYM_SIZE, i);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  117  		ret = adf_cfg_add_key_value_param(accel_dev, ADF_KERNEL_SEC,
8c8268166e8342 Giovanni Cabiddu 2020-11-13  118  						  key, &val, ADF_DEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  119  		if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13  120  			goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  121  
8c8268166e8342 Giovanni Cabiddu 2020-11-13  122  		val = 0;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  123  		snprintf(key, sizeof(key), ADF_CY "%d" ADF_RING_ASYM_TX, i);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  124  		ret = adf_cfg_add_key_value_param(accel_dev, ADF_KERNEL_SEC,
8c8268166e8342 Giovanni Cabiddu 2020-11-13  125  						  key, &val, ADF_DEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  126  		if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13  127  			goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  128  
8c8268166e8342 Giovanni Cabiddu 2020-11-13  129  		val = 0;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  130  		snprintf(key, sizeof(key), ADF_CY "%d" ADF_RING_SYM_TX, i);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  131  		ret = adf_cfg_add_key_value_param(accel_dev, ADF_KERNEL_SEC,
8c8268166e8342 Giovanni Cabiddu 2020-11-13  132  						  key, &val, ADF_DEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  133  		if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13  134  			goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  135  
8c8268166e8342 Giovanni Cabiddu 2020-11-13  136  		val = 1;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  137  		snprintf(key, sizeof(key), ADF_CY "%d" ADF_RING_ASYM_RX, i);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  138  		ret = adf_cfg_add_key_value_param(accel_dev, ADF_KERNEL_SEC,
8c8268166e8342 Giovanni Cabiddu 2020-11-13  139  						  key, &val, ADF_DEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  140  		if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13  141  			goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  142  
8c8268166e8342 Giovanni Cabiddu 2020-11-13  143  		val = 1;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  144  		snprintf(key, sizeof(key), ADF_CY "%d" ADF_RING_SYM_RX, i);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  145  		ret = adf_cfg_add_key_value_param(accel_dev, ADF_KERNEL_SEC,
8c8268166e8342 Giovanni Cabiddu 2020-11-13  146  						  key, &val, ADF_DEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  147  		if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13  148  			goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  149  
8c8268166e8342 Giovanni Cabiddu 2020-11-13  150  		val = ADF_COALESCING_DEF_TIME;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  151  		snprintf(key, sizeof(key), ADF_ETRMGR_COALESCE_TIMER_FORMAT, i);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  152  		ret = adf_cfg_add_key_value_param(accel_dev, "Accelerator0",
8c8268166e8342 Giovanni Cabiddu 2020-11-13  153  						  key, &val, ADF_DEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  154  		if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13  155  			goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  156  	}
8c8268166e8342 Giovanni Cabiddu 2020-11-13  157  
8c8268166e8342 Giovanni Cabiddu 2020-11-13  158  	val = i;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  159  	ret = adf_cfg_add_key_value_param(accel_dev, ADF_KERNEL_SEC, ADF_NUM_CY,
8c8268166e8342 Giovanni Cabiddu 2020-11-13  160  					  &val, ADF_DEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  161  	if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13  162  		goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  163  
8c8268166e8342 Giovanni Cabiddu 2020-11-13  164  	set_bit(ADF_STATUS_CONFIGURED, &accel_dev->status);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  165  	return 0;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  166  err:
8c8268166e8342 Giovanni Cabiddu 2020-11-13  167  	dev_err(&GET_DEV(accel_dev), "Failed to start QAT accel dev\n");
8c8268166e8342 Giovanni Cabiddu 2020-11-13  168  	return ret;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  169  }
8c8268166e8342 Giovanni Cabiddu 2020-11-13  170  

:::::: The code at line 66 was first introduced by commit
:::::: 8c8268166e83425243789c5781c92e7fa33b703b crypto: qat - add qat_4xxx driver

:::::: TO: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
:::::: CC: Herbert Xu <herbert@gondor.apana.org.au>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

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

* drivers/crypto/qat/qat_4xxx/adf_drv.c:66:3: warning: Value stored to 'instances' is never read [clang-analyzer-deadcode.DeadStores]
@ 2022-04-15 19:58 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2022-04-15 19:58 UTC (permalink / raw)
  To: kbuild

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

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
CC: Herbert Xu <herbert@gondor.apana.org.au>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   028192fea1de083f4f12bfb1eb7c4d7beb5c8ecd
commit: 8893d27ffcaf6ec6267038a177cb87bcde4dd3de crypto: qat - disable registration of algorithms
date:   5 weeks ago
:::::: branch date: 20 hours ago
:::::: commit date: 5 weeks ago
config: x86_64-randconfig-c007-20220411 (https://download.01.org/0day-ci/archive/20220416/202204160333.IELFF12V-lkp(a)intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project c6e83f560f06cdfe8aa47b248d8bdc58f947274b)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8893d27ffcaf6ec6267038a177cb87bcde4dd3de
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 8893d27ffcaf6ec6267038a177cb87bcde4dd3de
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 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/rwonce.h:60:2: note: expanded from macro 'WRITE_ONCE'
           compiletime_assert_rwonce_type(x);                              \
           ^
   include/asm-generic/rwonce.h:36:21: note: expanded from macro 'compiletime_assert_rwonce_type'
           compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
                              ^
   include/linux/compiler_types.h:313:3: note: expanded from macro '__native_word'
           (sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || \
            ^
   include/linux/skbuff.h:2167:2: note: Left side of '||' is false
           WRITE_ONCE(next->prev, prev);
           ^
   include/asm-generic/rwonce.h:60:2: note: expanded from macro 'WRITE_ONCE'
           compiletime_assert_rwonce_type(x);                              \
           ^
   include/asm-generic/rwonce.h:36:21: note: expanded from macro 'compiletime_assert_rwonce_type'
           compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
                              ^
   include/linux/compiler_types.h:313:3: note: expanded from macro '__native_word'
           (sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || \
            ^
   include/linux/skbuff.h:2167:2: note: Left side of '||' is false
           WRITE_ONCE(next->prev, prev);
           ^
   include/asm-generic/rwonce.h:60:2: note: expanded from macro 'WRITE_ONCE'
           compiletime_assert_rwonce_type(x);                              \
           ^
   include/asm-generic/rwonce.h:36:21: note: expanded from macro 'compiletime_assert_rwonce_type'
           compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
                              ^
   include/linux/compiler_types.h:313:3: note: expanded from macro '__native_word'
           (sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || \
            ^
   include/linux/skbuff.h:2167:2: note: Left side of '||' is true
           WRITE_ONCE(next->prev, prev);
           ^
   include/asm-generic/rwonce.h:60:2: note: expanded from macro 'WRITE_ONCE'
           compiletime_assert_rwonce_type(x);                              \
           ^
   include/asm-generic/rwonce.h:36:38: note: expanded from macro 'compiletime_assert_rwonce_type'
           compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
                                               ^
   include/linux/skbuff.h:2167:2: note: Taking false branch
           WRITE_ONCE(next->prev, prev);
           ^
   include/asm-generic/rwonce.h:60:2: note: expanded from macro 'WRITE_ONCE'
           compiletime_assert_rwonce_type(x);                              \
           ^
   include/asm-generic/rwonce.h:36:2: note: expanded from macro 'compiletime_assert_rwonce_type'
           compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
           ^
   include/linux/compiler_types.h:346:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:334:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:326:3: note: expanded from macro '__compiletime_assert'
                   if (!(condition))                                       \
                   ^
   include/linux/skbuff.h:2167:2: note: Loop condition is false.  Exiting loop
           WRITE_ONCE(next->prev, prev);
           ^
   include/asm-generic/rwonce.h:60:2: note: expanded from macro 'WRITE_ONCE'
           compiletime_assert_rwonce_type(x);                              \
           ^
   include/asm-generic/rwonce.h:36:2: note: expanded from macro 'compiletime_assert_rwonce_type'
           compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
           ^
   include/linux/compiler_types.h:346:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:334:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:318:2: note: expanded from macro '__compiletime_assert'
           do {                                                            \
           ^
   include/linux/skbuff.h:2167:2: note: Dereference of null pointer
           WRITE_ONCE(next->prev, prev);
           ^
   include/asm-generic/rwonce.h:61:2: note: expanded from macro 'WRITE_ONCE'
           __WRITE_ONCE(x, val);                                           \
           ^~~~~~~~~~~~~~~~~~~~
   include/asm-generic/rwonce.h:55:30: note: expanded from macro '__WRITE_ONCE'
           *(volatile typeof(x) *)&(x) = (val);                            \
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
   2 warnings generated.
   drivers/mtd/devices/block2mtd.c:402: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(str, val);
           ^~~~~~
   drivers/mtd/devices/block2mtd.c:402: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(str, val);
           ^~~~~~
   Suppressed 1 warnings (1 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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
>> drivers/crypto/qat/qat_4xxx/adf_drv.c:66:3: warning: Value stored to 'instances' is never read [clang-analyzer-deadcode.DeadStores]
                   instances = min(cpus, banks / 2);
                   ^
   drivers/crypto/qat/qat_4xxx/adf_drv.c:66:3: note: Value stored to 'instances' is never read
   drivers/crypto/qat/qat_4xxx/adf_drv.c:68:3: warning: Value stored to 'instances' is never read [clang-analyzer-deadcode.DeadStores]
                   instances = 0;
                   ^           ~
   drivers/crypto/qat/qat_4xxx/adf_drv.c:68:3: note: Value stored to 'instances' is never read
                   instances = 0;
                   ^           ~
   2 warnings generated.
   Suppressed 2 warnings (1 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.
   2 warnings generated.
   Suppressed 2 warnings (1 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.
   2 warnings generated.
   Suppressed 2 warnings (1 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.
   2 warnings generated.
   fs/cifs/ioctl.c:334:4: warning: Value stored to 'caps' is never read [clang-analyzer-deadcode.DeadStores]
                           caps = le64_to_cpu(tcon->fsUnixInfo.Capability);
                           ^
   fs/cifs/ioctl.c:334:4: note: Value stored to 'caps' is never read
   Suppressed 1 warnings (1 with check filters).
   1 warning generated.
   Suppressed 1 warnings (1 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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
   fs/nfs/nfs4session.c:127:10: warning: The left operand of '==' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
                   if (*p == NULL) {
                          ^
   fs/nfs/nfs4session.c:405:2: note: Loop condition is true.  Entering loop body
           for (;;) {
           ^
   fs/nfs/nfs4session.c:406:8: note: Calling 'nfs41_try_wake_next_slot_table_entry'
                   if (!nfs41_try_wake_next_slot_table_entry(tbl))
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/nfs/nfs4session.c:393:27: note: Calling 'nfs4_alloc_slot'
           struct nfs4_slot *slot = nfs4_alloc_slot(tbl);
                                    ^~~~~~~~~~~~~~~~~~~~
   fs/nfs/nfs4session.c:247:2: note: Loop condition is false.  Exiting loop
           dprintk("--> %s used_slots=%04lx highest_used=%u max_slots=%u\n",
           ^
   include/linux/sunrpc/debug.h:25:2: note: expanded from macro 'dprintk'
           dfprintk(FACILITY, fmt, ##__VA_ARGS__)
           ^
   include/linux/sunrpc/debug.h:70:34: note: expanded from macro 'dfprintk'
   # define dfprintk(fac, fmt, ...)        do {} while (0)
                                           ^
   fs/nfs/nfs4session.c:251:6: note: Assuming 'slotid' is <= field 'max_slotid'
           if (slotid <= tbl->max_slotid) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~
   fs/nfs/nfs4session.c:251:2: note: Taking true branch
           if (slotid <= tbl->max_slotid) {
           ^
   fs/nfs/nfs4session.c:252:9: note: Calling 'nfs4_find_or_create_slot'
                   ret = nfs4_find_or_create_slot(tbl, slotid, 1, GFP_NOWAIT);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/nfs/nfs4session.c:126:2: note: Loop condition is true.  Entering loop body
           for (;;) {
           ^
   fs/nfs/nfs4session.c:127:7: note: Assuming the condition is true
                   if (*p == NULL) {
                       ^~~~~~~~~~
   fs/nfs/nfs4session.c:127:3: note: Taking true branch
                   if (*p == NULL) {
                   ^
   fs/nfs/nfs4session.c:128:9: note: Calling 'nfs4_new_slot'
                           *p = nfs4_new_slot(tbl, tbl->max_slots,
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/nfs/nfs4session.c:109:9: note: Calling 'kzalloc'
           slot = kzalloc(sizeof(*slot), gfp_mask);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/slab.h:715:9: note: Uninitialized value stored to field 'next'
           return kmalloc(size, flags | __GFP_ZERO);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/nfs/nfs4session.c:109:9: note: Returning from 'kzalloc'
           slot = kzalloc(sizeof(*slot), gfp_mask);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/nfs/nfs4session.c:110:6: note: Assuming 'slot' is non-null
           if (slot) {
               ^~~~
   fs/nfs/nfs4session.c:110:2: note: Taking true branch
           if (slot) {
           ^
   fs/nfs/nfs4session.c:128:9: note: Returning from 'nfs4_new_slot'
                           *p = nfs4_new_slot(tbl, tbl->max_slots,
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/nfs/nfs4session.c:130:4: note: Taking false branch
                           if (*p == NULL)
                           ^
   fs/nfs/nfs4session.c:135:7: note: Assuming 'slotid' is not equal to field 'slot_nr'
                   if (slot->slot_nr == slotid)
                       ^~~~~~~~~~~~~~~~~~~~~~~
   fs/nfs/nfs4session.c:135:3: note: Taking false branch
                   if (slot->slot_nr == slotid)
                   ^
--
   drivers/media/tuners/mt20xx.c:395:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
           ret=tuner_i2c_xfer_send(&priv->i2c_props,buf+12,2);
           ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/tuners/mt20xx.c:395:2: note: Value stored to 'ret' is never read
           ret=tuner_i2c_xfer_send(&priv->i2c_props,buf+12,2);
           ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.
   Suppressed 1 warnings (1 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.
   drivers/comedi/drivers/mite.c:686:13: warning: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'desc') [clang-analyzer-core.NullDereference]
           desc->next = cpu_to_le32(ring->dma_addr);
                      ^
   drivers/comedi/drivers/mite.c:724:6: note: Assuming field 'prealloc_bufsz' is not equal to 0
           if (async->prealloc_bufsz == 0)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/comedi/drivers/mite.c:724:2: note: Taking false branch
           if (async->prealloc_bufsz == 0)
           ^
   drivers/comedi/drivers/mite.c:732:6: note: Assuming 'descs' is non-null
           if (!descs) {
               ^~~~~~
   drivers/comedi/drivers/mite.c:732:2: note: Taking false branch
           if (!descs) {
           ^
   drivers/comedi/drivers/mite.c:740:9: note: Calling 'mite_init_ring_descriptors'
           return mite_init_ring_descriptors(ring, s, n_links << PAGE_SHIFT);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/comedi/drivers/mite.c:654:2: note: 'desc' initialized to a null pointer value
           struct mite_dma_desc *desc = NULL;
           ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/comedi/drivers/mite.c:659:2: note: Taking false branch
           dev_dbg(s->device->class_dev,
           ^
   include/linux/dev_printk.h:162:2: note: expanded from macro 'dev_dbg'
           if (0)                                                          \
           ^
   drivers/comedi/drivers/mite.c:662:23: note: Assuming 'remainder' is <= 0
           if ((n_full_links + (remainder > 0 ? 1 : 0)) > ring->n_links) {
                                ^~~~~~~~~~~~~
   drivers/comedi/drivers/mite.c:662:23: note: '?' condition is false
   drivers/comedi/drivers/mite.c:662:6: note: Assuming the condition is false
           if ((n_full_links + (remainder > 0 ? 1 : 0)) > ring->n_links) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/comedi/drivers/mite.c:662:2: note: Taking false branch
           if ((n_full_links + (remainder > 0 ? 1 : 0)) > ring->n_links) {
           ^
   drivers/comedi/drivers/mite.c:669:14: note: Assuming 'i' is >= 'n_full_links'
           for (i = 0; i < n_full_links; ++i) {
                       ^~~~~~~~~~~~~~~~
   drivers/comedi/drivers/mite.c:669:2: note: Loop condition is false. Execution continues on line 678
           for (i = 0; i < n_full_links; ++i) {
           ^
   drivers/comedi/drivers/mite.c:678:6: note: 'remainder' is <= 0
           if (remainder > 0) {
               ^~~~~~~~~
   drivers/comedi/drivers/mite.c:678:2: note: Taking false branch
           if (remainder > 0) {
           ^
   drivers/comedi/drivers/mite.c:686:13: note: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'desc')
           desc->next = cpu_to_le32(ring->dma_addr);
           ~~~~       ^
   drivers/comedi/drivers/mite.c:841:3: warning: Value stored to 'wpdep' is never read [clang-analyzer-deadcode.DeadStores]
                   wpdep = BIT(wpdep);
                   ^
   drivers/comedi/drivers/mite.c:841:3: note: Value stored to 'wpdep' is never read
   1 warning generated.
   Suppressed 1 warnings (1 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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
   drivers/extcon/extcon-ptn5150.c:173:2: warning: Value stored to 'vendor_id' is never read [clang-analyzer-deadcode.DeadStores]
           vendor_id = FIELD_GET(PTN5150_REG_DEVICE_ID_VENDOR, reg_data);
           ^
   drivers/extcon/extcon-ptn5150.c:173:2: note: Value stored to 'vendor_id' is never read
   drivers/extcon/extcon-ptn5150.c:174:2: warning: Value stored to 'version_id' is never read [clang-analyzer-deadcode.DeadStores]
           version_id = FIELD_GET(PTN5150_REG_DEVICE_ID_VERSION, reg_data);
           ^
   drivers/extcon/extcon-ptn5150.c:174:2: note: Value stored to 'version_id' is never read
   1 warning generated.
   drivers/extcon/extcon-sm5502.c:24:8: warning: Excessive padding in 'struct muic_irq' (8 padding bytes, where 0 is optimal). 
   Optimal fields order: 
   name, 
   irq, 
   virq, 
   consider reordering the fields or adding explicit padding members [clang-analyzer-optin.performance.Padding]
   struct muic_irq {
   ~~~~~~~^~~~~~~~~~
   drivers/extcon/extcon-sm5502.c:24:8: note: Excessive padding in 'struct muic_irq' (8 padding bytes, where 0 is optimal). Optimal fields order: name, irq, virq, consider reordering the fields or adding explicit padding members
   struct muic_irq {
   ~~~~~~~^~~~~~~~~~
   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.
>> drivers/crypto/qat/qat_common/qat_crypto.c:152:3: warning: Value stored to 'instances' is never read [clang-analyzer-deadcode.DeadStores]
                   instances = min(cpus, banks);
                   ^
   drivers/crypto/qat/qat_common/qat_crypto.c:152:3: note: Value stored to 'instances' is never read
   drivers/crypto/qat/qat_common/qat_crypto.c:154:3: warning: Value stored to 'instances' is never read [clang-analyzer-deadcode.DeadStores]
                   instances = 0;
                   ^           ~
   drivers/crypto/qat/qat_common/qat_crypto.c:154:3: note: Value stored to 'instances' is never read
                   instances = 0;
                   ^           ~
   1 warning generated.
   Suppressed 1 warnings (1 with check filters).
   1 warning generated.
   drivers/media/mc/mc-request.c:190:23: warning: Value stored to 'mdev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct media_device *mdev = req->mdev;
                                ^~~~   ~~~~~~~~~
   drivers/media/mc/mc-request.c:190:23: note: Value stored to 'mdev' during its initialization is never read
           struct media_device *mdev = req->mdev;
                                ^~~~   ~~~~~~~~~
   2 warnings generated.
   drivers/media/v4l2-core/v4l2-dev.c:1053:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
           ret = video_register_media_controller(vdev);
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/v4l2-core/v4l2-dev.c:1053:2: note: Value stored to 'ret' is never read
           ret = video_register_media_controller(vdev);
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 1 warnings (1 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.
   drivers/media/v4l2-core/v4l2-ioctl.c:3311:3: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
                   err = -EFAULT;
                   ^     ~~~~~~~
   drivers/media/v4l2-core/v4l2-ioctl.c:3311:3: note: Value stored to 'err' is never read
                   err = -EFAULT;
                   ^     ~~~~~~~
   Suppressed 1 warnings (1 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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
   1 warning generated.
   drivers/hwmon/adm1026.c:1574:6: warning: Value stored to 'address' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           int address = client->addr;
               ^~~~~~~   ~~~~~~~~~~~~
   drivers/hwmon/adm1026.c:1574:6: note: Value stored to 'address' during its initialization is never read
           int address = client->addr;
               ^~~~~~~   ~~~~~~~~~~~~
   4 warnings generated.
   drivers/mtd/inftlmount.c:550:2: warning: Value stored to 'logical_block' is never read [clang-analyzer-deadcode.DeadStores]
           logical_block = block = BLOCK_NIL;
           ^               ~~~~~~~~~~~~~~~~~
   drivers/mtd/inftlmount.c:550:2: note: Value stored to 'logical_block' is never read
           logical_block = block = BLOCK_NIL;
           ^               ~~~~~~~~~~~~~~~~~
   drivers/mtd/inftlmount.c:550:18: warning: Although the value stored to 'block' is used in the enclosing expression, the value is never actually read from 'block' [clang-analyzer-deadcode.DeadStores]
           logical_block = block = BLOCK_NIL;
                           ^
   drivers/mtd/inftlmount.c:550:18: note: Although the value stored to 'block' is used in the enclosing expression, the value is never actually read from 'block'
   drivers/mtd/inftlmount.c:693:3: warning: Value stored to 'logical_block' is never read [clang-analyzer-deadcode.DeadStores]
                   logical_block = BLOCK_NIL;
                   ^
   drivers/mtd/inftlmount.c:693:3: note: Value stored to 'logical_block' is never read
   Suppressed 1 warnings (1 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.
   1 warning generated.
   fs/btrfs/free-space-tree.c:1476:3: warning: Value stored to 'total_found' is never read [clang-analyzer-deadcode.DeadStores]
                   total_found += add_new_free_space(block_group, extent_start,
                   ^              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/btrfs/free-space-tree.c:1476:3: note: Value stored to 'total_found' is never read
                   total_found += add_new_free_space(block_group, extent_start,
                   ^              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.
   fs/btrfs/space-info.c:1565:3: warning: Value stored to 'used' is never read [clang-analyzer-deadcode.DeadStores]
                   used += orig_bytes;
                   ^       ~~~~~~~~~~
   fs/btrfs/space-info.c:1565:3: note: Value stored to 'used' is never read
                   used += orig_bytes;
                   ^       ~~~~~~~~~~
   1 warning generated.
   drivers/crypto/qat/qat_common/adf_gen4_pfvf.c:46:9: warning: Although the value stored to 'sou' is used in the enclosing expression, the value is never actually read from 'sou' [clang-analyzer-deadcode.DeadStores]
           return sou &= ~mask;
                  ^      ~~~~~
   drivers/crypto/qat/qat_common/adf_gen4_pfvf.c:46:9: note: Although the value stored to 'sou' is used in the enclosing expression, the value is never actually read from 'sou'
           return sou &= ~mask;
                  ^      ~~~~~
   5 warnings generated.
   drivers/scsi/snic/snic_scsi.c:519:4: warning: Value stored to 'xfer_len' is never read [clang-analyzer-deadcode.DeadStores]
                           xfer_len -= le32_to_cpu(icmnd_cmpl->resid);
                           ^
   drivers/scsi/snic/snic_scsi.c:519:4: note: Value stored to 'xfer_len' is never read
   drivers/scsi/snic/snic_scsi.c:1890:3: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
                   ret = FAILED;
                   ^     ~~~~~~
   drivers/scsi/snic/snic_scsi.c:1890:3: note: Value stored to 'ret' is never read
                   ret = FAILED;

vim +/instances +66 drivers/crypto/qat/qat_4xxx/adf_drv.c

0cec19c761e5cc Tomasz Kowalik   2021-12-16   54  
8c8268166e8342 Giovanni Cabiddu 2020-11-13   55  static int adf_crypto_dev_config(struct adf_accel_dev *accel_dev)
8c8268166e8342 Giovanni Cabiddu 2020-11-13   56  {
8c8268166e8342 Giovanni Cabiddu 2020-11-13   57  	char key[ADF_CFG_MAX_KEY_LEN_IN_BYTES];
8c8268166e8342 Giovanni Cabiddu 2020-11-13   58  	int banks = GET_MAX_BANKS(accel_dev);
8c8268166e8342 Giovanni Cabiddu 2020-11-13   59  	int cpus = num_online_cpus();
8c8268166e8342 Giovanni Cabiddu 2020-11-13   60  	unsigned long bank, val;
8c8268166e8342 Giovanni Cabiddu 2020-11-13   61  	int instances;
8c8268166e8342 Giovanni Cabiddu 2020-11-13   62  	int ret;
8c8268166e8342 Giovanni Cabiddu 2020-11-13   63  	int i;
8c8268166e8342 Giovanni Cabiddu 2020-11-13   64  
8c8268166e8342 Giovanni Cabiddu 2020-11-13   65  	if (adf_hw_dev_has_crypto(accel_dev))
8c8268166e8342 Giovanni Cabiddu 2020-11-13  @66  		instances = min(cpus, banks / 2);
8c8268166e8342 Giovanni Cabiddu 2020-11-13   67  	else
8c8268166e8342 Giovanni Cabiddu 2020-11-13   68  		instances = 0;
8c8268166e8342 Giovanni Cabiddu 2020-11-13   69  
8c8268166e8342 Giovanni Cabiddu 2020-11-13   70  	ret = adf_cfg_section_add(accel_dev, ADF_KERNEL_SEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13   71  	if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13   72  		goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13   73  
8c8268166e8342 Giovanni Cabiddu 2020-11-13   74  	ret = adf_cfg_section_add(accel_dev, "Accelerator0");
8c8268166e8342 Giovanni Cabiddu 2020-11-13   75  	if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13   76  		goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13   77  
8893d27ffcaf6e Giovanni Cabiddu 2022-03-04   78  	/* Temporarily set the number of crypto instances to zero to avoid
8893d27ffcaf6e Giovanni Cabiddu 2022-03-04   79  	 * registering the crypto algorithms.
8893d27ffcaf6e Giovanni Cabiddu 2022-03-04   80  	 * This will be removed when the algorithms will support the
8893d27ffcaf6e Giovanni Cabiddu 2022-03-04   81  	 * CRYPTO_TFM_REQ_MAY_BACKLOG flag
8893d27ffcaf6e Giovanni Cabiddu 2022-03-04   82  	 */
8893d27ffcaf6e Giovanni Cabiddu 2022-03-04   83  	instances = 0;
8893d27ffcaf6e Giovanni Cabiddu 2022-03-04   84  
8c8268166e8342 Giovanni Cabiddu 2020-11-13   85  	for (i = 0; i < instances; i++) {
8c8268166e8342 Giovanni Cabiddu 2020-11-13   86  		val = i;
8c8268166e8342 Giovanni Cabiddu 2020-11-13   87  		bank = i * 2;
8c8268166e8342 Giovanni Cabiddu 2020-11-13   88  		snprintf(key, sizeof(key), ADF_CY "%d" ADF_RING_ASYM_BANK_NUM, i);
8c8268166e8342 Giovanni Cabiddu 2020-11-13   89  		ret = adf_cfg_add_key_value_param(accel_dev, ADF_KERNEL_SEC,
8c8268166e8342 Giovanni Cabiddu 2020-11-13   90  						  key, &bank, ADF_DEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13   91  		if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13   92  			goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13   93  
8c8268166e8342 Giovanni Cabiddu 2020-11-13   94  		bank += 1;
8c8268166e8342 Giovanni Cabiddu 2020-11-13   95  		snprintf(key, sizeof(key), ADF_CY "%d" ADF_RING_SYM_BANK_NUM, i);
8c8268166e8342 Giovanni Cabiddu 2020-11-13   96  		ret = adf_cfg_add_key_value_param(accel_dev, ADF_KERNEL_SEC,
8c8268166e8342 Giovanni Cabiddu 2020-11-13   97  						  key, &bank, ADF_DEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13   98  		if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13   99  			goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  100  
8c8268166e8342 Giovanni Cabiddu 2020-11-13  101  		snprintf(key, sizeof(key), ADF_CY "%d" ADF_ETRMGR_CORE_AFFINITY,
8c8268166e8342 Giovanni Cabiddu 2020-11-13  102  			 i);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  103  		ret = adf_cfg_add_key_value_param(accel_dev, ADF_KERNEL_SEC,
8c8268166e8342 Giovanni Cabiddu 2020-11-13  104  						  key, &val, ADF_DEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  105  		if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13  106  			goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  107  
8c8268166e8342 Giovanni Cabiddu 2020-11-13  108  		snprintf(key, sizeof(key), ADF_CY "%d" ADF_RING_ASYM_SIZE, i);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  109  		val = 128;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  110  		ret = adf_cfg_add_key_value_param(accel_dev, ADF_KERNEL_SEC,
8c8268166e8342 Giovanni Cabiddu 2020-11-13  111  						  key, &val, ADF_DEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  112  		if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13  113  			goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  114  
8c8268166e8342 Giovanni Cabiddu 2020-11-13  115  		val = 512;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  116  		snprintf(key, sizeof(key), ADF_CY "%d" ADF_RING_SYM_SIZE, i);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  117  		ret = adf_cfg_add_key_value_param(accel_dev, ADF_KERNEL_SEC,
8c8268166e8342 Giovanni Cabiddu 2020-11-13  118  						  key, &val, ADF_DEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  119  		if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13  120  			goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  121  
8c8268166e8342 Giovanni Cabiddu 2020-11-13  122  		val = 0;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  123  		snprintf(key, sizeof(key), ADF_CY "%d" ADF_RING_ASYM_TX, i);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  124  		ret = adf_cfg_add_key_value_param(accel_dev, ADF_KERNEL_SEC,
8c8268166e8342 Giovanni Cabiddu 2020-11-13  125  						  key, &val, ADF_DEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  126  		if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13  127  			goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  128  
8c8268166e8342 Giovanni Cabiddu 2020-11-13  129  		val = 0;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  130  		snprintf(key, sizeof(key), ADF_CY "%d" ADF_RING_SYM_TX, i);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  131  		ret = adf_cfg_add_key_value_param(accel_dev, ADF_KERNEL_SEC,
8c8268166e8342 Giovanni Cabiddu 2020-11-13  132  						  key, &val, ADF_DEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  133  		if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13  134  			goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  135  
8c8268166e8342 Giovanni Cabiddu 2020-11-13  136  		val = 1;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  137  		snprintf(key, sizeof(key), ADF_CY "%d" ADF_RING_ASYM_RX, i);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  138  		ret = adf_cfg_add_key_value_param(accel_dev, ADF_KERNEL_SEC,
8c8268166e8342 Giovanni Cabiddu 2020-11-13  139  						  key, &val, ADF_DEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  140  		if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13  141  			goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  142  
8c8268166e8342 Giovanni Cabiddu 2020-11-13  143  		val = 1;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  144  		snprintf(key, sizeof(key), ADF_CY "%d" ADF_RING_SYM_RX, i);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  145  		ret = adf_cfg_add_key_value_param(accel_dev, ADF_KERNEL_SEC,
8c8268166e8342 Giovanni Cabiddu 2020-11-13  146  						  key, &val, ADF_DEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  147  		if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13  148  			goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  149  
8c8268166e8342 Giovanni Cabiddu 2020-11-13  150  		val = ADF_COALESCING_DEF_TIME;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  151  		snprintf(key, sizeof(key), ADF_ETRMGR_COALESCE_TIMER_FORMAT, i);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  152  		ret = adf_cfg_add_key_value_param(accel_dev, "Accelerator0",
8c8268166e8342 Giovanni Cabiddu 2020-11-13  153  						  key, &val, ADF_DEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  154  		if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13  155  			goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  156  	}
8c8268166e8342 Giovanni Cabiddu 2020-11-13  157  
8c8268166e8342 Giovanni Cabiddu 2020-11-13  158  	val = i;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  159  	ret = adf_cfg_add_key_value_param(accel_dev, ADF_KERNEL_SEC, ADF_NUM_CY,
8c8268166e8342 Giovanni Cabiddu 2020-11-13  160  					  &val, ADF_DEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  161  	if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13  162  		goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  163  
8c8268166e8342 Giovanni Cabiddu 2020-11-13  164  	set_bit(ADF_STATUS_CONFIGURED, &accel_dev->status);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  165  	return 0;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  166  err:
8c8268166e8342 Giovanni Cabiddu 2020-11-13  167  	dev_err(&GET_DEV(accel_dev), "Failed to start QAT accel dev\n");
8c8268166e8342 Giovanni Cabiddu 2020-11-13  168  	return ret;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  169  }
8c8268166e8342 Giovanni Cabiddu 2020-11-13  170  

:::::: The code at line 66 was first introduced by commit
:::::: 8c8268166e83425243789c5781c92e7fa33b703b crypto: qat - add qat_4xxx driver

:::::: TO: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
:::::: CC: Herbert Xu <herbert@gondor.apana.org.au>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

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

* drivers/crypto/qat/qat_4xxx/adf_drv.c:66:3: warning: Value stored to 'instances' is never read [clang-analyzer-deadcode.DeadStores]
@ 2022-04-12  0:41 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2022-04-12  0:41 UTC (permalink / raw)
  To: kbuild

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

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
CC: Herbert Xu <herbert@gondor.apana.org.au>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   ce522ba9ef7e2d9fb22a39eb3371c0c64e2a433e
commit: 8893d27ffcaf6ec6267038a177cb87bcde4dd3de crypto: qat - disable registration of algorithms
date:   5 weeks ago
:::::: branch date: 24 hours ago
:::::: commit date: 5 weeks ago
config: x86_64-randconfig-c007-20220411 (https://download.01.org/0day-ci/archive/20220412/202204120841.GsX6fmUp-lkp(a)intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project c6e83f560f06cdfe8aa47b248d8bdc58f947274b)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8893d27ffcaf6ec6267038a177cb87bcde4dd3de
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 8893d27ffcaf6ec6267038a177cb87bcde4dd3de
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 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 (WARN_ON_ONCE(!first))
           ^
   net/ipv6/route.c:4748:10: note: Calling 'rt6_multipath_total_weight'
           total = rt6_multipath_total_weight(first);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/ipv6/route.c:4692:2: note: 'total' initialized to 0
           int total = 0;
           ^~~~~~~~~
   net/ipv6/route.c:4694:2: note: Taking false branch
           if (!rt6_is_dead(rt))
           ^
   net/ipv6/route.c:4697:2: note: Loop condition is false. Execution continues on line 4702
           list_for_each_entry(iter, &rt->fib6_siblings, fib6_siblings) {
           ^
   include/linux/list.h:638:2: note: expanded from macro 'list_for_each_entry'
           for (pos = list_first_entry(head, typeof(*pos), member);        \
           ^
   net/ipv6/route.c:4702:2: note: Returning zero (loaded from 'total')
           return total;
           ^~~~~~~~~~~~
   net/ipv6/route.c:4748:10: note: Returning from 'rt6_multipath_total_weight'
           total = rt6_multipath_total_weight(first);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/ipv6/route.c:4748:2: note: The value 0 is assigned to 'total'
           total = rt6_multipath_total_weight(first);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/ipv6/route.c:4749:39: note: Passing the value 0 via 2nd parameter 'total'
           rt6_multipath_upper_bound_set(first, total);
                                                ^~~~~
   net/ipv6/route.c:4749:2: note: Calling 'rt6_multipath_upper_bound_set'
           rt6_multipath_upper_bound_set(first, total);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/ipv6/route.c:4722:35: note: Passing the value 0 via 3rd parameter 'total'
           rt6_upper_bound_set(rt, &weight, total);
                                            ^~~~~
   net/ipv6/route.c:4722:2: note: Calling 'rt6_upper_bound_set'
           rt6_upper_bound_set(rt, &weight, total);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/ipv6/route.c:4709:2: note: Taking true branch
           if (!rt6_is_dead(rt)) {
           ^
   net/ipv6/route.c:4711:17: note: '__d' initialized to 0
                   upper_bound = DIV_ROUND_CLOSEST_ULL((u64) (*weight) << 31,
                                 ^
   include/linux/math.h:102:2: note: expanded from macro 'DIV_ROUND_CLOSEST_ULL'
           typeof(divisor) __d = divisor;                  \
           ^~~~~~~~~~~~~~~~~~~
   net/ipv6/route.c:4711:17: note: '__base' initialized to 0
                   upper_bound = DIV_ROUND_CLOSEST_ULL((u64) (*weight) << 31,
                                 ^
   include/linux/math.h:104:2: note: expanded from macro 'DIV_ROUND_CLOSEST_ULL'
           do_div(_tmp, __d);                              \
           ^~~~~~~~~~~~~~~~~
   include/asm-generic/div64.h:46:2: note: expanded from macro 'do_div'
           uint32_t __base = (base);                               \
           ^~~~~~~~~~~~~~~
   net/ipv6/route.c:4711:17: note: Division by zero
                   upper_bound = DIV_ROUND_CLOSEST_ULL((u64) (*weight) << 31,
                                 ^
   include/linux/math.h:104:2: note: expanded from macro 'DIV_ROUND_CLOSEST_ULL'
           do_div(_tmp, __d);                              \
           ^~~~~~~~~~~~~~~~~
   include/asm-generic/div64.h:48:26: note: expanded from macro 'do_div'
           __rem = ((uint64_t)(n)) % __base;                       \
                   ~~~~~~~~~~~~~~~~^~~~~~~~
   net/ipv6/route.c:5937:11: warning: Although the value stored to 'count' is used in the enclosing expression, the value is never actually read from 'count' [clang-analyzer-deadcode.DeadStores]
                           return count += w.count;
                                  ^        ~~~~~~~
   net/ipv6/route.c:5937:11: note: Although the value stored to 'count' is used in the enclosing expression, the value is never actually read from 'count'
                           return count += w.count;
                                  ^        ~~~~~~~
   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.
   drivers/base/dd.c:689:2: warning: Value stored to 'calltime' is never read [clang-analyzer-deadcode.DeadStores]
           calltime = ktime_get();
           ^          ~~~~~~~~~~~
   drivers/base/dd.c:689:2: note: Value stored to 'calltime' is never read
           calltime = ktime_get();
           ^          ~~~~~~~~~~~
   drivers/base/dd.c:691:2: warning: Value stored to 'rettime' is never read [clang-analyzer-deadcode.DeadStores]
           rettime = ktime_get();
           ^         ~~~~~~~~~~~
   drivers/base/dd.c:691:2: note: Value stored to 'rettime' is never read
           rettime = ktime_get();
           ^         ~~~~~~~~~~~
   drivers/base/dd.c:1085:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
           ret = driver_probe_device(drv, dev);
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/base/dd.c:1085:2: note: Value stored to 'ret' is never read
           ret = driver_probe_device(drv, dev);
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.
   drivers/base/platform.c:578: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(pa->name, name);
                   ^~~~~~
   drivers/base/platform.c:578: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(pa->name, name);
                   ^~~~~~
   2 warnings generated.
>> drivers/crypto/qat/qat_4xxx/adf_drv.c:66:3: warning: Value stored to 'instances' is never read [clang-analyzer-deadcode.DeadStores]
                   instances = min(cpus, banks / 2);
                   ^
   drivers/crypto/qat/qat_4xxx/adf_drv.c:66:3: note: Value stored to 'instances' is never read
   drivers/crypto/qat/qat_4xxx/adf_drv.c:68:3: warning: Value stored to 'instances' is never read [clang-analyzer-deadcode.DeadStores]
                   instances = 0;
                   ^           ~
   drivers/crypto/qat/qat_4xxx/adf_drv.c:68:3: note: Value stored to 'instances' is never read
                   instances = 0;
                   ^           ~
   2 warnings generated.
   Suppressed 2 warnings (1 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.
   2 warnings generated.
   Suppressed 2 warnings (1 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.
   2 warnings generated.
   Suppressed 2 warnings (1 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.
   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.
   1 warning generated.
   drivers/input/joystick/tmdc.c:76:21: warning: Excessive padding in 'struct tmdc_model' (13 padding bytes, where 5 is optimal). 
   Optimal fields order: 
   name, 
   axes, 
   buttons, 
   id, 
   abs, 
   hats, 
   btnc, 
   btno, 
   consider reordering the fields or adding explicit padding members [clang-analyzer-optin.performance.Padding]
   static const struct tmdc_model {
                ~~~~~~~^~~~~~~~~~~~
   drivers/input/joystick/tmdc.c:76:21: note: Excessive padding in 'struct tmdc_model' (13 padding bytes, where 5 is optimal). Optimal fields order: name, axes, buttons, id, abs, hats, btnc, btno, consider reordering the fields or adding explicit padding members
   static const struct tmdc_model {
                ~~~~~~~^~~~~~~~~~~~
   2 warnings generated.
   drivers/leds/leds-pca9532.c:516:23: warning: Value stored to 'data' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct pca9532_data *data = i2c_get_clientdata(client);
                                ^~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/leds/leds-pca9532.c:516:23: note: Value stored to 'data' during its initialization is never read
           struct pca9532_data *data = i2c_get_clientdata(client);
                                ^~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 1 warnings (1 with check filters).
   3 warnings generated.
   Suppressed 3 warnings (3 with check filters).
   1 warning generated.
   Suppressed 1 warnings (1 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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
   1 warning generated.
   Suppressed 1 warnings (1 with check filters).
   1 warning generated.
   drivers/media/mc/mc-request.c:190:23: warning: Value stored to 'mdev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct media_device *mdev = req->mdev;
                                ^~~~   ~~~~~~~~~
   drivers/media/mc/mc-request.c:190:23: note: Value stored to 'mdev' during its initialization is never read
           struct media_device *mdev = req->mdev;
                                ^~~~   ~~~~~~~~~
   2 warnings generated.
   drivers/media/v4l2-core/v4l2-dev.c:1053:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
           ret = video_register_media_controller(vdev);
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/v4l2-core/v4l2-dev.c:1053:2: note: Value stored to 'ret' is never read
           ret = video_register_media_controller(vdev);
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 1 warnings (1 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.
   drivers/media/v4l2-core/v4l2-ioctl.c:3311:3: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
                   err = -EFAULT;
                   ^     ~~~~~~~
   drivers/media/v4l2-core/v4l2-ioctl.c:3311:3: note: Value stored to 'err' is never read
                   err = -EFAULT;
                   ^     ~~~~~~~
   Suppressed 1 warnings (1 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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
   1 warning generated.
   drivers/firmware/dmi-sysfs.c:635:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
           kobject_put(entry->child);
           ^           ~~~~~~~~~~~~
   drivers/firmware/dmi-sysfs.c:587:6: note: Assuming the condition is false
           if (*ret)
               ^~~~
   drivers/firmware/dmi-sysfs.c:587:2: note: Taking false branch
           if (*ret)
           ^
--
   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.
   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.
   4 warnings generated.
   drivers/gpu/drm/i915/i915_pmu.c:1046:19: warning: Value stored to 'pmu' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct i915_pmu *pmu = hlist_entry_safe(node, typeof(*pmu), cpuhp.node);
                            ^~~
   drivers/gpu/drm/i915/i915_pmu.c:1046:19: note: Value stored to 'pmu' during its initialization is never read
           struct i915_pmu *pmu = hlist_entry_safe(node, typeof(*pmu), cpuhp.node);
                            ^~~
   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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
   1 warning generated.
   fs/btrfs/free-space-tree.c:1476:3: warning: Value stored to 'total_found' is never read [clang-analyzer-deadcode.DeadStores]
                   total_found += add_new_free_space(block_group, extent_start,
                   ^              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/btrfs/free-space-tree.c:1476:3: note: Value stored to 'total_found' is never read
                   total_found += add_new_free_space(block_group, extent_start,
                   ^              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.
   fs/btrfs/space-info.c:1565:3: warning: Value stored to 'used' is never read [clang-analyzer-deadcode.DeadStores]
                   used += orig_bytes;
                   ^       ~~~~~~~~~~
   fs/btrfs/space-info.c:1565:3: note: Value stored to 'used' is never read
                   used += orig_bytes;
                   ^       ~~~~~~~~~~
   1 warning generated.
   drivers/crypto/qat/qat_common/adf_gen4_pfvf.c:46:9: warning: Although the value stored to 'sou' is used in the enclosing expression, the value is never actually read from 'sou' [clang-analyzer-deadcode.DeadStores]
           return sou &= ~mask;
                  ^      ~~~~~
   drivers/crypto/qat/qat_common/adf_gen4_pfvf.c:46:9: note: Although the value stored to 'sou' is used in the enclosing expression, the value is never actually read from 'sou'
           return sou &= ~mask;
                  ^      ~~~~~
   6 warnings generated.
   drivers/media/tuners/mt20xx.c:253:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
           ret=tuner_i2c_xfer_send(&priv->i2c_props,buf,1);
           ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/tuners/mt20xx.c:253:2: note: Value stored to 'ret' is never read
           ret=tuner_i2c_xfer_send(&priv->i2c_props,buf,1);
           ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/tuners/mt20xx.c:263:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
           ret=tuner_i2c_xfer_send(&priv->i2c_props,buf,4);
           ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/tuners/mt20xx.c:263:2: note: Value stored to 'ret' is never read
           ret=tuner_i2c_xfer_send(&priv->i2c_props,buf,4);
           ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/tuners/mt20xx.c:265:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
           ret=tuner_i2c_xfer_send(&priv->i2c_props,buf+5,4);
           ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/tuners/mt20xx.c:265:2: note: Value stored to 'ret' is never read
           ret=tuner_i2c_xfer_send(&priv->i2c_props,buf+5,4);
           ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/tuners/mt20xx.c:383:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
           ret=tuner_i2c_xfer_send(&priv->i2c_props,buf+1,4);
           ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/tuners/mt20xx.c:383:2: note: Value stored to 'ret' is never read
           ret=tuner_i2c_xfer_send(&priv->i2c_props,buf+1,4);
           ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/tuners/mt20xx.c:391:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
           ret=tuner_i2c_xfer_send(&priv->i2c_props,buf+5,6);
           ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/tuners/mt20xx.c:391:2: note: Value stored to 'ret' is never read
           ret=tuner_i2c_xfer_send(&priv->i2c_props,buf+5,6);
           ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/tuners/mt20xx.c:395:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
           ret=tuner_i2c_xfer_send(&priv->i2c_props,buf+12,2);
           ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/tuners/mt20xx.c:395:2: note: Value stored to 'ret' is never read
           ret=tuner_i2c_xfer_send(&priv->i2c_props,buf+12,2);
           ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.
   Suppressed 1 warnings (1 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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
   1 warning generated.
   Suppressed 1 warnings (1 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.
>> drivers/crypto/qat/qat_common/qat_crypto.c:152:3: warning: Value stored to 'instances' is never read [clang-analyzer-deadcode.DeadStores]
                   instances = min(cpus, banks);
                   ^
   drivers/crypto/qat/qat_common/qat_crypto.c:152:3: note: Value stored to 'instances' is never read
   drivers/crypto/qat/qat_common/qat_crypto.c:154:3: warning: Value stored to 'instances' is never read [clang-analyzer-deadcode.DeadStores]
                   instances = 0;
                   ^           ~
   drivers/crypto/qat/qat_common/qat_crypto.c:154:3: note: Value stored to 'instances' is never read
                   instances = 0;
                   ^           ~
   1 warning generated.
   drivers/hwmon/adm1026.c:1574:6: warning: Value stored to 'address' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           int address = client->addr;
               ^~~~~~~   ~~~~~~~~~~~~
   drivers/hwmon/adm1026.c:1574:6: note: Value stored to 'address' during its initialization is never read
           int address = client->addr;
               ^~~~~~~   ~~~~~~~~~~~~
   4 warnings generated.
   drivers/mtd/inftlmount.c:550:2: warning: Value stored to 'logical_block' is never read [clang-analyzer-deadcode.DeadStores]
           logical_block = block = BLOCK_NIL;
           ^               ~~~~~~~~~~~~~~~~~
   drivers/mtd/inftlmount.c:550:2: note: Value stored to 'logical_block' is never read
           logical_block = block = BLOCK_NIL;
           ^               ~~~~~~~~~~~~~~~~~
   drivers/mtd/inftlmount.c:550:18: warning: Although the value stored to 'block' is used in the enclosing expression, the value is never actually read from 'block' [clang-analyzer-deadcode.DeadStores]
           logical_block = block = BLOCK_NIL;
                           ^
   drivers/mtd/inftlmount.c:550:18: note: Although the value stored to 'block' is used in the enclosing expression, the value is never actually read from 'block'
   drivers/mtd/inftlmount.c:693:3: warning: Value stored to 'logical_block' is never read [clang-analyzer-deadcode.DeadStores]
                   logical_block = BLOCK_NIL;
                   ^
   drivers/mtd/inftlmount.c:693:3: note: Value stored to 'logical_block' is never read
   Suppressed 1 warnings (1 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.
   1 warning generated.
   drivers/hwmon/fschmd.c:757:7: warning: Access to field 'client' results in a dereference of a null pointer (loaded from variable 'data') [clang-analyzer-core.NullDereference]
           if (!data->client) {
                ^
   drivers/hwmon/fschmd.c:796:28: note: 'data' initialized to a null pointer value
           struct fschmd_data *pos, *data = NULL;
                                     ^~~~
   drivers/hwmon/fschmd.c:805:6: note: Assuming the condition is false
           if (!mutex_trylock(&watchdog_data_mutex))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hwmon/fschmd.c:805:2: note: Taking false branch
           if (!mutex_trylock(&watchdog_data_mutex))
           ^
   drivers/hwmon/fschmd.c:807:2: note: Loop condition is false. Execution continues on line 814
           list_for_each_entry(pos, &watchdog_data_list, list) {
           ^
   include/linux/list.h:638:2: note: expanded from macro 'list_for_each_entry'
           for (pos = list_first_entry(head, typeof(*pos), member);        \
           ^
   drivers/hwmon/fschmd.c:815:6: note: Assuming 'watchdog_is_open' is 0
           if (!watchdog_is_open)
               ^~~~~~~~~~~~~~~~~
   drivers/hwmon/fschmd.c:815:2: note: Taking true branch
           if (!watchdog_is_open)
           ^
   drivers/hwmon/fschmd.c:819:6: note: 'watchdog_is_open' is 0
           if (watchdog_is_open)
               ^~~~~~~~~~~~~~~~
   drivers/hwmon/fschmd.c:819:2: note: Taking false branch
           if (watchdog_is_open)
           ^
   drivers/hwmon/fschmd.c:823:19: note: Passing null pointer value via 1st parameter 'data'
           watchdog_trigger(data);
                            ^~~~
   drivers/hwmon/fschmd.c:823:2: note: Calling 'watchdog_trigger'
           watchdog_trigger(data);
           ^~~~~~~~~~~~~~~~~~~~~~
   drivers/hwmon/fschmd.c:757:7: note: Access to field 'client' results in a dereference of a null pointer (loaded from variable 'data')
           if (!data->client) {
                ^~~~
   3 warnings generated.
   drivers/staging/media/av7110/av7110_av.c:638:2: warning: Value stored to 'c2' is never read [clang-analyzer-deadcode.DeadStores]
           c2 = 0;
           ^    ~
   drivers/staging/media/av7110/av7110_av.c:638:2: note: Value stored to 'c2' is never read
           c2 = 0;
           ^    ~
   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.
   5 warnings generated.
   drivers/scsi/snic/snic_scsi.c:519:4: warning: Value stored to 'xfer_len' is never read [clang-analyzer-deadcode.DeadStores]
                           xfer_len -= le32_to_cpu(icmnd_cmpl->resid);
                           ^
   drivers/scsi/snic/snic_scsi.c:519:4: note: Value stored to 'xfer_len' is never read
   drivers/scsi/snic/snic_scsi.c:1890:3: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
                   ret = FAILED;
                   ^     ~~~~~~
   drivers/scsi/snic/snic_scsi.c:1890:3: note: Value stored to 'ret' is never read
                   ret = FAILED;
                   ^     ~~~~~~
   drivers/scsi/snic/snic_scsi.c:1955:3: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]

vim +/instances +66 drivers/crypto/qat/qat_4xxx/adf_drv.c

0cec19c761e5cc Tomasz Kowalik   2021-12-16   54  
8c8268166e8342 Giovanni Cabiddu 2020-11-13   55  static int adf_crypto_dev_config(struct adf_accel_dev *accel_dev)
8c8268166e8342 Giovanni Cabiddu 2020-11-13   56  {
8c8268166e8342 Giovanni Cabiddu 2020-11-13   57  	char key[ADF_CFG_MAX_KEY_LEN_IN_BYTES];
8c8268166e8342 Giovanni Cabiddu 2020-11-13   58  	int banks = GET_MAX_BANKS(accel_dev);
8c8268166e8342 Giovanni Cabiddu 2020-11-13   59  	int cpus = num_online_cpus();
8c8268166e8342 Giovanni Cabiddu 2020-11-13   60  	unsigned long bank, val;
8c8268166e8342 Giovanni Cabiddu 2020-11-13   61  	int instances;
8c8268166e8342 Giovanni Cabiddu 2020-11-13   62  	int ret;
8c8268166e8342 Giovanni Cabiddu 2020-11-13   63  	int i;
8c8268166e8342 Giovanni Cabiddu 2020-11-13   64  
8c8268166e8342 Giovanni Cabiddu 2020-11-13   65  	if (adf_hw_dev_has_crypto(accel_dev))
8c8268166e8342 Giovanni Cabiddu 2020-11-13  @66  		instances = min(cpus, banks / 2);
8c8268166e8342 Giovanni Cabiddu 2020-11-13   67  	else
8c8268166e8342 Giovanni Cabiddu 2020-11-13   68  		instances = 0;
8c8268166e8342 Giovanni Cabiddu 2020-11-13   69  
8c8268166e8342 Giovanni Cabiddu 2020-11-13   70  	ret = adf_cfg_section_add(accel_dev, ADF_KERNEL_SEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13   71  	if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13   72  		goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13   73  
8c8268166e8342 Giovanni Cabiddu 2020-11-13   74  	ret = adf_cfg_section_add(accel_dev, "Accelerator0");
8c8268166e8342 Giovanni Cabiddu 2020-11-13   75  	if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13   76  		goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13   77  
8893d27ffcaf6e Giovanni Cabiddu 2022-03-04   78  	/* Temporarily set the number of crypto instances to zero to avoid
8893d27ffcaf6e Giovanni Cabiddu 2022-03-04   79  	 * registering the crypto algorithms.
8893d27ffcaf6e Giovanni Cabiddu 2022-03-04   80  	 * This will be removed when the algorithms will support the
8893d27ffcaf6e Giovanni Cabiddu 2022-03-04   81  	 * CRYPTO_TFM_REQ_MAY_BACKLOG flag
8893d27ffcaf6e Giovanni Cabiddu 2022-03-04   82  	 */
8893d27ffcaf6e Giovanni Cabiddu 2022-03-04   83  	instances = 0;
8893d27ffcaf6e Giovanni Cabiddu 2022-03-04   84  
8c8268166e8342 Giovanni Cabiddu 2020-11-13   85  	for (i = 0; i < instances; i++) {
8c8268166e8342 Giovanni Cabiddu 2020-11-13   86  		val = i;
8c8268166e8342 Giovanni Cabiddu 2020-11-13   87  		bank = i * 2;
8c8268166e8342 Giovanni Cabiddu 2020-11-13   88  		snprintf(key, sizeof(key), ADF_CY "%d" ADF_RING_ASYM_BANK_NUM, i);
8c8268166e8342 Giovanni Cabiddu 2020-11-13   89  		ret = adf_cfg_add_key_value_param(accel_dev, ADF_KERNEL_SEC,
8c8268166e8342 Giovanni Cabiddu 2020-11-13   90  						  key, &bank, ADF_DEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13   91  		if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13   92  			goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13   93  
8c8268166e8342 Giovanni Cabiddu 2020-11-13   94  		bank += 1;
8c8268166e8342 Giovanni Cabiddu 2020-11-13   95  		snprintf(key, sizeof(key), ADF_CY "%d" ADF_RING_SYM_BANK_NUM, i);
8c8268166e8342 Giovanni Cabiddu 2020-11-13   96  		ret = adf_cfg_add_key_value_param(accel_dev, ADF_KERNEL_SEC,
8c8268166e8342 Giovanni Cabiddu 2020-11-13   97  						  key, &bank, ADF_DEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13   98  		if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13   99  			goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  100  
8c8268166e8342 Giovanni Cabiddu 2020-11-13  101  		snprintf(key, sizeof(key), ADF_CY "%d" ADF_ETRMGR_CORE_AFFINITY,
8c8268166e8342 Giovanni Cabiddu 2020-11-13  102  			 i);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  103  		ret = adf_cfg_add_key_value_param(accel_dev, ADF_KERNEL_SEC,
8c8268166e8342 Giovanni Cabiddu 2020-11-13  104  						  key, &val, ADF_DEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  105  		if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13  106  			goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  107  
8c8268166e8342 Giovanni Cabiddu 2020-11-13  108  		snprintf(key, sizeof(key), ADF_CY "%d" ADF_RING_ASYM_SIZE, i);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  109  		val = 128;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  110  		ret = adf_cfg_add_key_value_param(accel_dev, ADF_KERNEL_SEC,
8c8268166e8342 Giovanni Cabiddu 2020-11-13  111  						  key, &val, ADF_DEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  112  		if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13  113  			goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  114  
8c8268166e8342 Giovanni Cabiddu 2020-11-13  115  		val = 512;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  116  		snprintf(key, sizeof(key), ADF_CY "%d" ADF_RING_SYM_SIZE, i);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  117  		ret = adf_cfg_add_key_value_param(accel_dev, ADF_KERNEL_SEC,
8c8268166e8342 Giovanni Cabiddu 2020-11-13  118  						  key, &val, ADF_DEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  119  		if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13  120  			goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  121  
8c8268166e8342 Giovanni Cabiddu 2020-11-13  122  		val = 0;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  123  		snprintf(key, sizeof(key), ADF_CY "%d" ADF_RING_ASYM_TX, i);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  124  		ret = adf_cfg_add_key_value_param(accel_dev, ADF_KERNEL_SEC,
8c8268166e8342 Giovanni Cabiddu 2020-11-13  125  						  key, &val, ADF_DEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  126  		if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13  127  			goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  128  
8c8268166e8342 Giovanni Cabiddu 2020-11-13  129  		val = 0;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  130  		snprintf(key, sizeof(key), ADF_CY "%d" ADF_RING_SYM_TX, i);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  131  		ret = adf_cfg_add_key_value_param(accel_dev, ADF_KERNEL_SEC,
8c8268166e8342 Giovanni Cabiddu 2020-11-13  132  						  key, &val, ADF_DEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  133  		if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13  134  			goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  135  
8c8268166e8342 Giovanni Cabiddu 2020-11-13  136  		val = 1;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  137  		snprintf(key, sizeof(key), ADF_CY "%d" ADF_RING_ASYM_RX, i);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  138  		ret = adf_cfg_add_key_value_param(accel_dev, ADF_KERNEL_SEC,
8c8268166e8342 Giovanni Cabiddu 2020-11-13  139  						  key, &val, ADF_DEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  140  		if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13  141  			goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  142  
8c8268166e8342 Giovanni Cabiddu 2020-11-13  143  		val = 1;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  144  		snprintf(key, sizeof(key), ADF_CY "%d" ADF_RING_SYM_RX, i);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  145  		ret = adf_cfg_add_key_value_param(accel_dev, ADF_KERNEL_SEC,
8c8268166e8342 Giovanni Cabiddu 2020-11-13  146  						  key, &val, ADF_DEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  147  		if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13  148  			goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  149  
8c8268166e8342 Giovanni Cabiddu 2020-11-13  150  		val = ADF_COALESCING_DEF_TIME;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  151  		snprintf(key, sizeof(key), ADF_ETRMGR_COALESCE_TIMER_FORMAT, i);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  152  		ret = adf_cfg_add_key_value_param(accel_dev, "Accelerator0",
8c8268166e8342 Giovanni Cabiddu 2020-11-13  153  						  key, &val, ADF_DEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  154  		if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13  155  			goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  156  	}
8c8268166e8342 Giovanni Cabiddu 2020-11-13  157  
8c8268166e8342 Giovanni Cabiddu 2020-11-13  158  	val = i;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  159  	ret = adf_cfg_add_key_value_param(accel_dev, ADF_KERNEL_SEC, ADF_NUM_CY,
8c8268166e8342 Giovanni Cabiddu 2020-11-13  160  					  &val, ADF_DEC);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  161  	if (ret)
8c8268166e8342 Giovanni Cabiddu 2020-11-13  162  		goto err;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  163  
8c8268166e8342 Giovanni Cabiddu 2020-11-13  164  	set_bit(ADF_STATUS_CONFIGURED, &accel_dev->status);
8c8268166e8342 Giovanni Cabiddu 2020-11-13  165  	return 0;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  166  err:
8c8268166e8342 Giovanni Cabiddu 2020-11-13  167  	dev_err(&GET_DEV(accel_dev), "Failed to start QAT accel dev\n");
8c8268166e8342 Giovanni Cabiddu 2020-11-13  168  	return ret;
8c8268166e8342 Giovanni Cabiddu 2020-11-13  169  }
8c8268166e8342 Giovanni Cabiddu 2020-11-13  170  

:::::: The code at line 66 was first introduced by commit
:::::: 8c8268166e83425243789c5781c92e7fa33b703b crypto: qat - add qat_4xxx driver

:::::: TO: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
:::::: CC: Herbert Xu <herbert@gondor.apana.org.au>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

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

end of thread, other threads:[~2022-05-18  6:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-18  6:15 drivers/crypto/qat/qat_4xxx/adf_drv.c:66:3: warning: Value stored to 'instances' is never read [clang-analyzer-deadcode.DeadStores] kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2022-04-15 19:58 kernel test robot
2022-04-12  0:41 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.