From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34053C4338F for ; Mon, 23 Aug 2021 06:52:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 974EA61250 for ; Mon, 23 Aug 2021 06:52:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 974EA61250 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 0888C6B006C; Mon, 23 Aug 2021 02:52:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 00FBA6B0072; Mon, 23 Aug 2021 02:52:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DCB1C6B0073; Mon, 23 Aug 2021 02:52:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0080.hostedemail.com [216.40.44.80]) by kanga.kvack.org (Postfix) with ESMTP id B7A536B006C for ; Mon, 23 Aug 2021 02:52:17 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 4B41F8249980 for ; Mon, 23 Aug 2021 06:52:17 +0000 (UTC) X-FDA: 78505426314.19.DD7ABAC Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by imf04.hostedemail.com (Postfix) with ESMTP id E4BD650000BA for ; Mon, 23 Aug 2021 06:52:16 +0000 (UTC) Received: by mail-pf1-f176.google.com with SMTP id 7so14495148pfl.10 for ; Sun, 22 Aug 2021 23:52:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=6JdgNxB1H2AvpsK5SsSf2ubeu2L5in1kZLAzf3Uti0E=; b=c/9I5HPeORv5xb2MvXAHZZI3tCGtFmLwt48ec6DHfYxqJuP4OFtVvWV7vjJElhk2+q sBvZgKCncQMC9mlgb5ZiZjWiQRt2OjznB1i0dWBd6K8AHz4fXZ4QyypZA2OCyOYNwB9K 1lcg5qXhomi2K06EYcsJveJotSeLnLlfnCw6t8Uka74ywxCIUG8kEKalreDUhy/F+Xvl L1B6dYCe0NcgQxMsGIsvP8vkJGJr+OkmdfIIWx7RS3yrT117UBYC2ztXwy5T0z7dPbik U+46hxqXEmuG9p10sL5KOQXMcxvYFY2MzBjUIFzAv9RVBwGU79RIjeluRMbpWz3/DBe8 C4nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=6JdgNxB1H2AvpsK5SsSf2ubeu2L5in1kZLAzf3Uti0E=; b=CgSKQgE1Y6CB3RjZNoBwHJrymL1DGpFZ3hSiLi9gVtZIbB7UJ363ELP/VfpPW9jr8t QaMKdbJQzwzuMZYznxNpusDq3X+hSzB8QSZOGe3JRrrVDJfePjmlUEB7aTNpwFVaPvZW CUt9hjChPD8zD/wj/dwO3ZTHu4ERoOrj8/gOrpPebD4+snzQsyGf/CQYa52XevmipSbO /9oULzKy1FeEubXjASorXpnk90Z+Ms1j4+oQoAb88Nz8xu6ofkW7Y6Lly4W+LL8cgPdl H0Yys0ORglpnJvw01vpxwa8NIx5DZc3fRmYnpeMhN6ZkiZo4wJypy6vNLunhDagcToLH drSQ== X-Gm-Message-State: AOAM533A4woe1Da/e8RWLjuQoHOJYn6STW7EEngvVVHTzRm5a5jCfpB/ fd/8sBZPwUS2Q50BphInsPXFDQ== X-Google-Smtp-Source: ABdhPJy+3ynIY0Pc41EMxCYwND1epOlp8uvUy9l8rHaMblSW4I3Bma+KD5JwlrozTw/5LFY2cfCmwg== X-Received: by 2002:a65:51c7:: with SMTP id i7mr30401653pgq.300.1629701535602; Sun, 22 Aug 2021 23:52:15 -0700 (PDT) Received: from localhost ([122.172.201.85]) by smtp.gmail.com with ESMTPSA id g10sm14491018pfh.120.2021.08.22.23.52.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Aug 2021 23:52:14 -0700 (PDT) Date: Mon, 23 Aug 2021 12:22:11 +0530 From: Viresh Kumar To: kernel test robot Cc: Thara Gopinath , clang-built-linux@googlegroups.com, kbuild-all@lists.01.org, Linux Memory Management List Subject: Re: [linux-next:master 8440/9522] drivers/cpufreq/qcom-cpufreq-hw.c:294:3: warning: Value stored to 'opp' is never read [clang-analyzer-deadcode.DeadStores] Message-ID: <20210823065211.mzagmzexavwxu4vy@vireshk-i7> References: <202108221933.WIgFqDfv-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202108221933.WIgFqDfv-lkp@intel.com> User-Agent: NeoMutt/20180716-391-311a52 Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=linaro.org header.s=google header.b="c/9I5HPe"; spf=pass (imf04.hostedemail.com: domain of viresh.kumar@linaro.org designates 209.85.210.176 as permitted sender) smtp.mailfrom=viresh.kumar@linaro.org; dmarc=pass (policy=none) header.from=linaro.org X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: E4BD650000BA X-Stat-Signature: 3eyr8eccytwfzmgp5bugadna95rjfq6q X-HE-Tag: 1629701536-168008 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 22-08-21, 19:41, kernel test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master > head: 86ed57fd8c93fdfaabb4f58e78455180fa7d8a84 > commit: 86afc1df661a99dcd6b8d264cae171f1ead2b7b8 [8440/9522] cpufreq: qcom-cpufreq-hw: Add dcvs interrupt support > config: arm-randconfig-c002-20210822 (attached as .config) > compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project a83d99c55ebb14532c414066a5aa3bdb65389965) > reproduce (this is a W=1 build): > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # install arm cross compiling tool for clang build > # apt-get install binutils-arm-linux-gnueabi > # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=86afc1df661a99dcd6b8d264cae171f1ead2b7b8 > git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git > git fetch --no-tags linux-next master > git checkout 86afc1df661a99dcd6b8d264cae171f1ead2b7b8 > # save the attached .config to linux build tree > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm clang-analyzer > > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot This doesn't look right, it says issues are with cpufreq-hw driver but points at hid-core ? > clang-analyzer warnings: (new ones prefixed by >>) > ^ ~ > drivers/hid/hid-core.c:1412:22: warning: The result of the left shift is undefined due to shifting by '32', which is greater or equal to the width of type 'unsigned int' [clang-analyzer-core.UndefinedBinaryOperatorResult] > u8 bit_mask = ((1U << n) - 1); > ^ > drivers/hid/hid-core.c:1717:6: note: Assuming 'buf' is non-null > if (!buf) > ^~~~ > drivers/hid/hid-core.c:1717:2: note: Taking false branch > if (!buf) > ^ > drivers/hid/hid-core.c:1722:6: note: Assuming 'reqtype' is equal to HID_REQ_SET_REPORT > if (reqtype == HID_REQ_SET_REPORT) > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/hid/hid-core.c:1722:2: note: Taking true branch > if (reqtype == HID_REQ_SET_REPORT) > ^ > drivers/hid/hid-core.c:1723:3: note: Calling 'hid_output_report' > hid_output_report(report, buf); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/hid/hid-core.c:1630:14: note: Field 'id' is <= 0 > if (report->id > 0) > ^ > drivers/hid/hid-core.c:1630:2: note: Taking false branch > if (report->id > 0) > ^ > drivers/hid/hid-core.c:1634:14: note: Assuming 'n' is < field 'maxfield' > for (n = 0; n < report->maxfield; n++) > ^~~~~~~~~~~~~~~~~~~~ > drivers/hid/hid-core.c:1634:2: note: Loop condition is true. Entering loop body > for (n = 0; n < report->maxfield; n++) > ^ > drivers/hid/hid-core.c:1635:3: note: Calling 'hid_output_field' > hid_output_field(report->device, report->field[n], data); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/hid/hid-core.c:1597:2: note: 'size' initialized here > unsigned size = field->report_size; > ^~~~~~~~~~~~~ > drivers/hid/hid-core.c:1600:14: note: Assuming 'n' is < 'count' > for (n = 0; n < count; n++) { > ^~~~~~~~~ > drivers/hid/hid-core.c:1600:2: note: Loop condition is true. Entering loop body > for (n = 0; n < count; n++) { > ^ > drivers/hid/hid-core.c:1601:7: note: Assuming field 'logical_minimum' is >= 0 > if (field->logical_minimum < 0) /* signed values */ > ^~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/hid/hid-core.c:1601:3: note: Taking false branch > if (field->logical_minimum < 0) /* signed values */ > ^ > drivers/hid/hid-core.c:1605:44: note: Passing value via 4th parameter 'n' > implement(hid, data, offset + n * size, size, > ^~~~ > drivers/hid/hid-core.c:1605:4: note: Calling 'implement' > implement(hid, data, offset + n * size, size, > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/hid/hid-core.c:1421:15: note: Assuming 'n' is <= 32 > if (unlikely(n > 32)) { > ^ > include/linux/compiler.h:78:42: note: expanded from macro 'unlikely' > # define unlikely(x) __builtin_expect(!!(x), 0) > ^ > drivers/hid/hid-core.c:1421:2: note: Taking false branch > if (unlikely(n > 32)) { > ^ > drivers/hid/hid-core.c:1425:13: note: Assuming 'n' is >= 32 > } else if (n < 32) { > ^~~~~~ > drivers/hid/hid-core.c:1425:9: note: Taking false branch > } else if (n < 32) { > ^ > drivers/hid/hid-core.c:1437:30: note: Passing the value 32 via 3rd parameter 'n' > __implement(report, offset, n, value); > ^ > drivers/hid/hid-core.c:1437:2: note: Calling '__implement' > __implement(report, offset, n, value); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/hid/hid-core.c:1400:9: note: Assuming the condition is false > while (n - bits_to_set >= 0) { > ^~~~~~~~~~~~~~~~~~~~ > drivers/hid/hid-core.c:1400:2: note: Loop condition is false. Execution continues on line 1411 > while (n - bits_to_set >= 0) { > ^ > drivers/hid/hid-core.c:1411:6: note: 'n' is 32 > if (n) { > ^ > drivers/hid/hid-core.c:1411:2: note: Taking true branch > if (n) { > ^ > drivers/hid/hid-core.c:1412:22: note: The result of the left shift is undefined due to shifting by '32', which is greater or equal to the width of type 'unsigned int' > u8 bit_mask = ((1U << n) - 1); > ^ ~ > drivers/hid/hid-core.c:1984:3: warning: Value stored to 'len' is never read [clang-analyzer-deadcode.DeadStores] > len += sprintf(buf + len, "%shidraw%d", len ? "," : "", > ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/hid/hid-core.c:1984:3: note: Value stored to 'len' is never read > len += sprintf(buf + len, "%shidraw%d", len ? "," : "", > ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > 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. > 3 warnings generated. > >> drivers/cpufreq/qcom-cpufreq-hw.c:294:3: warning: Value stored to 'opp' is never read [clang-analyzer-deadcode.DeadStores] > opp = dev_pm_opp_find_freq_ceil(dev, &freq_hz); > ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/cpufreq/qcom-cpufreq-hw.c:294:3: note: Value stored to 'opp' is never read > opp = dev_pm_opp_find_freq_ceil(dev, &freq_hz); > ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Suppressed 2 warnings (2 in non-user code). > Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. > 2 warnings generated. > Suppressed 2 warnings (2 in non-user code). > Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. > 2 warnings generated. > Suppressed 2 warnings (2 in non-user code). > Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. > 2 warnings generated. > Suppressed 2 warnings (2 in non-user code). > Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. > 7 warnings generated. > Suppressed 7 warnings (7 in non-user code). > Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. > 3 warnings generated. > Suppressed 3 warnings (3 in non-user code). > Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. > 2 warnings generated. > Suppressed 2 warnings (2 in non-user code). > Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. > 2 warnings generated. > Suppressed 2 warnings (2 in non-user code). > Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. > 3 warnings generated. > Suppressed 3 warnings (3 in non-user code). > Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. > 3 warnings generated. > Suppressed 3 warnings (3 in non-user code). > Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. > 3 warnings generated. > Suppressed 3 warnings (3 in non-user code). > Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. > 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. > 7 warnings generated. > drivers/dma/xgene-dma.c:445:36: warning: The result of the left shift is undefined due to shifting by '32', which is greater or equal to the width of type 'int' [clang-analyzer-core.UndefinedBinaryOperatorResult] > desc1->m2 |= cpu_to_le64((scf[i] << ((i + 1) * 8))); > ^ > include/linux/byteorder/generic.h:86:21: note: expanded from macro 'cpu_to_le64' > #define cpu_to_le64 __cpu_to_le64 > ^ > drivers/dma/xgene-dma.c:895:15: note: Assuming 'dchan' is non-null > if (unlikely(!dchan || !len)) > ^ > include/linux/compiler.h:78:42: note: expanded from macro 'unlikely' > # define unlikely(x) __builtin_expect(!!(x), 0) > ^ > drivers/dma/xgene-dma.c:895:15: note: Left side of '||' is false > if (unlikely(!dchan || !len)) > ^ > drivers/dma/xgene-dma.c:895:25: note: Assuming 'len' is not equal to 0 > if (unlikely(!dchan || !len)) > ^ > include/linux/compiler.h:78:42: note: expanded from macro 'unlikely' > # define unlikely(x) __builtin_expect(!!(x), 0) > ^ > drivers/dma/xgene-dma.c:895:2: note: Taking false branch > if (unlikely(!dchan || !len)) > ^ > drivers/dma/xgene-dma.c:898:9: note: Left side of '&&' is false > chan = to_dma_chan(dchan); > ^ > drivers/dma/xgene-dma.c:191:2: note: expanded from macro 'to_dma_chan' > container_of(dchan, struct xgene_dma_chan, dma_chan) > ^ > include/linux/kernel.h:495:61: note: expanded from macro 'container_of' > BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \ > ^ > drivers/dma/xgene-dma.c:898:9: note: Taking false branch > chan = to_dma_chan(dchan); > ^ > drivers/dma/xgene-dma.c:191:2: note: expanded from macro 'to_dma_chan' > container_of(dchan, struct xgene_dma_chan, dma_chan) > ^ > include/linux/kernel.h:495: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)) \ > > vim +/opp +294 drivers/cpufreq/qcom-cpufreq-hw.c > > 275 > 276 static void qcom_lmh_dcvs_notify(struct qcom_cpufreq_data *data) > 277 { > 278 unsigned long max_capacity, capacity, freq_hz, throttled_freq; > 279 struct cpufreq_policy *policy = data->policy; > 280 int cpu = cpumask_first(policy->cpus); > 281 struct device *dev = get_cpu_device(cpu); > 282 struct dev_pm_opp *opp; > 283 unsigned int freq; > 284 > 285 /* > 286 * Get the h/w throttled frequency, normalize it using the > 287 * registered opp table and use it to calculate thermal pressure. > 288 */ > 289 freq = qcom_lmh_get_throttle_freq(data); > 290 freq_hz = freq * HZ_PER_KHZ; > 291 > 292 opp = dev_pm_opp_find_freq_floor(dev, &freq_hz); > 293 if (IS_ERR(opp) && PTR_ERR(opp) == -ERANGE) > > 294 opp = dev_pm_opp_find_freq_ceil(dev, &freq_hz); > 295 > 296 throttled_freq = freq_hz / HZ_PER_KHZ; > 297 > 298 /* Update thermal pressure */ > 299 > 300 max_capacity = arch_scale_cpu_capacity(cpu); > 301 capacity = mult_frac(max_capacity, throttled_freq, policy->cpuinfo.max_freq); > 302 > 303 /* Don't pass boost capacity to scheduler */ > 304 if (capacity > max_capacity) > 305 capacity = max_capacity; > 306 > 307 arch_set_thermal_pressure(policy->cpus, max_capacity - capacity); > 308 > 309 /* > 310 * In the unlikely case policy is unregistered do not enable > 311 * polling or h/w interrupt > 312 */ > 313 mutex_lock(&data->throttle_lock); > 314 if (data->cancel_throttle) > 315 goto out; > 316 > 317 /* > 318 * If h/w throttled frequency is higher than what cpufreq has requested > 319 * for, then stop polling and switch back to interrupt mechanism. > 320 */ > 321 if (throttled_freq >= qcom_cpufreq_hw_get(cpu)) > 322 enable_irq(data->throttle_irq); > 323 else > 324 mod_delayed_work(system_highpri_wq, &data->throttle_work, > 325 msecs_to_jiffies(10)); > 326 > 327 out: > 328 mutex_unlock(&data->throttle_lock); > 329 } > 330 > > --- > 0-DAY CI Kernel Test Service, Intel Corporation > https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org -- viresh