All of lore.kernel.org
 help / color / mirror / Atom feed
* [ogabbay:habanalabs-next 32/33] drivers/misc/habanalabs/common/irq.c:152:20: warning: Value stored to 'hdev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
@ 2022-01-30 11:35 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-01-30 11:35 UTC (permalink / raw)
  To: kbuild

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

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: farah kassabri <fkassabri@habana.ai>
CC: Oded Gabbay <ogabbay@kernel.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux.git habanalabs-next
head:   c720ae02be190b7639446bba872752a68cb4ba17
commit: 402f801a3488a90a5481524ea87c3da17867e635 [32/33] habanalabs: Timestamps buffers registration
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: riscv-randconfig-c006-20220129 (https://download.01.org/0day-ci/archive/20220130/202201301958.rLUdGi6P-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 33b45ee44b1f32ffdbc995e6fec806271b4b3ba4)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux.git/commit/?id=402f801a3488a90a5481524ea87c3da17867e635
        git remote add ogabbay https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux.git
        git fetch --no-tags ogabbay habanalabs-next
        git checkout 402f801a3488a90a5481524ea87c3da17867e635
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv clang-analyzer 

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


clang-analyzer warnings: (new ones prefixed by >>)
           int ntemp = clamp_val(temp, LM75_TEMP_MIN, LM75_TEMP_MAX);
                       ^
   include/linux/minmax.h:137:32: note: expanded from macro 'clamp_val'
   #define clamp_val(val, lo, hi) clamp_t(typeof(val), val, lo, hi)
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:124:48: note: expanded from macro 'clamp_t'
   #define clamp_t(type, val, lo, hi) min_t(type, max_t(type, val, lo), hi)
                                      ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:112:27: note: expanded from macro 'max_t'
   #define max_t(type, x, y)       __careful_cmp((type)(x), (type)(y), >)
                                   ^
   note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/minmax.h:104:48: note: expanded from macro 'min_t'
   #define min_t(type, x, y)       __careful_cmp((type)(x), (type)(y), <)
                                   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
   include/linux/minmax.h:38:14: note: expanded from macro '__careful_cmp'
                   __cmp_once(x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y), op))
                   ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:31:25: note: expanded from macro '__cmp_once'
                   typeof(x) unique_x = (x);               \
                                         ^
   drivers/hwmon/lm75.h:27:14: note: '?' condition is false
           int ntemp = clamp_val(temp, LM75_TEMP_MIN, LM75_TEMP_MAX);
                       ^
   include/linux/minmax.h:137:32: note: expanded from macro 'clamp_val'
   #define clamp_val(val, lo, hi) clamp_t(typeof(val), val, lo, hi)
                                  ^
   include/linux/minmax.h:124:48: note: expanded from macro 'clamp_t'
   #define clamp_t(type, val, lo, hi) min_t(type, max_t(type, val, lo), hi)
                                                  ^
   include/linux/minmax.h:112:27: note: expanded from macro 'max_t'
   #define max_t(type, x, y)       __careful_cmp((type)(x), (type)(y), >)
                                   ^
   include/linux/minmax.h:38:3: note: expanded from macro '__careful_cmp'
                   __cmp_once(x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y), op))
                   ^
   include/linux/minmax.h:33:3: note: expanded from macro '__cmp_once'
                   __cmp(unique_x, unique_y, op); })
                   ^
   include/linux/minmax.h:28:26: note: expanded from macro '__cmp'
   #define __cmp(x, y, op) ((x) op (y) ? (x) : (y))
                            ^
   drivers/hwmon/lm75.h:27:14: note: '__UNIQUE_ID___x181' is < '__UNIQUE_ID___y182'
           int ntemp = clamp_val(temp, LM75_TEMP_MIN, LM75_TEMP_MAX);
                       ^
   include/linux/minmax.h:137:32: note: expanded from macro 'clamp_val'
   #define clamp_val(val, lo, hi) clamp_t(typeof(val), val, lo, hi)
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:124:36: note: expanded from macro 'clamp_t'
   #define clamp_t(type, val, lo, hi) min_t(type, max_t(type, val, lo), hi)
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:104:27: note: expanded from macro 'min_t'
   #define min_t(type, x, y)       __careful_cmp((type)(x), (type)(y), <)
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:38:3: note: expanded from macro '__careful_cmp'
                   __cmp_once(x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y), op))
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:33:3: note: expanded from macro '__cmp_once'
                   __cmp(unique_x, unique_y, op); })
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:28:26: note: expanded from macro '__cmp'
   #define __cmp(x, y, op) ((x) op (y) ? (x) : (y))
                            ^~~
   drivers/hwmon/lm75.h:27:14: note: '?' condition is true
           int ntemp = clamp_val(temp, LM75_TEMP_MIN, LM75_TEMP_MAX);
                       ^
   include/linux/minmax.h:137:32: note: expanded from macro 'clamp_val'
   #define clamp_val(val, lo, hi) clamp_t(typeof(val), val, lo, hi)
                                  ^
   include/linux/minmax.h:124:36: note: expanded from macro 'clamp_t'
   #define clamp_t(type, val, lo, hi) min_t(type, max_t(type, val, lo), hi)
                                      ^
   include/linux/minmax.h:104:27: note: expanded from macro 'min_t'
   #define min_t(type, x, y)       __careful_cmp((type)(x), (type)(y), <)
                                   ^
   include/linux/minmax.h:38:3: note: expanded from macro '__careful_cmp'
                   __cmp_once(x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y), op))
                   ^
   include/linux/minmax.h:33:3: note: expanded from macro '__cmp_once'
                   __cmp(unique_x, unique_y, op); })
                   ^
   include/linux/minmax.h:28:26: note: expanded from macro '__cmp'
   #define __cmp(x, y, op) ((x) op (y) ? (x) : (y))
                            ^
   drivers/hwmon/lm75.h:29:12: note: 'ntemp' is < 0
           ntemp += (ntemp < 0 ? -250 : 250);
                     ^~~~~
   drivers/hwmon/lm75.h:29:12: note: '?' condition is true
   drivers/hwmon/lm75.h:30:29: note: The result of the left shift is undefined because the left operand is negative
           return (u16)((ntemp / 500) << 7);
                        ~~~~~~~~~~~~~ ^
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
>> drivers/misc/habanalabs/common/irq.c:152:20: warning: Value stored to 'hdev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct hl_device *hdev = job->hdev;
                             ^~~~   ~~~~~~~~~
   drivers/misc/habanalabs/common/irq.c:152:20: note: Value stored to 'hdev' during its initialization is never read
           struct hl_device *hdev = job->hdev;
                             ^~~~   ~~~~~~~~~
   Suppressed 4 warnings (3 in non-user code, 1 with check filters).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   drivers/misc/habanalabs/common/command_submission.c:2488:21: warning: Access to field 'timestamp' results in a dereference of a null pointer (loaded from variable 'fence') [clang-analyzer-core.NullDereference]
                                           (ktime_compare(fence->timestamp, first_cs_time) < 0))
                                                          ^
   drivers/misc/habanalabs/common/command_submission.c:3284:6: note: Assuming the condition is false
           if (!hl_device_operational(hpriv->hdev, NULL))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:3284:2: note: Taking false branch
           if (!hl_device_operational(hpriv->hdev, NULL))
           ^
   drivers/misc/habanalabs/common/command_submission.c:3287:6: note: Assuming the condition is false
           if (flags & HL_WAIT_CS_FLAGS_INTERRUPT)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:3287:2: note: Taking false branch
           if (flags & HL_WAIT_CS_FLAGS_INTERRUPT)
           ^
   drivers/misc/habanalabs/common/command_submission.c:3289:11: note: Assuming the condition is true
           else if (flags & HL_WAIT_CS_FLAGS_MULTI_CS)
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:3289:7: note: Taking true branch
           else if (flags & HL_WAIT_CS_FLAGS_MULTI_CS)
                ^
   drivers/misc/habanalabs/common/command_submission.c:3290:8: note: Calling 'hl_multi_cs_wait_ioctl'
                   rc = hl_multi_cs_wait_ioctl(hpriv, data);
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:2678:6: note: Assuming field 'supports_wait_for_multi_cs' is not equal to 0
           if (!hdev->supports_wait_for_multi_cs) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:2678:2: note: Taking false branch
           if (!hdev->supports_wait_for_multi_cs) {
           ^
   drivers/misc/habanalabs/common/command_submission.c:2685:6: note: Assuming 'seq_arr_len' is <= HL_WAIT_MULTI_CS_LIST_MAX_LEN
           if (seq_arr_len > HL_WAIT_MULTI_CS_LIST_MAX_LEN) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:2685:2: note: Taking false branch
           if (seq_arr_len > HL_WAIT_MULTI_CS_LIST_MAX_LEN) {
           ^
   drivers/misc/habanalabs/common/command_submission.c:2693:3: note: Calling 'kmalloc_array'
                   kmalloc_array(seq_arr_len, sizeof(*cs_seq_arr), GFP_KERNEL);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/slab.h:617:2: note: Taking false branch
           if (unlikely(check_mul_overflow(n, size, &bytes)))
           ^
   include/linux/slab.h:619:30: note: Left side of '&&' is false
           if (__builtin_constant_p(n) && __builtin_constant_p(size))
                                       ^
   include/linux/slab.h:621:2: note: Returning pointer, which participates in a condition later
           return __kmalloc(bytes, flags);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:2693:3: note: Returning from 'kmalloc_array'
                   kmalloc_array(seq_arr_len, sizeof(*cs_seq_arr), GFP_KERNEL);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:2694:6: note: Assuming 'cs_seq_arr' is non-null
           if (!cs_seq_arr)
               ^~~~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:2694:2: note: Taking false branch
           if (!cs_seq_arr)
           ^
   drivers/misc/habanalabs/common/command_submission.c:2700:6: note: Calling 'copy_from_user'
           if (copy_from_user(cs_seq_arr, seq_arr, size_to_copy)) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/uaccess.h:191:13: note: Calling 'check_copy_size'
           if (likely(check_copy_size(to, n, false)))
                      ^
   include/linux/compiler.h:77:40: note: expanded from macro 'likely'
   # define likely(x)      __builtin_expect(!!(x), 1)
                                               ^
   include/linux/thread_info.h:221:15: note: Assuming 'sz' is >= 0
           if (unlikely(sz >= 0 && sz < bytes)) {
                        ^
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   include/linux/thread_info.h:221:15: note: Left side of '&&' is true
           if (unlikely(sz >= 0 && sz < bytes)) {
                        ^
   include/linux/thread_info.h:221:26: note: Assuming 'sz' is < 'bytes'
           if (unlikely(sz >= 0 && sz < bytes)) {
                                   ^
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   include/linux/thread_info.h:221:2: note: Taking true branch
           if (unlikely(sz >= 0 && sz < bytes)) {
--
           ^~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:2700:6: note: Returning from 'copy_from_user'
           if (copy_from_user(cs_seq_arr, seq_arr, size_to_copy)) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:2700:6: note: Assuming the condition is false
           if (copy_from_user(cs_seq_arr, seq_arr, size_to_copy)) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:2700:2: note: Taking false branch
           if (copy_from_user(cs_seq_arr, seq_arr, size_to_copy)) {
           ^
   drivers/misc/habanalabs/common/command_submission.c:2707:14: note: Calling 'kmalloc_array'
           fence_arr = kmalloc_array(seq_arr_len, sizeof(*fence_arr), GFP_KERNEL);
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/slab.h:617:2: note: Taking false branch
           if (unlikely(check_mul_overflow(n, size, &bytes)))
           ^
   include/linux/slab.h:619:30: note: Left side of '&&' is false
           if (__builtin_constant_p(n) && __builtin_constant_p(size))
                                       ^
   include/linux/slab.h:621:2: note: Returning pointer, which participates in a condition later
           return __kmalloc(bytes, flags);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:2707:14: note: Returning from 'kmalloc_array'
           fence_arr = kmalloc_array(seq_arr_len, sizeof(*fence_arr), GFP_KERNEL);
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:2708:6: note: Assuming 'fence_arr' is non-null
           if (!fence_arr) {
               ^~~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:2708:2: note: Taking false branch
           if (!fence_arr) {
           ^
   drivers/misc/habanalabs/common/command_submission.c:2724:6: note: Calling 'IS_ERR'
           if (IS_ERR(mcs_compl)) {
               ^~~~~~~~~~~~~~~~~
   include/linux/err.h:36:9: note: Assuming the condition is false
           return IS_ERR_VALUE((unsigned long)ptr);
                  ^
   include/linux/err.h:22:34: note: expanded from macro 'IS_ERR_VALUE'
   #define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO)
                           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   include/linux/err.h:36:2: note: Returning zero, which participates in a condition later
           return IS_ERR_VALUE((unsigned long)ptr);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:2724:6: note: Returning from 'IS_ERR'
           if (IS_ERR(mcs_compl)) {
               ^~~~~~~~~~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:2724:2: note: Taking false branch
           if (IS_ERR(mcs_compl)) {
           ^
   drivers/misc/habanalabs/common/command_submission.c:2731:7: note: Calling 'hl_cs_poll_fences'
           rc = hl_cs_poll_fences(&mcs_data, mcs_compl);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:2407:6: note: Assuming 'rc' is 0
           if (rc)
               ^~
   drivers/misc/habanalabs/common/command_submission.c:2407:2: note: Taking false branch
           if (rc)
           ^
   drivers/misc/habanalabs/common/command_submission.c:2426:14: note: 'i' is < 'arr_len'
           for (i = 0; i < arr_len; i++, fence_ptr++) {
                       ^
   drivers/misc/habanalabs/common/command_submission.c:2426:2: note: Loop condition is true.  Entering loop body
           for (i = 0; i < arr_len; i++, fence_ptr++) {
           ^
   drivers/misc/habanalabs/common/command_submission.c:2427:3: note: 'fence' initialized here
                   struct hl_fence *fence = *fence_ptr;
                   ^~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:2441:7: note: Assuming 'fence' is null
                   if (fence)
                       ^~~~~
   drivers/misc/habanalabs/common/command_submission.c:2441:3: note: Taking false branch
                   if (fence)
                   ^
   drivers/misc/habanalabs/common/command_submission.c:2450:7: note: Assuming 'rc' is 0
                   if (rc) {
                       ^~
   drivers/misc/habanalabs/common/command_submission.c:2450:3: note: Taking false branch
                   if (rc) {
                   ^
   drivers/misc/habanalabs/common/command_submission.c:2457:3: note: Control jumps to 'case CS_WAIT_STATUS_COMPLETED:' @line 2461
                   switch (status) {
                   ^
   drivers/misc/habanalabs/common/command_submission.c:2470:8: note: 'fence' is null
                           if (fence && !fence->mcs_handling_done) {
                               ^~~~~
   drivers/misc/habanalabs/common/command_submission.c:2470:14: note: Left side of '&&' is false
                           if (fence && !fence->mcs_handling_done) {
                                     ^
   drivers/misc/habanalabs/common/command_submission.c:2487:18: note: Field 'update_ts' is 1
                           if (mcs_data->update_ts &&
                                         ^
   drivers/misc/habanalabs/common/command_submission.c:2487:8: note: Left side of '&&' is true
                           if (mcs_data->update_ts &&
                               ^
   drivers/misc/habanalabs/common/command_submission.c:2488:21: note: Access to field 'timestamp' results in a dereference of a null pointer (loaded from variable 'fence')
                                           (ktime_compare(fence->timestamp, first_cs_time) < 0))
                                                          ^~~~~
>> drivers/misc/habanalabs/common/command_submission.c:3267:6: warning: Branch condition evaluates to a garbage value [clang-analyzer-core.uninitialized.Branch]
           if (timestamp) {
               ^
   drivers/misc/habanalabs/common/command_submission.c:3284:6: note: Assuming the condition is false
           if (!hl_device_operational(hpriv->hdev, NULL))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:3284:2: note: Taking false branch
           if (!hl_device_operational(hpriv->hdev, NULL))
           ^
   drivers/misc/habanalabs/common/command_submission.c:3287:6: note: Assuming the condition is true
           if (flags & HL_WAIT_CS_FLAGS_INTERRUPT)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:3287:2: note: Taking true branch
           if (flags & HL_WAIT_CS_FLAGS_INTERRUPT)
           ^
   drivers/misc/habanalabs/common/command_submission.c:3288:8: note: Calling 'hl_interrupt_wait_ioctl'
                   rc = hl_interrupt_wait_ioctl(hpriv, data);
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:3221:2: note: 'timestamp' declared without an initial value
           u64 timestamp;
           ^~~~~~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:3226:6: note: Assuming field 'user_interrupt_count' is not equal to 0
           if (!prop->user_interrupt_count) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:3226:2: note: Taking false branch
           if (!prop->user_interrupt_count) {
           ^
   drivers/misc/habanalabs/common/command_submission.c:3231:17: note: Taking false branch
           interrupt_id = FIELD_GET(HL_WAIT_CS_FLAGS_INTERRUPT_MASK, args->in.flags);
                          ^
   include/linux/bitfield.h:125:3: note: expanded from macro 'FIELD_GET'
                   __BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: ");       \
                   ^
   include/linux/bitfield.h:62:3: note: expanded from macro '__BF_FIELD_CHECK'
                   BUILD_BUG_ON_MSG(!__builtin_constant_p(_mask),          \
                   ^
   include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
   #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                       ^
   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))                                       \
                   ^
   drivers/misc/habanalabs/common/command_submission.c:3231:17: note: Loop condition is false.  Exiting loop
           interrupt_id = FIELD_GET(HL_WAIT_CS_FLAGS_INTERRUPT_MASK, args->in.flags);
                          ^
   include/linux/bitfield.h:125:3: note: expanded from macro 'FIELD_GET'
                   __BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: ");       \
                   ^
   include/linux/bitfield.h:62:3: note: expanded from macro '__BF_FIELD_CHECK'
                   BUILD_BUG_ON_MSG(!__builtin_constant_p(_mask),          \
                   ^
   include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
   #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                       ^
   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 {                                                            \
           ^
   drivers/misc/habanalabs/common/command_submission.c:3231:17: note: -1048576 is not equal to 0
           interrupt_id = FIELD_GET(HL_WAIT_CS_FLAGS_INTERRUPT_MASK, args->in.flags);
                          ^
   include/linux/bitfield.h:125:3: note: expanded from macro 'FIELD_GET'
                   __BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: ");       \
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/bitfield.h:64:20: note: expanded from macro '__BF_FIELD_CHECK'
                   BUILD_BUG_ON_MSG((_mask) == 0, _pfx "mask is zero");    \
                   ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:39:58: note: expanded from macro 'BUILD_BUG_ON_MSG'
   #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                       ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
   include/linux/compiler_types.h:346:22: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:334:23: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:326:9: note: expanded from macro '__compiletime_assert'
                   if (!(condition))                                       \
                         ^~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:3231:17: note: Taking false branch
           interrupt_id = FIELD_GET(HL_WAIT_CS_FLAGS_INTERRUPT_MASK, args->in.flags);
                          ^
   include/linux/bitfield.h:125:3: note: expanded from macro 'FIELD_GET'
                   __BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: ");       \
                   ^
   include/linux/bitfield.h:64:3: note: expanded from macro '__BF_FIELD_CHECK'
                   BUILD_BUG_ON_MSG((_mask) == 0, _pfx "mask is zero");    \
                   ^
   include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
   #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)

vim +/hdev +152 drivers/misc/habanalabs/common/irq.c

9494a8dd8d22cb drivers/misc/habanalabs/irq.c        Oded Gabbay    2019-02-16  139  
402f801a3488a9 drivers/misc/habanalabs/common/irq.c farah kassabri 2021-12-23  140  /*
402f801a3488a9 drivers/misc/habanalabs/common/irq.c farah kassabri 2021-12-23  141   * hl_ts_free_objects - handler of the free objects workqueue.
402f801a3488a9 drivers/misc/habanalabs/common/irq.c farah kassabri 2021-12-23  142   * This function should put refcount to objects that the registration node
402f801a3488a9 drivers/misc/habanalabs/common/irq.c farah kassabri 2021-12-23  143   * took refcount to them.
402f801a3488a9 drivers/misc/habanalabs/common/irq.c farah kassabri 2021-12-23  144   * @work: workqueue object pointer
402f801a3488a9 drivers/misc/habanalabs/common/irq.c farah kassabri 2021-12-23  145   */
402f801a3488a9 drivers/misc/habanalabs/common/irq.c farah kassabri 2021-12-23  146  static void hl_ts_free_objects(struct work_struct *work)
402f801a3488a9 drivers/misc/habanalabs/common/irq.c farah kassabri 2021-12-23  147  {
402f801a3488a9 drivers/misc/habanalabs/common/irq.c farah kassabri 2021-12-23  148  	struct timestamp_reg_work_obj *job =
402f801a3488a9 drivers/misc/habanalabs/common/irq.c farah kassabri 2021-12-23  149  			container_of(work, struct timestamp_reg_work_obj, free_obj);
402f801a3488a9 drivers/misc/habanalabs/common/irq.c farah kassabri 2021-12-23  150  	struct timestamp_reg_free_node *free_obj, *temp_free_obj;
402f801a3488a9 drivers/misc/habanalabs/common/irq.c farah kassabri 2021-12-23  151  	struct list_head *free_list_head = job->free_obj_head;
402f801a3488a9 drivers/misc/habanalabs/common/irq.c farah kassabri 2021-12-23 @152  	struct hl_device *hdev = job->hdev;
402f801a3488a9 drivers/misc/habanalabs/common/irq.c farah kassabri 2021-12-23  153  
402f801a3488a9 drivers/misc/habanalabs/common/irq.c farah kassabri 2021-12-23  154  	list_for_each_entry_safe(free_obj, temp_free_obj, free_list_head, free_objects_node) {
402f801a3488a9 drivers/misc/habanalabs/common/irq.c farah kassabri 2021-12-23  155  		dev_dbg(hdev->dev, "About to put refcount to ts_buff (%p) cq_cb(%p)\n",
402f801a3488a9 drivers/misc/habanalabs/common/irq.c farah kassabri 2021-12-23  156  					free_obj->ts_buff,
402f801a3488a9 drivers/misc/habanalabs/common/irq.c farah kassabri 2021-12-23  157  					free_obj->cq_cb);
402f801a3488a9 drivers/misc/habanalabs/common/irq.c farah kassabri 2021-12-23  158  
402f801a3488a9 drivers/misc/habanalabs/common/irq.c farah kassabri 2021-12-23  159  		hl_ts_put(free_obj->ts_buff);
402f801a3488a9 drivers/misc/habanalabs/common/irq.c farah kassabri 2021-12-23  160  		hl_cb_put(free_obj->cq_cb);
402f801a3488a9 drivers/misc/habanalabs/common/irq.c farah kassabri 2021-12-23  161  		kfree(free_obj);
402f801a3488a9 drivers/misc/habanalabs/common/irq.c farah kassabri 2021-12-23  162  	}
402f801a3488a9 drivers/misc/habanalabs/common/irq.c farah kassabri 2021-12-23  163  
402f801a3488a9 drivers/misc/habanalabs/common/irq.c farah kassabri 2021-12-23  164  	kfree(free_list_head);
402f801a3488a9 drivers/misc/habanalabs/common/irq.c farah kassabri 2021-12-23  165  	kfree(job);
402f801a3488a9 drivers/misc/habanalabs/common/irq.c farah kassabri 2021-12-23  166  }
402f801a3488a9 drivers/misc/habanalabs/common/irq.c farah kassabri 2021-12-23  167  

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-30 11:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-30 11:35 [ogabbay:habanalabs-next 32/33] drivers/misc/habanalabs/common/irq.c:152:20: warning: Value stored to 'hdev' during its initialization is never read [clang-analyzer-deadcode.DeadStores] 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.