* drivers/net/ethernet/intel/ice/ice_ptp.c:109:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
@ 2022-06-02 16:16 kernel test robot
0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2022-06-02 16:16 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 16635 bytes --]
::::::
:::::: Manual check reason: "low confidence static check warning: drivers/net/ethernet/intel/ice/ice_ptp.c:109:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]"
::::::
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: Jacob Keller <jacob.e.keller@intel.com>
CC: Tony Nguyen <anthony.l.nguyen@intel.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: d1dc87763f406d4e67caf16dbe438a5647692395
commit: 67569a7f940130fcfe9041e07a614a5263a9944d ice: report the PTP clock index in ethtool .get_ts_info
date: 12 months ago
:::::: branch date: 15 hours ago
:::::: commit date: 12 months ago
config: s390-randconfig-c005-20220524 (https://download.01.org/0day-ci/archive/20220603/202206030022.cznYNbE1-lkp(a)intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 10c9ecce9f6096e18222a331c5e7d085bd813f75)
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 s390 cross compiling tool for clang build
# apt-get install binutils-s390x-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=67569a7f940130fcfe9041e07a614a5263a9944d
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 67569a7f940130fcfe9041e07a614a5263a9944d
# save the config file
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=s390 clang-analyzer
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
#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 18 warnings (6 in non-user code, 12 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.
19 warnings generated.
drivers/md/dm-snap-persistent.c:632:6: warning: Branch condition evaluates to a garbage value [clang-analyzer-core.uninitialized.Branch]
if (new_snapshot) {
^~~~~~~~~~~~
drivers/md/dm-snap-persistent.c:609:9: note: 'new_snapshot' declared without an initial value
int r, new_snapshot;
^~~~~~~~~~~~
drivers/md/dm-snap-persistent.c:615:6: note: Calling 'read_header'
r = read_header(ps, &new_snapshot);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/md/dm-snap-persistent.c:315:6: note: Assuming field 'chunk_size' is not equal to 0
if (!ps->store->chunk_size) {
^~~~~~~~~~~~~~~~~~~~~~
drivers/md/dm-snap-persistent.c:315:2: note: Taking false branch
if (!ps->store->chunk_size) {
^
drivers/md/dm-snap-persistent.c:325:2: note: Taking true branch
if (IS_ERR(ps->io_client))
^
drivers/md/dm-snap-persistent.c:326:3: note: Returning without writing to 'ps->callbacks', which participates in a condition later
return PTR_ERR(ps->io_client);
^
drivers/md/dm-snap-persistent.c:326:3: note: Returning without writing to '*new_snapshot'
drivers/md/dm-snap-persistent.c:326:3: note: Returning value, which participates in a condition later
return PTR_ERR(ps->io_client);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/md/dm-snap-persistent.c:615:6: note: Returning from 'read_header'
r = read_header(ps, &new_snapshot);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/md/dm-snap-persistent.c:616:6: note: Assuming 'r' is 0
if (r)
^
drivers/md/dm-snap-persistent.c:616:2: note: Taking false branch
if (r)
^
drivers/md/dm-snap-persistent.c:624:18: note: Calling 'kvcalloc'
ps->callbacks = kvcalloc(ps->exceptions_per_area,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mm.h:827:9: note: Calling 'kvmalloc_array'
return kvmalloc_array(n, size, flags | __GFP_ZERO);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mm.h:819:2: note: Taking false branch
if (unlikely(check_mul_overflow(n, size, &bytes)))
^
include/linux/mm.h:822:2: note: Returning pointer, which participates in a condition later
return kvmalloc(bytes, flags);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mm.h:827:9: note: Returning from 'kvmalloc_array'
return kvmalloc_array(n, size, flags | __GFP_ZERO);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mm.h:827:2: note: Returning pointer, which participates in a condition later
return kvmalloc_array(n, size, flags | __GFP_ZERO);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/md/dm-snap-persistent.c:624:18: note: Returning from 'kvcalloc'
ps->callbacks = kvcalloc(ps->exceptions_per_area,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/md/dm-snap-persistent.c:626:6: note: Assuming field 'callbacks' is non-null
if (!ps->callbacks)
^~~~~~~~~~~~~~
drivers/md/dm-snap-persistent.c:626:2: note: Taking false branch
if (!ps->callbacks)
^
drivers/md/dm-snap-persistent.c:632:6: note: Branch condition evaluates to a garbage value
if (new_snapshot) {
^~~~~~~~~~~~
Suppressed 18 warnings (6 in non-user code, 12 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.
29 warnings generated.
>> drivers/net/ethernet/intel/ice/ice_ptp.c:109:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
struct device *dev = ice_pf_to_dev(pf);
^~~
drivers/net/ethernet/intel/ice/ice_ptp.c:109:17: note: Value stored to 'dev' during its initialization is never read
struct device *dev = ice_pf_to_dev(pf);
^~~
include/linux/time64.h:67:50: warning: The left operand of '+' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
set_normalized_timespec64(&ts_delta, lhs.tv_sec + rhs.tv_sec,
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Left side of '&&' is false
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:15: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
drivers/net/ethernet/intel/ice/ice_ptp.h:22:2: note: expanded from macro '__ptp_info_to_ptp'
container_of((i), struct ice_ptp, info)
^
include/linux/kernel.h:716:61: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Taking false branch
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:15: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
drivers/net/ethernet/intel/ice/ice_ptp.h:22:2: note: expanded from macro '__ptp_info_to_ptp'
container_of((i), struct ice_ptp, info)
^
include/linux/kernel.h:716:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:328:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:308:3: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Loop condition is false. Exiting loop
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:15: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
drivers/net/ethernet/intel/ice/ice_ptp.h:22:2: note: expanded from macro '__ptp_info_to_ptp'
container_of((i), struct ice_ptp, info)
^
include/linux/kernel.h:716:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:328:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:306:2: note: expanded from macro '__compiletime_assert'
do { \
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Left side of '&&' is false
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:2: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
include/linux/kernel.h:716:61: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Taking false branch
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:2: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
include/linux/kernel.h:716:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
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:328:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:308:3: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Loop condition is false. Exiting loop
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:2: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
vim +/dev +109 drivers/net/ethernet/intel/ice/ice_ptp.c
67569a7f940130 Jacob Keller 2021-06-09 98
67569a7f940130 Jacob Keller 2021-06-09 99 /**
67569a7f940130 Jacob Keller 2021-06-09 100 * ice_clear_ptp_clock_index - Clear the PTP clock index
67569a7f940130 Jacob Keller 2021-06-09 101 * @pf: the PF pointer
67569a7f940130 Jacob Keller 2021-06-09 102 *
67569a7f940130 Jacob Keller 2021-06-09 103 * Clear the PTP clock index for this device. Must be called when
67569a7f940130 Jacob Keller 2021-06-09 104 * unregistering the PTP clock, in order to ensure other PFs stop reporting
67569a7f940130 Jacob Keller 2021-06-09 105 * a clock object that no longer exists.
67569a7f940130 Jacob Keller 2021-06-09 106 */
67569a7f940130 Jacob Keller 2021-06-09 107 static void ice_clear_ptp_clock_index(struct ice_pf *pf)
67569a7f940130 Jacob Keller 2021-06-09 108 {
67569a7f940130 Jacob Keller 2021-06-09 @109 struct device *dev = ice_pf_to_dev(pf);
67569a7f940130 Jacob Keller 2021-06-09 110 enum ice_aqc_driver_params param_idx;
67569a7f940130 Jacob Keller 2021-06-09 111 struct ice_hw *hw = &pf->hw;
67569a7f940130 Jacob Keller 2021-06-09 112 u8 tmr_idx;
67569a7f940130 Jacob Keller 2021-06-09 113 int err;
67569a7f940130 Jacob Keller 2021-06-09 114
67569a7f940130 Jacob Keller 2021-06-09 115 /* Do not clear the index if we don't own the timer */
67569a7f940130 Jacob Keller 2021-06-09 116 if (!hw->func_caps.ts_func_info.src_tmr_owned)
67569a7f940130 Jacob Keller 2021-06-09 117 return;
67569a7f940130 Jacob Keller 2021-06-09 118
67569a7f940130 Jacob Keller 2021-06-09 119 tmr_idx = hw->func_caps.ts_func_info.tmr_index_assoc;
67569a7f940130 Jacob Keller 2021-06-09 120 if (!tmr_idx)
67569a7f940130 Jacob Keller 2021-06-09 121 param_idx = ICE_AQC_DRIVER_PARAM_CLK_IDX_TMR0;
67569a7f940130 Jacob Keller 2021-06-09 122 else
67569a7f940130 Jacob Keller 2021-06-09 123 param_idx = ICE_AQC_DRIVER_PARAM_CLK_IDX_TMR1;
67569a7f940130 Jacob Keller 2021-06-09 124
67569a7f940130 Jacob Keller 2021-06-09 125 err = ice_aq_set_driver_param(hw, param_idx, 0, NULL);
67569a7f940130 Jacob Keller 2021-06-09 126 if (err) {
67569a7f940130 Jacob Keller 2021-06-09 127 dev_dbg(dev, "Failed to clear PTP clock index parameter, err %d aq_err %s\n",
67569a7f940130 Jacob Keller 2021-06-09 128 err, ice_aq_str(hw->adminq.sq_last_status));
67569a7f940130 Jacob Keller 2021-06-09 129 }
67569a7f940130 Jacob Keller 2021-06-09 130 }
67569a7f940130 Jacob Keller 2021-06-09 131
--
0-DAY CI Kernel Test Service
https://01.org/lkp
^ permalink raw reply [flat|nested] 6+ messages in thread
* drivers/net/ethernet/intel/ice/ice_ptp.c:109:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
@ 2022-06-06 19:13 kernel test robot
0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2022-06-06 19:13 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 17755 bytes --]
::::::
:::::: Manual check reason: "low confidence static check warning: drivers/net/ethernet/intel/ice/ice_ptp.c:109:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]"
::::::
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: Jacob Keller <jacob.e.keller@intel.com>
CC: Tony Nguyen <anthony.l.nguyen@intel.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: f2906aa863381afb0015a9eb7fefad885d4e5a56
commit: 67569a7f940130fcfe9041e07a614a5263a9944d ice: report the PTP clock index in ethtool .get_ts_info
date: 12 months ago
:::::: branch date: 19 hours ago
:::::: commit date: 12 months ago
config: s390-randconfig-c005-20220524 (https://download.01.org/0day-ci/archive/20220607/202206070307.PzBoZv2D-lkp(a)intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 134d7f9a4b97e9035150d970bd9e376043c4577e)
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 s390 cross compiling tool for clang build
# apt-get install binutils-s390x-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=67569a7f940130fcfe9041e07a614a5263a9944d
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 67569a7f940130fcfe9041e07a614a5263a9944d
# save the config file
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=s390 clang-analyzer
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
^
include/linux/percpu-defs.h:217:37: note: expanded from macro '__verify_pcpu_ptr'
#define __verify_pcpu_ptr(ptr) \
^
include/linux/percpu-refcount.h:320:3: note: Control jumps to 'case 8:' at line 320
this_cpu_sub(*percpu_count, nr);
^
include/linux/percpu-defs.h:519:33: note: expanded from macro 'this_cpu_sub'
#define this_cpu_sub(pcp, val) this_cpu_add(pcp, -(typeof(pcp))(val))
^
include/linux/percpu-defs.h:509:33: note: expanded from macro 'this_cpu_add'
#define this_cpu_add(pcp, val) __pcpu_size_call(this_cpu_add_, pcp, val)
^
include/linux/percpu-defs.h:376:2: note: expanded from macro '__pcpu_size_call'
switch(sizeof(variable)) { \
^
include/linux/percpu-refcount.h:320:3: note: Loop condition is false. Exiting loop
this_cpu_sub(*percpu_count, nr);
^
include/linux/percpu-defs.h:519:33: note: expanded from macro 'this_cpu_sub'
#define this_cpu_sub(pcp, val) this_cpu_add(pcp, -(typeof(pcp))(val))
^
include/linux/percpu-defs.h:509:33: note: expanded from macro 'this_cpu_add'
#define this_cpu_add(pcp, val) __pcpu_size_call(this_cpu_add_, pcp, val)
^
include/linux/percpu-defs.h:380:11: note: expanded from macro '__pcpu_size_call'
case 8: stem##8(variable, __VA_ARGS__);break; \
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
arch/s390/include/asm/percpu.h:91:34: note: expanded from macro 'this_cpu_add_8'
#define this_cpu_add_8(pcp, val) arch_this_cpu_add(pcp, val, "laag", "agsi", long)
^
arch/s390/include/asm/percpu.h:71:2: note: expanded from macro 'arch_this_cpu_add'
preempt_disable_notrace(); \
^
include/linux/preempt.h:228:35: note: expanded from macro 'preempt_disable_notrace'
#define preempt_disable_notrace() \
^
include/linux/percpu-refcount.h:320:3: note: Loop condition is false. Exiting loop
this_cpu_sub(*percpu_count, nr);
^
include/linux/percpu-defs.h:519:33: note: expanded from macro 'this_cpu_sub'
#define this_cpu_sub(pcp, val) this_cpu_add(pcp, -(typeof(pcp))(val))
^
include/linux/percpu-defs.h:509:33: note: expanded from macro 'this_cpu_add'
#define this_cpu_add(pcp, val) __pcpu_size_call(this_cpu_add_, pcp, val)
^
include/linux/percpu-defs.h:380:11: note: expanded from macro '__pcpu_size_call'
case 8: stem##8(variable, __VA_ARGS__);break; \
^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
arch/s390/include/asm/percpu.h:72:10: note: expanded from macro 'arch_this_cpu_add'
ptr__ = raw_cpu_ptr(&(pcp)); \
^
include/linux/percpu-defs.h:241:2: note: expanded from macro 'raw_cpu_ptr'
__verify_pcpu_ptr(ptr); \
^
include/linux/percpu-defs.h:217:37: note: expanded from macro '__verify_pcpu_ptr'
#define __verify_pcpu_ptr(ptr) \
^
include/linux/percpu-refcount.h:320:3: note: Dereference of null pointer
this_cpu_sub(*percpu_count, nr);
^
include/linux/percpu-defs.h:519:33: note: expanded from macro 'this_cpu_sub'
#define this_cpu_sub(pcp, val) this_cpu_add(pcp, -(typeof(pcp))(val))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:509:33: note: expanded from macro 'this_cpu_add'
#define this_cpu_add(pcp, val) __pcpu_size_call(this_cpu_add_, pcp, val)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:380:11: note: expanded from macro '__pcpu_size_call'
case 8: stem##8(variable, __VA_ARGS__);break; \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
note: (skipping 4 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/asm-generic/percpu.h:44:31: note: expanded from macro 'arch_raw_cpu_ptr'
#define arch_raw_cpu_ptr(ptr) SHIFT_PERCPU_PTR(ptr, __my_cpu_offset)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:231:2: note: expanded from macro 'SHIFT_PERCPU_PTR'
RELOC_HIDE((typeof(*(__p)) __kernel __force *)(__p), (__offset))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:182:28: note: expanded from macro 'RELOC_HIDE'
(typeof(ptr)) (__ptr + (off)); })
^~~~~
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.
25 warnings generated.
drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_powertune.c:978:3: warning: Value stored to 'value' is never read [clang-analyzer-deadcode.DeadStores]
value = 0;
^ ~
drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_powertune.c:978:3: note: Value stored to 'value' is never read
value = 0;
^ ~
Suppressed 24 warnings (12 in non-user code, 12 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.
24 warnings generated.
Suppressed 24 warnings (12 in non-user code, 12 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.
24 warnings generated.
Suppressed 24 warnings (12 in non-user code, 12 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.
29 warnings generated.
>> drivers/net/ethernet/intel/ice/ice_ptp.c:109:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
struct device *dev = ice_pf_to_dev(pf);
^~~
drivers/net/ethernet/intel/ice/ice_ptp.c:109:17: note: Value stored to 'dev' during its initialization is never read
struct device *dev = ice_pf_to_dev(pf);
^~~
include/linux/time64.h:67:50: warning: The left operand of '+' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
set_normalized_timespec64(&ts_delta, lhs.tv_sec + rhs.tv_sec,
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Left side of '&&' is false
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:15: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
drivers/net/ethernet/intel/ice/ice_ptp.h:22:2: note: expanded from macro '__ptp_info_to_ptp'
container_of((i), struct ice_ptp, info)
^
include/linux/kernel.h:716:61: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Taking false branch
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:15: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
drivers/net/ethernet/intel/ice/ice_ptp.h:22:2: note: expanded from macro '__ptp_info_to_ptp'
container_of((i), struct ice_ptp, info)
^
include/linux/kernel.h:716:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:328:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:308:3: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Loop condition is false. Exiting loop
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:15: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
drivers/net/ethernet/intel/ice/ice_ptp.h:22:2: note: expanded from macro '__ptp_info_to_ptp'
container_of((i), struct ice_ptp, info)
^
include/linux/kernel.h:716:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:328:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:306:2: note: expanded from macro '__compiletime_assert'
do { \
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Left side of '&&' is false
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:2: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
include/linux/kernel.h:716:61: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Taking false branch
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:2: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
include/linux/kernel.h:716:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
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:328:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:308:3: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Loop condition is false. Exiting loop
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:2: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
vim +/dev +109 drivers/net/ethernet/intel/ice/ice_ptp.c
67569a7f940130 Jacob Keller 2021-06-09 98
67569a7f940130 Jacob Keller 2021-06-09 99 /**
67569a7f940130 Jacob Keller 2021-06-09 100 * ice_clear_ptp_clock_index - Clear the PTP clock index
67569a7f940130 Jacob Keller 2021-06-09 101 * @pf: the PF pointer
67569a7f940130 Jacob Keller 2021-06-09 102 *
67569a7f940130 Jacob Keller 2021-06-09 103 * Clear the PTP clock index for this device. Must be called when
67569a7f940130 Jacob Keller 2021-06-09 104 * unregistering the PTP clock, in order to ensure other PFs stop reporting
67569a7f940130 Jacob Keller 2021-06-09 105 * a clock object that no longer exists.
67569a7f940130 Jacob Keller 2021-06-09 106 */
67569a7f940130 Jacob Keller 2021-06-09 107 static void ice_clear_ptp_clock_index(struct ice_pf *pf)
67569a7f940130 Jacob Keller 2021-06-09 108 {
67569a7f940130 Jacob Keller 2021-06-09 @109 struct device *dev = ice_pf_to_dev(pf);
67569a7f940130 Jacob Keller 2021-06-09 110 enum ice_aqc_driver_params param_idx;
67569a7f940130 Jacob Keller 2021-06-09 111 struct ice_hw *hw = &pf->hw;
67569a7f940130 Jacob Keller 2021-06-09 112 u8 tmr_idx;
67569a7f940130 Jacob Keller 2021-06-09 113 int err;
67569a7f940130 Jacob Keller 2021-06-09 114
67569a7f940130 Jacob Keller 2021-06-09 115 /* Do not clear the index if we don't own the timer */
67569a7f940130 Jacob Keller 2021-06-09 116 if (!hw->func_caps.ts_func_info.src_tmr_owned)
67569a7f940130 Jacob Keller 2021-06-09 117 return;
67569a7f940130 Jacob Keller 2021-06-09 118
67569a7f940130 Jacob Keller 2021-06-09 119 tmr_idx = hw->func_caps.ts_func_info.tmr_index_assoc;
67569a7f940130 Jacob Keller 2021-06-09 120 if (!tmr_idx)
67569a7f940130 Jacob Keller 2021-06-09 121 param_idx = ICE_AQC_DRIVER_PARAM_CLK_IDX_TMR0;
67569a7f940130 Jacob Keller 2021-06-09 122 else
67569a7f940130 Jacob Keller 2021-06-09 123 param_idx = ICE_AQC_DRIVER_PARAM_CLK_IDX_TMR1;
67569a7f940130 Jacob Keller 2021-06-09 124
67569a7f940130 Jacob Keller 2021-06-09 125 err = ice_aq_set_driver_param(hw, param_idx, 0, NULL);
67569a7f940130 Jacob Keller 2021-06-09 126 if (err) {
67569a7f940130 Jacob Keller 2021-06-09 127 dev_dbg(dev, "Failed to clear PTP clock index parameter, err %d aq_err %s\n",
67569a7f940130 Jacob Keller 2021-06-09 128 err, ice_aq_str(hw->adminq.sq_last_status));
67569a7f940130 Jacob Keller 2021-06-09 129 }
67569a7f940130 Jacob Keller 2021-06-09 130 }
67569a7f940130 Jacob Keller 2021-06-09 131
--
0-DAY CI Kernel Test Service
https://01.org/lkp
^ permalink raw reply [flat|nested] 6+ messages in thread
* drivers/net/ethernet/intel/ice/ice_ptp.c:109:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
@ 2022-06-05 14:42 kernel test robot
0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2022-06-05 14:42 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 17426 bytes --]
::::::
:::::: Manual check reason: "low confidence static check warning: drivers/net/ethernet/intel/ice/ice_ptp.c:109:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]"
::::::
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: Jacob Keller <jacob.e.keller@intel.com>
CC: Tony Nguyen <anthony.l.nguyen@intel.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 952923ddc01120190dcf671e7b354364ce1d1362
commit: 67569a7f940130fcfe9041e07a614a5263a9944d ice: report the PTP clock index in ethtool .get_ts_info
date: 12 months ago
:::::: branch date: 12 hours ago
:::::: commit date: 12 months ago
config: s390-randconfig-c005-20220524 (https://download.01.org/0day-ci/archive/20220605/202206052203.aYd8tcdY-lkp(a)intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 10c9ecce9f6096e18222a331c5e7d085bd813f75)
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 s390 cross compiling tool for clang build
# apt-get install binutils-s390x-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=67569a7f940130fcfe9041e07a614a5263a9944d
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 67569a7f940130fcfe9041e07a614a5263a9944d
# save the config file
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=s390 clang-analyzer
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
^
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c:8256:14: note: Assuming 'data_len' is 0
if (likely(!data_len))
^
include/linux/compiler.h:77:40: note: expanded from macro 'likely'
# define likely(x) __builtin_expect(!!(x), 1)
^
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c:8256:3: note: Taking true branch
if (likely(!data_len))
^
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c:8257:4: note: Execution continues on line 8283
break;
^
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c:8307:6: note: Assuming 'i' is not equal to field 'count'
if (i == tx_ring->count)
^~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c:8307:2: note: Taking false branch
if (i == tx_ring->count)
^
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c:8314:6: note: Assuming the condition is false
if (netif_xmit_stopped(txring_txq(tx_ring)) || !netdev_xmit_more()) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c:8314:6: note: Left side of '||' is false
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c:8314:50: note: Calling 'netdev_xmit_more'
if (netif_xmit_stopped(txring_txq(tx_ring)) || !netdev_xmit_more()) {
^~~~~~~~~~~~~~~~~~
include/linux/netdevice.h:4949:9: note: Loop condition is false. Exiting loop
return __this_cpu_read(softnet_data.xmit.more);
^
include/linux/percpu-defs.h:446:2: note: expanded from macro '__this_cpu_read'
raw_cpu_read(pcp); \
^
include/linux/percpu-defs.h:420:28: note: expanded from macro 'raw_cpu_read'
#define raw_cpu_read(pcp) __pcpu_size_call_return(raw_cpu_read_, pcp)
^
include/linux/percpu-defs.h:319:2: note: expanded from macro '__pcpu_size_call_return'
__verify_pcpu_ptr(&(variable)); \
^
include/linux/percpu-defs.h:217:37: note: expanded from macro '__verify_pcpu_ptr'
#define __verify_pcpu_ptr(ptr) \
^
include/linux/netdevice.h:4949:9: note: Control jumps to 'case 1:' at line 4949
return __this_cpu_read(softnet_data.xmit.more);
^
include/linux/percpu-defs.h:446:2: note: expanded from macro '__this_cpu_read'
raw_cpu_read(pcp); \
^
include/linux/percpu-defs.h:420:28: note: expanded from macro 'raw_cpu_read'
#define raw_cpu_read(pcp) __pcpu_size_call_return(raw_cpu_read_, pcp)
^
include/linux/percpu-defs.h:320:2: note: expanded from macro '__pcpu_size_call_return'
switch(sizeof(variable)) { \
^
include/linux/netdevice.h:4949:9: note: Loop condition is false. Exiting loop
return __this_cpu_read(softnet_data.xmit.more);
^
include/linux/percpu-defs.h:446:2: note: expanded from macro '__this_cpu_read'
raw_cpu_read(pcp); \
^
include/linux/percpu-defs.h:420:28: note: expanded from macro 'raw_cpu_read'
#define raw_cpu_read(pcp) __pcpu_size_call_return(raw_cpu_read_, pcp)
^
include/linux/percpu-defs.h:321:23: note: expanded from macro '__pcpu_size_call_return'
case 1: pscr_ret__ = stem##1(variable); break; \
^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/asm-generic/percpu.h:67:3: note: expanded from macro 'raw_cpu_generic_read'
*raw_cpu_ptr(&(pcp)); \
^
include/linux/percpu-defs.h:241:2: note: expanded from macro 'raw_cpu_ptr'
__verify_pcpu_ptr(ptr); \
^
include/linux/percpu-defs.h:217:37: note: expanded from macro '__verify_pcpu_ptr'
#define __verify_pcpu_ptr(ptr) \
^
include/linux/netdevice.h:4949:9: note: Dereference of null pointer
return __this_cpu_read(softnet_data.xmit.more);
^
include/linux/percpu-defs.h:446:2: note: expanded from macro '__this_cpu_read'
raw_cpu_read(pcp); \
^~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:420:28: note: expanded from macro 'raw_cpu_read'
#define raw_cpu_read(pcp) __pcpu_size_call_return(raw_cpu_read_, pcp)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:321:23: note: expanded from macro '__pcpu_size_call_return'
case 1: pscr_ret__ = stem##1(variable); break; \
^~~~~~~~~~~~~~~~~
note: (skipping 4 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/asm-generic/percpu.h:44:31: note: expanded from macro 'arch_raw_cpu_ptr'
#define arch_raw_cpu_ptr(ptr) SHIFT_PERCPU_PTR(ptr, __my_cpu_offset)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:231:2: note: expanded from macro 'SHIFT_PERCPU_PTR'
RELOC_HIDE((typeof(*(__p)) __kernel __force *)(__p), (__offset))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:182:28: note: expanded from macro 'RELOC_HIDE'
(typeof(ptr)) (__ptr + (off)); })
^~~~~
Suppressed 29 warnings (17 in non-user code, 12 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.
29 warnings generated.
>> drivers/net/ethernet/intel/ice/ice_ptp.c:109:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
struct device *dev = ice_pf_to_dev(pf);
^~~
drivers/net/ethernet/intel/ice/ice_ptp.c:109:17: note: Value stored to 'dev' during its initialization is never read
struct device *dev = ice_pf_to_dev(pf);
^~~
include/linux/time64.h:67:50: warning: The left operand of '+' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
set_normalized_timespec64(&ts_delta, lhs.tv_sec + rhs.tv_sec,
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Left side of '&&' is false
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:15: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
drivers/net/ethernet/intel/ice/ice_ptp.h:22:2: note: expanded from macro '__ptp_info_to_ptp'
container_of((i), struct ice_ptp, info)
^
include/linux/kernel.h:716:61: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Taking false branch
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:15: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
drivers/net/ethernet/intel/ice/ice_ptp.h:22:2: note: expanded from macro '__ptp_info_to_ptp'
container_of((i), struct ice_ptp, info)
^
include/linux/kernel.h:716:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:328:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:308:3: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Loop condition is false. Exiting loop
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:15: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
drivers/net/ethernet/intel/ice/ice_ptp.h:22:2: note: expanded from macro '__ptp_info_to_ptp'
container_of((i), struct ice_ptp, info)
^
include/linux/kernel.h:716:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:328:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:306:2: note: expanded from macro '__compiletime_assert'
do { \
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Left side of '&&' is false
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:2: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
include/linux/kernel.h:716:61: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Taking false branch
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:2: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
include/linux/kernel.h:716:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
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:328:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:308:3: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Loop condition is false. Exiting loop
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:2: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
vim +/dev +109 drivers/net/ethernet/intel/ice/ice_ptp.c
67569a7f940130 Jacob Keller 2021-06-09 98
67569a7f940130 Jacob Keller 2021-06-09 99 /**
67569a7f940130 Jacob Keller 2021-06-09 100 * ice_clear_ptp_clock_index - Clear the PTP clock index
67569a7f940130 Jacob Keller 2021-06-09 101 * @pf: the PF pointer
67569a7f940130 Jacob Keller 2021-06-09 102 *
67569a7f940130 Jacob Keller 2021-06-09 103 * Clear the PTP clock index for this device. Must be called when
67569a7f940130 Jacob Keller 2021-06-09 104 * unregistering the PTP clock, in order to ensure other PFs stop reporting
67569a7f940130 Jacob Keller 2021-06-09 105 * a clock object that no longer exists.
67569a7f940130 Jacob Keller 2021-06-09 106 */
67569a7f940130 Jacob Keller 2021-06-09 107 static void ice_clear_ptp_clock_index(struct ice_pf *pf)
67569a7f940130 Jacob Keller 2021-06-09 108 {
67569a7f940130 Jacob Keller 2021-06-09 @109 struct device *dev = ice_pf_to_dev(pf);
67569a7f940130 Jacob Keller 2021-06-09 110 enum ice_aqc_driver_params param_idx;
67569a7f940130 Jacob Keller 2021-06-09 111 struct ice_hw *hw = &pf->hw;
67569a7f940130 Jacob Keller 2021-06-09 112 u8 tmr_idx;
67569a7f940130 Jacob Keller 2021-06-09 113 int err;
67569a7f940130 Jacob Keller 2021-06-09 114
67569a7f940130 Jacob Keller 2021-06-09 115 /* Do not clear the index if we don't own the timer */
67569a7f940130 Jacob Keller 2021-06-09 116 if (!hw->func_caps.ts_func_info.src_tmr_owned)
67569a7f940130 Jacob Keller 2021-06-09 117 return;
67569a7f940130 Jacob Keller 2021-06-09 118
67569a7f940130 Jacob Keller 2021-06-09 119 tmr_idx = hw->func_caps.ts_func_info.tmr_index_assoc;
67569a7f940130 Jacob Keller 2021-06-09 120 if (!tmr_idx)
67569a7f940130 Jacob Keller 2021-06-09 121 param_idx = ICE_AQC_DRIVER_PARAM_CLK_IDX_TMR0;
67569a7f940130 Jacob Keller 2021-06-09 122 else
67569a7f940130 Jacob Keller 2021-06-09 123 param_idx = ICE_AQC_DRIVER_PARAM_CLK_IDX_TMR1;
67569a7f940130 Jacob Keller 2021-06-09 124
67569a7f940130 Jacob Keller 2021-06-09 125 err = ice_aq_set_driver_param(hw, param_idx, 0, NULL);
67569a7f940130 Jacob Keller 2021-06-09 126 if (err) {
67569a7f940130 Jacob Keller 2021-06-09 127 dev_dbg(dev, "Failed to clear PTP clock index parameter, err %d aq_err %s\n",
67569a7f940130 Jacob Keller 2021-06-09 128 err, ice_aq_str(hw->adminq.sq_last_status));
67569a7f940130 Jacob Keller 2021-06-09 129 }
67569a7f940130 Jacob Keller 2021-06-09 130 }
67569a7f940130 Jacob Keller 2021-06-09 131
--
0-DAY CI Kernel Test Service
https://01.org/lkp
^ permalink raw reply [flat|nested] 6+ messages in thread
* drivers/net/ethernet/intel/ice/ice_ptp.c:109:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
@ 2022-06-02 7:33 kernel test robot
0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2022-06-02 7:33 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 16918 bytes --]
::::::
:::::: Manual check reason: "low confidence static check warning: drivers/net/ethernet/intel/ice/ice_ptp.c:109:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]"
::::::
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: Jacob Keller <jacob.e.keller@intel.com>
CC: Tony Nguyen <anthony.l.nguyen@intel.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: d1dc87763f406d4e67caf16dbe438a5647692395
commit: 67569a7f940130fcfe9041e07a614a5263a9944d ice: report the PTP clock index in ethtool .get_ts_info
date: 12 months ago
:::::: branch date: 6 hours ago
:::::: commit date: 12 months ago
config: s390-randconfig-c005-20220524 (https://download.01.org/0day-ci/archive/20220602/202206021535.sYPEI5L1-lkp(a)intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 134d7f9a4b97e9035150d970bd9e376043c4577e)
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 s390 cross compiling tool for clang build
# apt-get install binutils-s390x-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=67569a7f940130fcfe9041e07a614a5263a9944d
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 67569a7f940130fcfe9041e07a614a5263a9944d
# save the config file
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=s390 clang-analyzer
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
^
include/linux/spinlock.h:250:2: note: expanded from macro 'raw_spin_lock_irqsave'
do { \
^
drivers/ata/libata-eh.c:530:2: note: Loop condition is false. Exiting loop
spin_lock_irqsave(host->host_lock, flags);
^
include/linux/spinlock.h:382:43: note: expanded from macro 'spin_lock_irqsave'
#define spin_lock_irqsave(lock, flags) \
^
drivers/ata/libata-eh.c:538:2: note: Calling 'ata_scsi_port_error_handler'
ata_scsi_port_error_handler(host, ap);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/ata/libata-eh.c:654:6: note: Assuming field 'error_handler' is non-null
if (ap->ops->error_handler) {
^~~~~~~~~~~~~~~~~~~~~~
drivers/ata/libata-eh.c:654:2: note: Taking true branch
if (ap->ops->error_handler) {
^
drivers/ata/libata-eh.c:658:3: note: Calling 'ata_eh_acquire'
ata_eh_acquire(ap);
^~~~~~~~~~~~~~~~~~
drivers/ata/libata-eh.c:464:2: note: Assuming field 'eh_owner' is null
WARN_ON_ONCE(ap->host->eh_owner);
^
include/asm-generic/bug.h:102:23: note: expanded from macro 'WARN_ON_ONCE'
int __ret_warn_on = !!(condition); \
^~~~~~~~~~~~
drivers/ata/libata-eh.c:464:2: note: Taking false branch
WARN_ON_ONCE(ap->host->eh_owner);
^
include/asm-generic/bug.h:103:2: note: expanded from macro 'WARN_ON_ONCE'
if (unlikely(__ret_warn_on)) \
^
drivers/ata/libata-eh.c:465:23: note: Dereference of null pointer
ap->host->eh_owner = current;
^
arch/s390/include/asm/current.h:17:45: note: expanded from macro 'current'
#define current ((struct task_struct *const)S390_lowcore.current_task)
^~~~~~~~~~~~~~~~~~~~~~~~~
arch/s390/include/asm/lowcore.h:192:22: note: expanded from macro 'S390_lowcore'
#define S390_lowcore (*((struct lowcore *) 0))
^
drivers/ata/libata-eh.c:480:37: warning: Dereference of null pointer [clang-analyzer-core.NullDereference]
WARN_ON_ONCE(ap->host->eh_owner != current);
^
arch/s390/include/asm/current.h:17:45: note: expanded from macro 'current'
#define current ((struct task_struct *const)S390_lowcore.current_task)
^
arch/s390/include/asm/lowcore.h:192:22: note: expanded from macro 'S390_lowcore'
#define S390_lowcore (*((struct lowcore *) 0))
^
include/asm-generic/bug.h:102:25: note: expanded from macro 'WARN_ON_ONCE'
int __ret_warn_on = !!(condition); \
^~~~~~~~~
drivers/ata/libata-eh.c:480:37: note: Dereference of null pointer
WARN_ON_ONCE(ap->host->eh_owner != current);
^
arch/s390/include/asm/current.h:17:45: note: expanded from macro 'current'
#define current ((struct task_struct *const)S390_lowcore.current_task)
^
arch/s390/include/asm/lowcore.h:192:22: note: expanded from macro 'S390_lowcore'
#define S390_lowcore (*((struct lowcore *) 0))
^
include/asm-generic/bug.h:102:25: note: expanded from macro 'WARN_ON_ONCE'
int __ret_warn_on = !!(condition); \
^~~~~~~~~
drivers/ata/libata-eh.c:777:2: warning: Dereference of null pointer [clang-analyzer-core.NullDereference]
DEFINE_WAIT(wait);
^
include/linux/wait.h:1153:27: note: expanded from macro 'DEFINE_WAIT'
#define DEFINE_WAIT(name) DEFINE_WAIT_FUNC(name, autoremove_wake_function)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/wait.h:1148:14: note: expanded from macro 'DEFINE_WAIT_FUNC'
.private = current, \
^~~~~~~
arch/s390/include/asm/current.h:17:45: note: expanded from macro 'current'
#define current ((struct task_struct *const)S390_lowcore.current_task)
^~~~~~~~~~~~~~~~~~~~~~~~~
arch/s390/include/asm/lowcore.h:192:22: note: expanded from macro 'S390_lowcore'
#define S390_lowcore (*((struct lowcore *) 0))
^
drivers/ata/libata-eh.c:777:2: note: Dereference of null pointer
DEFINE_WAIT(wait);
^
include/linux/wait.h:1153:27: note: expanded from macro 'DEFINE_WAIT'
#define DEFINE_WAIT(name) DEFINE_WAIT_FUNC(name, autoremove_wake_function)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/wait.h:1148:14: note: expanded from macro 'DEFINE_WAIT_FUNC'
.private = current, \
^~~~~~~
arch/s390/include/asm/current.h:17:45: note: expanded from macro 'current'
#define current ((struct task_struct *const)S390_lowcore.current_task)
^~~~~~~~~~~~~~~~~~~~~~~~~
arch/s390/include/asm/lowcore.h:192:22: note: expanded from macro 'S390_lowcore'
#define S390_lowcore (*((struct lowcore *) 0))
^
Suppressed 21 warnings (9 in non-user code, 12 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.
29 warnings generated.
>> drivers/net/ethernet/intel/ice/ice_ptp.c:109:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
struct device *dev = ice_pf_to_dev(pf);
^~~
drivers/net/ethernet/intel/ice/ice_ptp.c:109:17: note: Value stored to 'dev' during its initialization is never read
struct device *dev = ice_pf_to_dev(pf);
^~~
include/linux/time64.h:67:50: warning: The left operand of '+' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
set_normalized_timespec64(&ts_delta, lhs.tv_sec + rhs.tv_sec,
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Left side of '&&' is false
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:15: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
drivers/net/ethernet/intel/ice/ice_ptp.h:22:2: note: expanded from macro '__ptp_info_to_ptp'
container_of((i), struct ice_ptp, info)
^
include/linux/kernel.h:716:61: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Taking false branch
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:15: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
drivers/net/ethernet/intel/ice/ice_ptp.h:22:2: note: expanded from macro '__ptp_info_to_ptp'
container_of((i), struct ice_ptp, info)
^
include/linux/kernel.h:716:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:328:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:308:3: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Loop condition is false. Exiting loop
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:15: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
drivers/net/ethernet/intel/ice/ice_ptp.h:22:2: note: expanded from macro '__ptp_info_to_ptp'
container_of((i), struct ice_ptp, info)
^
include/linux/kernel.h:716:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:328:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:306:2: note: expanded from macro '__compiletime_assert'
do { \
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Left side of '&&' is false
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:2: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
include/linux/kernel.h:716:61: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Taking false branch
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:2: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
include/linux/kernel.h:716:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
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:328:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:308:3: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Loop condition is false. Exiting loop
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:2: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
vim +/dev +109 drivers/net/ethernet/intel/ice/ice_ptp.c
67569a7f940130 Jacob Keller 2021-06-09 98
67569a7f940130 Jacob Keller 2021-06-09 99 /**
67569a7f940130 Jacob Keller 2021-06-09 100 * ice_clear_ptp_clock_index - Clear the PTP clock index
67569a7f940130 Jacob Keller 2021-06-09 101 * @pf: the PF pointer
67569a7f940130 Jacob Keller 2021-06-09 102 *
67569a7f940130 Jacob Keller 2021-06-09 103 * Clear the PTP clock index for this device. Must be called when
67569a7f940130 Jacob Keller 2021-06-09 104 * unregistering the PTP clock, in order to ensure other PFs stop reporting
67569a7f940130 Jacob Keller 2021-06-09 105 * a clock object that no longer exists.
67569a7f940130 Jacob Keller 2021-06-09 106 */
67569a7f940130 Jacob Keller 2021-06-09 107 static void ice_clear_ptp_clock_index(struct ice_pf *pf)
67569a7f940130 Jacob Keller 2021-06-09 108 {
67569a7f940130 Jacob Keller 2021-06-09 @109 struct device *dev = ice_pf_to_dev(pf);
67569a7f940130 Jacob Keller 2021-06-09 110 enum ice_aqc_driver_params param_idx;
67569a7f940130 Jacob Keller 2021-06-09 111 struct ice_hw *hw = &pf->hw;
67569a7f940130 Jacob Keller 2021-06-09 112 u8 tmr_idx;
67569a7f940130 Jacob Keller 2021-06-09 113 int err;
67569a7f940130 Jacob Keller 2021-06-09 114
67569a7f940130 Jacob Keller 2021-06-09 115 /* Do not clear the index if we don't own the timer */
67569a7f940130 Jacob Keller 2021-06-09 116 if (!hw->func_caps.ts_func_info.src_tmr_owned)
67569a7f940130 Jacob Keller 2021-06-09 117 return;
67569a7f940130 Jacob Keller 2021-06-09 118
67569a7f940130 Jacob Keller 2021-06-09 119 tmr_idx = hw->func_caps.ts_func_info.tmr_index_assoc;
67569a7f940130 Jacob Keller 2021-06-09 120 if (!tmr_idx)
67569a7f940130 Jacob Keller 2021-06-09 121 param_idx = ICE_AQC_DRIVER_PARAM_CLK_IDX_TMR0;
67569a7f940130 Jacob Keller 2021-06-09 122 else
67569a7f940130 Jacob Keller 2021-06-09 123 param_idx = ICE_AQC_DRIVER_PARAM_CLK_IDX_TMR1;
67569a7f940130 Jacob Keller 2021-06-09 124
67569a7f940130 Jacob Keller 2021-06-09 125 err = ice_aq_set_driver_param(hw, param_idx, 0, NULL);
67569a7f940130 Jacob Keller 2021-06-09 126 if (err) {
67569a7f940130 Jacob Keller 2021-06-09 127 dev_dbg(dev, "Failed to clear PTP clock index parameter, err %d aq_err %s\n",
67569a7f940130 Jacob Keller 2021-06-09 128 err, ice_aq_str(hw->adminq.sq_last_status));
67569a7f940130 Jacob Keller 2021-06-09 129 }
67569a7f940130 Jacob Keller 2021-06-09 130 }
67569a7f940130 Jacob Keller 2021-06-09 131
--
0-DAY CI Kernel Test Service
https://01.org/lkp
^ permalink raw reply [flat|nested] 6+ messages in thread
* drivers/net/ethernet/intel/ice/ice_ptp.c:109:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
@ 2022-05-29 6:27 kernel test robot
0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2022-05-29 6:27 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 17000 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: Jacob Keller <jacob.e.keller@intel.com>
CC: Tony Nguyen <anthony.l.nguyen@intel.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 9d004b2f4fea97cde123e7f1939b80e77bf2e695
commit: 67569a7f940130fcfe9041e07a614a5263a9944d ice: report the PTP clock index in ethtool .get_ts_info
date: 12 months ago
:::::: branch date: 26 hours ago
:::::: commit date: 12 months ago
config: s390-randconfig-c005-20220524 (https://download.01.org/0day-ci/archive/20220529/202205291455.l3CbC31D-lkp(a)intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 134d7f9a4b97e9035150d970bd9e376043c4577e)
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 s390 cross compiling tool for clang build
# apt-get install binutils-s390x-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=67569a7f940130fcfe9041e07a614a5263a9944d
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 67569a7f940130fcfe9041e07a614a5263a9944d
# save the config file
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=s390 clang-analyzer
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
if (skb_put_padto(skb, ETH_ZLEN) < 0)
^
drivers/net/ethernet/rdc/r6040.c:803:2: note: Loop condition is false. Exiting loop
spin_lock_irqsave(&lp->lock, flags);
^
include/linux/spinlock.h:384:2: note: expanded from macro 'spin_lock_irqsave'
raw_spin_lock_irqsave(spinlock_check(lock), flags); \
^
include/linux/spinlock.h:250:2: note: expanded from macro 'raw_spin_lock_irqsave'
do { \
^
drivers/net/ethernet/rdc/r6040.c:803:2: note: Loop condition is false. Exiting loop
spin_lock_irqsave(&lp->lock, flags);
^
include/linux/spinlock.h:382:43: note: expanded from macro 'spin_lock_irqsave'
#define spin_lock_irqsave(lock, flags) \
^
drivers/net/ethernet/rdc/r6040.c:806:6: note: Assuming field 'tx_free_desc' is not equal to 0
if (!lp->tx_free_desc) {
^~~~~~~~~~~~~~~~~
drivers/net/ethernet/rdc/r6040.c:806:2: note: Taking false branch
if (!lp->tx_free_desc) {
^
drivers/net/ethernet/rdc/r6040.c:825:7: note: Calling 'netdev_xmit_more'
if (!netdev_xmit_more() || netif_queue_stopped(dev))
^~~~~~~~~~~~~~~~~~
include/linux/netdevice.h:4949:9: note: Loop condition is false. Exiting loop
return __this_cpu_read(softnet_data.xmit.more);
^
include/linux/percpu-defs.h:446:2: note: expanded from macro '__this_cpu_read'
raw_cpu_read(pcp); \
^
include/linux/percpu-defs.h:420:28: note: expanded from macro 'raw_cpu_read'
#define raw_cpu_read(pcp) __pcpu_size_call_return(raw_cpu_read_, pcp)
^
include/linux/percpu-defs.h:319:2: note: expanded from macro '__pcpu_size_call_return'
__verify_pcpu_ptr(&(variable)); \
^
include/linux/percpu-defs.h:217:37: note: expanded from macro '__verify_pcpu_ptr'
#define __verify_pcpu_ptr(ptr) \
^
include/linux/netdevice.h:4949:9: note: Control jumps to 'case 1:' at line 4949
return __this_cpu_read(softnet_data.xmit.more);
^
include/linux/percpu-defs.h:446:2: note: expanded from macro '__this_cpu_read'
raw_cpu_read(pcp); \
^
include/linux/percpu-defs.h:420:28: note: expanded from macro 'raw_cpu_read'
#define raw_cpu_read(pcp) __pcpu_size_call_return(raw_cpu_read_, pcp)
^
include/linux/percpu-defs.h:320:2: note: expanded from macro '__pcpu_size_call_return'
switch(sizeof(variable)) { \
^
include/linux/netdevice.h:4949:9: note: Loop condition is false. Exiting loop
return __this_cpu_read(softnet_data.xmit.more);
^
include/linux/percpu-defs.h:446:2: note: expanded from macro '__this_cpu_read'
raw_cpu_read(pcp); \
^
include/linux/percpu-defs.h:420:28: note: expanded from macro 'raw_cpu_read'
#define raw_cpu_read(pcp) __pcpu_size_call_return(raw_cpu_read_, pcp)
^
include/linux/percpu-defs.h:321:23: note: expanded from macro '__pcpu_size_call_return'
case 1: pscr_ret__ = stem##1(variable); break; \
^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/asm-generic/percpu.h:67:3: note: expanded from macro 'raw_cpu_generic_read'
*raw_cpu_ptr(&(pcp)); \
^
include/linux/percpu-defs.h:241:2: note: expanded from macro 'raw_cpu_ptr'
__verify_pcpu_ptr(ptr); \
^
include/linux/percpu-defs.h:217:37: note: expanded from macro '__verify_pcpu_ptr'
#define __verify_pcpu_ptr(ptr) \
^
include/linux/netdevice.h:4949:9: note: Dereference of null pointer
return __this_cpu_read(softnet_data.xmit.more);
^
include/linux/percpu-defs.h:446:2: note: expanded from macro '__this_cpu_read'
raw_cpu_read(pcp); \
^~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:420:28: note: expanded from macro 'raw_cpu_read'
#define raw_cpu_read(pcp) __pcpu_size_call_return(raw_cpu_read_, pcp)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:321:23: note: expanded from macro '__pcpu_size_call_return'
case 1: pscr_ret__ = stem##1(variable); break; \
^~~~~~~~~~~~~~~~~
note: (skipping 4 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/asm-generic/percpu.h:44:31: note: expanded from macro 'arch_raw_cpu_ptr'
#define arch_raw_cpu_ptr(ptr) SHIFT_PERCPU_PTR(ptr, __my_cpu_offset)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:231:2: note: expanded from macro 'SHIFT_PERCPU_PTR'
RELOC_HIDE((typeof(*(__p)) __kernel __force *)(__p), (__offset))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:182:28: note: expanded from macro 'RELOC_HIDE'
(typeof(ptr)) (__ptr + (off)); })
^~~~~
Suppressed 26 warnings (14 in non-user code, 12 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.
29 warnings generated.
>> drivers/net/ethernet/intel/ice/ice_ptp.c:109:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
struct device *dev = ice_pf_to_dev(pf);
^~~
drivers/net/ethernet/intel/ice/ice_ptp.c:109:17: note: Value stored to 'dev' during its initialization is never read
struct device *dev = ice_pf_to_dev(pf);
^~~
include/linux/time64.h:67:50: warning: The left operand of '+' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
set_normalized_timespec64(&ts_delta, lhs.tv_sec + rhs.tv_sec,
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Left side of '&&' is false
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:15: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
drivers/net/ethernet/intel/ice/ice_ptp.h:22:2: note: expanded from macro '__ptp_info_to_ptp'
container_of((i), struct ice_ptp, info)
^
include/linux/kernel.h:716:61: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Taking false branch
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:15: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
drivers/net/ethernet/intel/ice/ice_ptp.h:22:2: note: expanded from macro '__ptp_info_to_ptp'
container_of((i), struct ice_ptp, info)
^
include/linux/kernel.h:716:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:328:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:308:3: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Loop condition is false. Exiting loop
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:15: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
drivers/net/ethernet/intel/ice/ice_ptp.h:22:2: note: expanded from macro '__ptp_info_to_ptp'
container_of((i), struct ice_ptp, info)
^
include/linux/kernel.h:716:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:328:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:306:2: note: expanded from macro '__compiletime_assert'
do { \
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Left side of '&&' is false
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:2: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
include/linux/kernel.h:716:61: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Taking false branch
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:2: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
include/linux/kernel.h:716:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
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:328:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:308:3: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Loop condition is false. Exiting loop
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:2: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
vim +/dev +109 drivers/net/ethernet/intel/ice/ice_ptp.c
67569a7f940130 Jacob Keller 2021-06-09 98
67569a7f940130 Jacob Keller 2021-06-09 99 /**
67569a7f940130 Jacob Keller 2021-06-09 100 * ice_clear_ptp_clock_index - Clear the PTP clock index
67569a7f940130 Jacob Keller 2021-06-09 101 * @pf: the PF pointer
67569a7f940130 Jacob Keller 2021-06-09 102 *
67569a7f940130 Jacob Keller 2021-06-09 103 * Clear the PTP clock index for this device. Must be called when
67569a7f940130 Jacob Keller 2021-06-09 104 * unregistering the PTP clock, in order to ensure other PFs stop reporting
67569a7f940130 Jacob Keller 2021-06-09 105 * a clock object that no longer exists.
67569a7f940130 Jacob Keller 2021-06-09 106 */
67569a7f940130 Jacob Keller 2021-06-09 107 static void ice_clear_ptp_clock_index(struct ice_pf *pf)
67569a7f940130 Jacob Keller 2021-06-09 108 {
67569a7f940130 Jacob Keller 2021-06-09 @109 struct device *dev = ice_pf_to_dev(pf);
67569a7f940130 Jacob Keller 2021-06-09 110 enum ice_aqc_driver_params param_idx;
67569a7f940130 Jacob Keller 2021-06-09 111 struct ice_hw *hw = &pf->hw;
67569a7f940130 Jacob Keller 2021-06-09 112 u8 tmr_idx;
67569a7f940130 Jacob Keller 2021-06-09 113 int err;
67569a7f940130 Jacob Keller 2021-06-09 114
67569a7f940130 Jacob Keller 2021-06-09 115 /* Do not clear the index if we don't own the timer */
67569a7f940130 Jacob Keller 2021-06-09 116 if (!hw->func_caps.ts_func_info.src_tmr_owned)
67569a7f940130 Jacob Keller 2021-06-09 117 return;
67569a7f940130 Jacob Keller 2021-06-09 118
67569a7f940130 Jacob Keller 2021-06-09 119 tmr_idx = hw->func_caps.ts_func_info.tmr_index_assoc;
67569a7f940130 Jacob Keller 2021-06-09 120 if (!tmr_idx)
67569a7f940130 Jacob Keller 2021-06-09 121 param_idx = ICE_AQC_DRIVER_PARAM_CLK_IDX_TMR0;
67569a7f940130 Jacob Keller 2021-06-09 122 else
67569a7f940130 Jacob Keller 2021-06-09 123 param_idx = ICE_AQC_DRIVER_PARAM_CLK_IDX_TMR1;
67569a7f940130 Jacob Keller 2021-06-09 124
67569a7f940130 Jacob Keller 2021-06-09 125 err = ice_aq_set_driver_param(hw, param_idx, 0, NULL);
67569a7f940130 Jacob Keller 2021-06-09 126 if (err) {
67569a7f940130 Jacob Keller 2021-06-09 127 dev_dbg(dev, "Failed to clear PTP clock index parameter, err %d aq_err %s\n",
67569a7f940130 Jacob Keller 2021-06-09 128 err, ice_aq_str(hw->adminq.sq_last_status));
67569a7f940130 Jacob Keller 2021-06-09 129 }
67569a7f940130 Jacob Keller 2021-06-09 130 }
67569a7f940130 Jacob Keller 2021-06-09 131
--
0-DAY CI Kernel Test Service
https://01.org/lkp
^ permalink raw reply [flat|nested] 6+ messages in thread
* drivers/net/ethernet/intel/ice/ice_ptp.c:109:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
@ 2022-05-26 5:18 kernel test robot
0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2022-05-26 5:18 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 16710 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: Jacob Keller <jacob.e.keller@intel.com>
CC: Tony Nguyen <anthony.l.nguyen@intel.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: d7227785e384d4422b3ca189aa5bf19f462337cc
commit: 67569a7f940130fcfe9041e07a614a5263a9944d ice: report the PTP clock index in ethtool .get_ts_info
date: 12 months ago
:::::: branch date: 5 hours ago
:::::: commit date: 12 months ago
config: s390-randconfig-c005-20220524 (https://download.01.org/0day-ci/archive/20220526/202205261324.92r8ipTC-lkp(a)intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 10c9ecce9f6096e18222a331c5e7d085bd813f75)
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 s390 cross compiling tool for clang build
# apt-get install binutils-s390x-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=67569a7f940130fcfe9041e07a614a5263a9944d
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 67569a7f940130fcfe9041e07a614a5263a9944d
# save the config file
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=s390 clang-analyzer
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
arch/s390/include/asm/pci_io.h:76:2: note: Control jumps to 'case 1:' at line 77
switch (len) {
^
arch/s390/include/asm/pci_io.h:79:3: note: Execution continues on line 93
break;
^
arch/s390/include/asm/pci_io.h:93:2: note: Returning value, which participates in a condition later
return zpci_store(dst, val, len);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/s390/include/asm/pci_io.h:174:9: note: Returning from 'zpci_write_single'
rc = zpci_write_single(dst, src, size);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/s390/include/asm/pci_io.h:175:7: note: Assuming 'rc' is 0
if (rc)
^~
arch/s390/include/asm/pci_io.h:175:3: note: Taking false branch
if (rc)
^
arch/s390/include/asm/pci_io.h:167:2: note: Loop condition is true. Entering loop body
while (n > 0) {
^
arch/s390/include/asm/pci_io.h:168:10: note: Calling 'zpci_get_max_write_size'
size = zpci_get_max_write_size((u64 __force) dst,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/s390/include/asm/pci_io.h:129:14: note: 'len' is <= 'max'
int count = len > max ? max : len, size = 1;
^~~
arch/s390/include/asm/pci_io.h:129:14: note: '?' condition is false
arch/s390/include/asm/pci_io.h:131:9: note: Assuming the condition is true
while (!(src & 0x1) && !(dst & 0x1) && ((size << 1) <= count)) {
^~~~~~~~~~~~
arch/s390/include/asm/pci_io.h:131:9: note: Left side of '&&' is true
arch/s390/include/asm/pci_io.h:131:25: note: Assuming the condition is true
while (!(src & 0x1) && !(dst & 0x1) && ((size << 1) <= count)) {
^~~~~~~~~~~~
arch/s390/include/asm/pci_io.h:131:9: note: Left side of '&&' is true
while (!(src & 0x1) && !(dst & 0x1) && ((size << 1) <= count)) {
^
arch/s390/include/asm/pci_io.h:131:2: note: Loop condition is true. Entering loop body
while (!(src & 0x1) && !(dst & 0x1) && ((size << 1) <= count)) {
^
arch/s390/include/asm/pci_io.h:131:9: note: Assuming the condition is true
while (!(src & 0x1) && !(dst & 0x1) && ((size << 1) <= count)) {
^~~~~~~~~~~~
arch/s390/include/asm/pci_io.h:131:9: note: Left side of '&&' is true
arch/s390/include/asm/pci_io.h:131:25: note: Assuming the condition is true
while (!(src & 0x1) && !(dst & 0x1) && ((size << 1) <= count)) {
^~~~~~~~~~~~
arch/s390/include/asm/pci_io.h:131:9: note: Left side of '&&' is true
while (!(src & 0x1) && !(dst & 0x1) && ((size << 1) <= count)) {
^
arch/s390/include/asm/pci_io.h:131:2: note: Loop condition is true. Entering loop body
while (!(src & 0x1) && !(dst & 0x1) && ((size << 1) <= count)) {
^
arch/s390/include/asm/pci_io.h:131:9: note: Assuming the condition is true
while (!(src & 0x1) && !(dst & 0x1) && ((size << 1) <= count)) {
^~~~~~~~~~~~
arch/s390/include/asm/pci_io.h:131:9: note: Left side of '&&' is true
arch/s390/include/asm/pci_io.h:131:25: note: Assuming the condition is true
while (!(src & 0x1) && !(dst & 0x1) && ((size << 1) <= count)) {
^~~~~~~~~~~~
arch/s390/include/asm/pci_io.h:131:9: note: Left side of '&&' is true
while (!(src & 0x1) && !(dst & 0x1) && ((size << 1) <= count)) {
^
arch/s390/include/asm/pci_io.h:131:2: note: Loop condition is true. Entering loop body
while (!(src & 0x1) && !(dst & 0x1) && ((size << 1) <= count)) {
^
arch/s390/include/asm/pci_io.h:131:9: note: Assuming the condition is false
while (!(src & 0x1) && !(dst & 0x1) && ((size << 1) <= count)) {
^~~~~~~~~~~~
arch/s390/include/asm/pci_io.h:131:22: note: Left side of '&&' is false
while (!(src & 0x1) && !(dst & 0x1) && ((size << 1) <= count)) {
^
arch/s390/include/asm/pci_io.h:136:2: note: Returning the value 8 (loaded from 'size'), which participates in a condition later
return size;
^~~~~~~~~~~
arch/s390/include/asm/pci_io.h:168:10: note: Returning from 'zpci_get_max_write_size'
size = zpci_get_max_write_size((u64 __force) dst,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/s390/include/asm/pci_io.h:171:7: note: 'size' is <= 8
if (size > 8) /* main path */
^~~~
arch/s390/include/asm/pci_io.h:171:3: note: Taking false branch
if (size > 8) /* main path */
^
arch/s390/include/asm/pci_io.h:174:9: note: Calling 'zpci_write_single'
rc = zpci_write_single(dst, src, size);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/s390/include/asm/pci_io.h:76:2: note: Control jumps to 'case 8:' at line 86
switch (len) {
^
arch/s390/include/asm/pci_io.h:87:7: note: Assigned value is garbage or undefined
val = (u64) *((u64 *) src);
^ ~~~~~~~~~~~~~~~~~~~~
Suppressed 20 warnings (8 in non-user code, 12 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.
10 warnings generated.
Suppressed 10 warnings (10 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
29 warnings generated.
>> drivers/net/ethernet/intel/ice/ice_ptp.c:109:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
struct device *dev = ice_pf_to_dev(pf);
^~~
drivers/net/ethernet/intel/ice/ice_ptp.c:109:17: note: Value stored to 'dev' during its initialization is never read
struct device *dev = ice_pf_to_dev(pf);
^~~
include/linux/time64.h:67:50: warning: The left operand of '+' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
set_normalized_timespec64(&ts_delta, lhs.tv_sec + rhs.tv_sec,
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Left side of '&&' is false
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:15: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
drivers/net/ethernet/intel/ice/ice_ptp.h:22:2: note: expanded from macro '__ptp_info_to_ptp'
container_of((i), struct ice_ptp, info)
^
include/linux/kernel.h:716:61: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Taking false branch
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:15: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
drivers/net/ethernet/intel/ice/ice_ptp.h:22:2: note: expanded from macro '__ptp_info_to_ptp'
container_of((i), struct ice_ptp, info)
^
include/linux/kernel.h:716:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:328:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:308:3: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Loop condition is false. Exiting loop
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:15: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
drivers/net/ethernet/intel/ice/ice_ptp.h:22:2: note: expanded from macro '__ptp_info_to_ptp'
container_of((i), struct ice_ptp, info)
^
include/linux/kernel.h:716:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:328:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:306:2: note: expanded from macro '__compiletime_assert'
do { \
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Left side of '&&' is false
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:2: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
include/linux/kernel.h:716:61: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Taking false branch
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:2: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
include/linux/kernel.h:716:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
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:328:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:308:3: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^
drivers/net/ethernet/intel/ice/ice_ptp.c:358:22: note: Loop condition is false. Exiting loop
struct ice_pf *pf = ptp_info_to_pf(info);
^
drivers/net/ethernet/intel/ice/ice_ptp.h:24:2: note: expanded from macro 'ptp_info_to_pf'
container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
^
vim +/dev +109 drivers/net/ethernet/intel/ice/ice_ptp.c
67569a7f940130f Jacob Keller 2021-06-09 98
67569a7f940130f Jacob Keller 2021-06-09 99 /**
67569a7f940130f Jacob Keller 2021-06-09 100 * ice_clear_ptp_clock_index - Clear the PTP clock index
67569a7f940130f Jacob Keller 2021-06-09 101 * @pf: the PF pointer
67569a7f940130f Jacob Keller 2021-06-09 102 *
67569a7f940130f Jacob Keller 2021-06-09 103 * Clear the PTP clock index for this device. Must be called when
67569a7f940130f Jacob Keller 2021-06-09 104 * unregistering the PTP clock, in order to ensure other PFs stop reporting
67569a7f940130f Jacob Keller 2021-06-09 105 * a clock object that no longer exists.
67569a7f940130f Jacob Keller 2021-06-09 106 */
67569a7f940130f Jacob Keller 2021-06-09 107 static void ice_clear_ptp_clock_index(struct ice_pf *pf)
67569a7f940130f Jacob Keller 2021-06-09 108 {
67569a7f940130f Jacob Keller 2021-06-09 @109 struct device *dev = ice_pf_to_dev(pf);
67569a7f940130f Jacob Keller 2021-06-09 110 enum ice_aqc_driver_params param_idx;
67569a7f940130f Jacob Keller 2021-06-09 111 struct ice_hw *hw = &pf->hw;
67569a7f940130f Jacob Keller 2021-06-09 112 u8 tmr_idx;
67569a7f940130f Jacob Keller 2021-06-09 113 int err;
67569a7f940130f Jacob Keller 2021-06-09 114
67569a7f940130f Jacob Keller 2021-06-09 115 /* Do not clear the index if we don't own the timer */
67569a7f940130f Jacob Keller 2021-06-09 116 if (!hw->func_caps.ts_func_info.src_tmr_owned)
67569a7f940130f Jacob Keller 2021-06-09 117 return;
67569a7f940130f Jacob Keller 2021-06-09 118
67569a7f940130f Jacob Keller 2021-06-09 119 tmr_idx = hw->func_caps.ts_func_info.tmr_index_assoc;
67569a7f940130f Jacob Keller 2021-06-09 120 if (!tmr_idx)
67569a7f940130f Jacob Keller 2021-06-09 121 param_idx = ICE_AQC_DRIVER_PARAM_CLK_IDX_TMR0;
67569a7f940130f Jacob Keller 2021-06-09 122 else
67569a7f940130f Jacob Keller 2021-06-09 123 param_idx = ICE_AQC_DRIVER_PARAM_CLK_IDX_TMR1;
67569a7f940130f Jacob Keller 2021-06-09 124
67569a7f940130f Jacob Keller 2021-06-09 125 err = ice_aq_set_driver_param(hw, param_idx, 0, NULL);
67569a7f940130f Jacob Keller 2021-06-09 126 if (err) {
67569a7f940130f Jacob Keller 2021-06-09 127 dev_dbg(dev, "Failed to clear PTP clock index parameter, err %d aq_err %s\n",
67569a7f940130f Jacob Keller 2021-06-09 128 err, ice_aq_str(hw->adminq.sq_last_status));
67569a7f940130f Jacob Keller 2021-06-09 129 }
67569a7f940130f Jacob Keller 2021-06-09 130 }
67569a7f940130f Jacob Keller 2021-06-09 131
--
0-DAY CI Kernel Test Service
https://01.org/lkp
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-06-06 19:13 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-02 16:16 drivers/net/ethernet/intel/ice/ice_ptp.c:109:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores] kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2022-06-06 19:13 kernel test robot
2022-06-05 14:42 kernel test robot
2022-06-02 7:33 kernel test robot
2022-05-29 6:27 kernel test robot
2022-05-26 5:18 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.