All of lore.kernel.org
 help / color / mirror / Atom feed
* kernel/sched/cpufreq_schedutil.c:495:16: warning: Value stored to 'prev_util' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
@ 2021-11-21 21:11 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-11-21 21:11 UTC (permalink / raw)
  To: kbuild

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

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: "Rafael J. Wysocki" <rjw@rjwysocki.net>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   923dcc5eb0c111eccd51cc7ce1658537e3c38b25
commit: ee2cc4276ba4909438f5894a218877660e1536d9 cpufreq: Add special-purpose fast-switching callback for drivers
date:   11 months ago
:::::: branch date: 24 hours ago
:::::: commit date: 11 months ago
config: i386-randconfig-c001-20211118 (attached as .config)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ee2cc4276ba4909438f5894a218877660e1536d9
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout ee2cc4276ba4909438f5894a218877660e1536d9
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386 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 >>)
   note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/minmax.h:110:48: note: expanded from macro 'min_t'
   #define min_t(type, x, y)       __careful_cmp((type)(x), (type)(y), <)
                                   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
   include/linux/minmax.h:44:14: note: expanded from macro '__careful_cmp'
                   __cmp_once(x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y), op))
                   ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:37:25: note: expanded from macro '__cmp_once'
                   typeof(x) unique_x = (x);               \
                                         ^
   drivers/hwmon/pmbus/pmbus_core.c:777:13: note: '?' condition is false
           mantissa = clamp_val(DIV_ROUND_CLOSEST_ULL(val, 1000), 0, 0x3ff);
                      ^
   include/linux/minmax.h:143:32: note: expanded from macro 'clamp_val'
   #define clamp_val(val, lo, hi) clamp_t(typeof(val), val, lo, hi)
                                  ^
   include/linux/minmax.h:130: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:118:27: note: expanded from macro 'max_t'
   #define max_t(type, x, y)       __careful_cmp((type)(x), (type)(y), >)
                                   ^
   include/linux/minmax.h:44:3: note: expanded from macro '__careful_cmp'
                   __cmp_once(x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y), op))
                   ^
   include/linux/minmax.h:39:3: note: expanded from macro '__cmp_once'
                   __cmp(unique_x, unique_y, op); })
                   ^
   include/linux/minmax.h:34:26: note: expanded from macro '__cmp'
   #define __cmp(x, y, op) ((x) op (y) ? (x) : (y))
                            ^
   drivers/hwmon/pmbus/pmbus_core.c:777:13: note: '__UNIQUE_ID___x275' is < '__UNIQUE_ID___y276'
           mantissa = clamp_val(DIV_ROUND_CLOSEST_ULL(val, 1000), 0, 0x3ff);
                      ^
   include/linux/minmax.h:143:32: note: expanded from macro 'clamp_val'
   #define clamp_val(val, lo, hi) clamp_t(typeof(val), val, lo, hi)
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:130: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:110:27: note: expanded from macro 'min_t'
   #define min_t(type, x, y)       __careful_cmp((type)(x), (type)(y), <)
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:44:3: note: expanded from macro '__careful_cmp'
                   __cmp_once(x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y), op))
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:39:3: note: expanded from macro '__cmp_once'
                   __cmp(unique_x, unique_y, op); })
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:34:26: note: expanded from macro '__cmp'
   #define __cmp(x, y, op) ((x) op (y) ? (x) : (y))
                            ^~~
   drivers/hwmon/pmbus/pmbus_core.c:777:13: note: '?' condition is true
           mantissa = clamp_val(DIV_ROUND_CLOSEST_ULL(val, 1000), 0, 0x3ff);
                      ^
   include/linux/minmax.h:143:32: note: expanded from macro 'clamp_val'
   #define clamp_val(val, lo, hi) clamp_t(typeof(val), val, lo, hi)
                                  ^
   include/linux/minmax.h:130: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:110:27: note: expanded from macro 'min_t'
   #define min_t(type, x, y)       __careful_cmp((type)(x), (type)(y), <)
                                   ^
   include/linux/minmax.h:44:3: note: expanded from macro '__careful_cmp'
                   __cmp_once(x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y), op))
                   ^
   include/linux/minmax.h:39:3: note: expanded from macro '__cmp_once'
                   __cmp(unique_x, unique_y, op); })
                   ^
   include/linux/minmax.h:34:26: note: expanded from macro '__cmp'
   #define __cmp(x, y, op) ((x) op (y) ? (x) : (y))
                            ^
   drivers/hwmon/pmbus/pmbus_core.c:780:6: note: 'negative' is false
           if (negative)
               ^~~~~~~~
   drivers/hwmon/pmbus/pmbus_core.c:780:2: note: Taking false branch
           if (negative)
           ^
   drivers/hwmon/pmbus/pmbus_core.c:784:41: note: The result of the left shift is undefined because the left operand is negative
           return (mantissa & 0x7ff) | ((exponent << 11) & 0xf800);
                                         ~~~~~~~~ ^
   Suppressed 7 warnings (7 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   11 warnings generated.
   Suppressed 11 warnings (11 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   11 warnings generated.
   Suppressed 11 warnings (11 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   11 warnings generated.
   Suppressed 11 warnings (11 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   11 warnings generated.
   Suppressed 11 warnings (11 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   11 warnings generated.
   Suppressed 11 warnings (11 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   12 warnings generated.
>> kernel/sched/cpufreq_schedutil.c:495:16: warning: Value stored to 'prev_util' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           unsigned long prev_util = sg_cpu->util;
                         ^~~~~~~~~   ~~~~~~~~~~~~
   kernel/sched/cpufreq_schedutil.c:495:16: note: Value stored to 'prev_util' during its initialization is never read
           unsigned long prev_util = sg_cpu->util;
                         ^~~~~~~~~   ~~~~~~~~~~~~
   Suppressed 11 warnings (11 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   11 warnings generated.
   Suppressed 11 warnings (11 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   14 warnings generated.
   kernel/locking/lockdep.c:1823:30: warning: Access to field 'class' results in a dereference of a null pointer (loaded from variable 'prt') [clang-analyzer-core.NullDereference]
           struct lock_class *parent = prt->class;
                                       ^
   kernel/locking/lockdep.c:2840:6: note: Assuming field 'key' is non-null
           if (!hlock_class(prev)->key || !hlock_class(next)->key) {
               ^~~~~~~~~~~~~~~~~~~~~~~
   kernel/locking/lockdep.c:2840:6: note: Left side of '||' is false
   kernel/locking/lockdep.c:2840:33: note: Assuming field 'key' is non-null
           if (!hlock_class(prev)->key || !hlock_class(next)->key) {
                                          ^~~~~~~~~~~~~~~~~~~~~~~
   kernel/locking/lockdep.c:2840:2: note: Taking false branch
           if (!hlock_class(prev)->key || !hlock_class(next)->key) {
           ^
   kernel/locking/lockdep.c:2868:8: note: Calling 'check_noncircular'
           ret = check_noncircular(next, prev, trace);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/locking/lockdep.c:2101:2: note: Calling 'bfs_init_root'
           bfs_init_root(&src_entry, src);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/locking/lockdep.c:1617:2: note: Calling '__bfs_init_root'
           __bfs_init_root(lock, hlock_class(hlock));
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/locking/lockdep.c:1604:1: note: Returning without writing to 'lock->trace', which participates in a condition later
   }
   ^
   kernel/locking/lockdep.c:1617:2: note: Returning from '__bfs_init_root'
           __bfs_init_root(lock, hlock_class(hlock));
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/locking/lockdep.c:1618:19: note: Assuming field 'read' is equal to 2
           lock->only_xr = (hlock->read == 2);
                            ^~~~~~~~~~~~~~~~
   kernel/locking/lockdep.c:1619:1: note: Returning without writing to 'lock->trace', which participates in a condition later
   }
   ^
   kernel/locking/lockdep.c:2101:2: note: Returning from 'bfs_init_root'
           bfs_init_root(&src_entry, src);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/locking/lockdep.c:2103:2: note: Loop condition is false.  Exiting loop
           debug_atomic_inc(nr_cyclic_checks);
           ^
   kernel/locking/lockdep_internals.h:255:33: note: expanded from macro 'debug_atomic_inc'
   # define debug_atomic_inc(ptr)          do { } while (0)
                                           ^
   kernel/locking/lockdep.c:2105:8: note: Calling 'check_path'
           ret = check_path(target, &src_entry, hlock_conflict, &target_entry);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/locking/lockdep.c:2078:8: note: Calling '__bfs_forwards'
           ret = __bfs_forwards(src_entry, target, match, target_entry);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/locking/lockdep.c:1779:2: note: Returning without writing to '(*target_entry)->parent'
           return __bfs(src_entry, data, match, target_entry,
           ^
   kernel/locking/lockdep.c:2078:8: note: Returning from '__bfs_forwards'
           ret = __bfs_forwards(src_entry, target, match, target_entry);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/locking/lockdep.c:2080:2: note: Taking false branch
           if (unlikely(bfs_error(ret)))
           ^
   kernel/locking/lockdep.c:2083:2: note: Returning without writing to '(*target_entry)->parent'
           return ret;
           ^
   kernel/locking/lockdep.c:2105:8: note: Returning from 'check_path'
           ret = check_path(target, &src_entry, hlock_conflict, &target_entry);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/locking/lockdep.c:2107:15: note: Assuming 'ret' is equal to BFS_RMATCH
           if (unlikely(ret == BFS_RMATCH)) {
                        ^
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   kernel/locking/lockdep.c:2107:2: note: Taking true branch
           if (unlikely(ret == BFS_RMATCH)) {
           ^
   kernel/locking/lockdep.c:2108:7: note: Assuming the condition is false

vim +/prev_util +495 kernel/sched/cpufreq_schedutil.c

9bdcb44e391da5 Rafael J. Wysocki 2016-04-02  490  
ee2cc4276ba490 Rafael J. Wysocki 2020-12-14  491  static void sugov_update_single_perf(struct update_util_data *hook, u64 time,
ee2cc4276ba490 Rafael J. Wysocki 2020-12-14  492  				     unsigned int flags)
ee2cc4276ba490 Rafael J. Wysocki 2020-12-14  493  {
ee2cc4276ba490 Rafael J. Wysocki 2020-12-14  494  	struct sugov_cpu *sg_cpu = container_of(hook, struct sugov_cpu, update_util);
ee2cc4276ba490 Rafael J. Wysocki 2020-12-14 @495  	unsigned long prev_util = sg_cpu->util;
ee2cc4276ba490 Rafael J. Wysocki 2020-12-14  496  
ee2cc4276ba490 Rafael J. Wysocki 2020-12-14  497  	/*
ee2cc4276ba490 Rafael J. Wysocki 2020-12-14  498  	 * Fall back to the "frequency" path if frequency invariance is not
ee2cc4276ba490 Rafael J. Wysocki 2020-12-14  499  	 * supported, because the direct mapping between the utilization and
ee2cc4276ba490 Rafael J. Wysocki 2020-12-14  500  	 * the performance levels depends on the frequency invariance.
ee2cc4276ba490 Rafael J. Wysocki 2020-12-14  501  	 */
ee2cc4276ba490 Rafael J. Wysocki 2020-12-14  502  	if (!arch_scale_freq_invariant()) {
ee2cc4276ba490 Rafael J. Wysocki 2020-12-14  503  		sugov_update_single_freq(hook, time, flags);
ee2cc4276ba490 Rafael J. Wysocki 2020-12-14  504  		return;
ee2cc4276ba490 Rafael J. Wysocki 2020-12-14  505  	}
ee2cc4276ba490 Rafael J. Wysocki 2020-12-14  506  
ee2cc4276ba490 Rafael J. Wysocki 2020-12-14  507  	if (!sugov_update_single_common(sg_cpu, time, flags))
ee2cc4276ba490 Rafael J. Wysocki 2020-12-14  508  		return;
ee2cc4276ba490 Rafael J. Wysocki 2020-12-14  509  
ee2cc4276ba490 Rafael J. Wysocki 2020-12-14  510  	/*
ee2cc4276ba490 Rafael J. Wysocki 2020-12-14  511  	 * Do not reduce the target performance level if the CPU has not been
ee2cc4276ba490 Rafael J. Wysocki 2020-12-14  512  	 * idle recently, as the reduction is likely to be premature then.
ee2cc4276ba490 Rafael J. Wysocki 2020-12-14  513  	 */
ee2cc4276ba490 Rafael J. Wysocki 2020-12-14  514  	if (sugov_cpu_is_busy(sg_cpu) && sg_cpu->util < prev_util)
ee2cc4276ba490 Rafael J. Wysocki 2020-12-14  515  		sg_cpu->util = prev_util;
ee2cc4276ba490 Rafael J. Wysocki 2020-12-14  516  
ee2cc4276ba490 Rafael J. Wysocki 2020-12-14  517  	cpufreq_driver_adjust_perf(sg_cpu->cpu, map_util_perf(sg_cpu->bw_dl),
ee2cc4276ba490 Rafael J. Wysocki 2020-12-14  518  				   map_util_perf(sg_cpu->util), sg_cpu->max);
ee2cc4276ba490 Rafael J. Wysocki 2020-12-14  519  
ee2cc4276ba490 Rafael J. Wysocki 2020-12-14  520  	sg_cpu->sg_policy->last_freq_update_time = time;
ee2cc4276ba490 Rafael J. Wysocki 2020-12-14  521  }
ee2cc4276ba490 Rafael J. Wysocki 2020-12-14  522  

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

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

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

only message in thread, other threads:[~2021-11-21 21:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-21 21:11 kernel/sched/cpufreq_schedutil.c:495:16: warning: Value stored to 'prev_util' 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.