From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: drivers/pinctrl/pinctrl-starfive.c:640:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
Date: Thu, 27 Jan 2022 05:56:14 +0800 [thread overview]
Message-ID: <202201270546.QG2iciS2-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 18624 bytes --]
CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Emil Renner Berthing <kernel@esmil.dk>
CC: Andy Shevchenko <andy.shevchenko@gmail.com>
CC: Linus Walleij <linus.walleij@linaro.org>
CC: Huan Feng <huan.feng@starfivetech.com>
CC: Drew Fustini <drew@beagleboard.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 0280e3c58f92b2fe0e8fbbdf8d386449168de4a8
commit: ec648f6b7686b716424e8e73eebb4c11ae199187 pinctrl: starfive: Add pinctrl driver for StarFive SoCs
date: 6 weeks ago
:::::: branch date: 28 hours ago
:::::: commit date: 6 weeks ago
config: riscv-randconfig-c006-20220126 (https://download.01.org/0day-ci/archive/20220127/202201270546.QG2iciS2-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 2a1b7aa016c0f4b5598806205bdfbab1ea2d92c4)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ec648f6b7686b716424e8e73eebb4c11ae199187
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout ec648f6b7686b716424e8e73eebb4c11ae199187
# save the config file to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
^
include/linux/percpu-defs.h:421:34: note: expanded from macro 'raw_cpu_write'
#define raw_cpu_write(pcp, val) __pcpu_size_call(raw_cpu_write_, pcp, val)
^
include/linux/percpu-defs.h:379:42: note: expanded from macro '__pcpu_size_call'
case 4: stem##4(variable, __VA_ARGS__);break; \
^
kernel/softirq.c:540:2: note: Loop condition is false. Exiting loop
set_softirq_pending(0);
^
include/linux/interrupt.h:494:33: note: expanded from macro 'set_softirq_pending'
#define set_softirq_pending(x) (__this_cpu_write(local_softirq_pending_ref, (x)))
^
include/linux/percpu-defs.h:452:2: note: expanded from macro '__this_cpu_write'
raw_cpu_write(pcp, val); \
^
include/linux/percpu-defs.h:421:34: note: expanded from macro 'raw_cpu_write'
#define raw_cpu_write(pcp, val) __pcpu_size_call(raw_cpu_write_, pcp, val)
^
include/linux/percpu-defs.h:373:50: note: expanded from macro '__pcpu_size_call'
#define __pcpu_size_call(stem, variable, ...) \
^
kernel/softirq.c:542:2: note: Loop condition is false. Exiting loop
local_irq_enable();
^
include/linux/irqflags.h:235:28: note: expanded from macro 'local_irq_enable'
#define local_irq_enable() do { raw_local_irq_enable(); } while (0)
^
kernel/softirq.c:546:2: note: Loop condition is true. Entering loop body
while ((softirq_bit = ffs(pending))) {
^
kernel/softirq.c:552:3: note: The value 16 is assigned to 'vec_nr'
vec_nr = h - softirq_vec;
^~~~~~~~~~~~~~~~~~~~~~~~
kernel/softirq.c:560:16: note: Assuming the condition is true
if (unlikely(prev_count != preempt_count())) {
^
include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^
kernel/softirq.c:560:3: note: Taking true branch
if (unlikely(prev_count != preempt_count())) {
^
kernel/softirq.c:561:4: note: Loop condition is false. Exiting loop
pr_err("huh, entered softirq %u %s %p with preempt_count %08x, exited with %08x?\n",
^
include/linux/printk.h:489:2: note: expanded from macro 'pr_err'
printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
^
include/linux/printk.h:446:26: note: expanded from macro 'printk'
#define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
^
include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
__printk_index_emit(_fmt, NULL, NULL); \
^
include/linux/printk.h:392:34: note: expanded from macro '__printk_index_emit'
#define __printk_index_emit(...) do {} while (0)
^
kernel/softirq.c:561:4: note: 3rd function call argument is an uninitialized value
pr_err("huh, entered softirq %u %s %p with preempt_count %08x, exited with %08x?\n",
^
include/linux/printk.h:489:2: note: expanded from macro 'pr_err'
printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
^ ~~~~~~~~~~~
include/linux/printk.h:446:44: note: expanded from macro 'printk'
#define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
^ ~~~~~~~~~~~
include/linux/printk.h:418:3: note: expanded from macro 'printk_index_wrap'
_p_func(_fmt, ##__VA_ARGS__); \
^ ~~~~~~~~~~~
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.
Suppressed 3 warnings (2 in non-user code, 1 with check filters).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
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.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
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.
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.
6 warnings generated.
>> drivers/pinctrl/pinctrl-starfive.c:640:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
struct device *dev = sfp->gc.parent;
^~~ ~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-starfive.c:640:17: note: Value stored to 'dev' during its initialization is never read
struct device *dev = sfp->gc.parent;
^~~ ~~~~~~~~~~~~~~
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
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.
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.
9 warnings generated.
fs/ntfs/compress.c:164:6: warning: Value stored to 'cb_sb_start' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
u8 *cb_sb_start = cb; /* Beginning of the current sb in the cb. */
^~~~~~~~~~~ ~~
fs/ntfs/compress.c:164:6: note: Value stored to 'cb_sb_start' during its initialization is never read
u8 *cb_sb_start = cb; /* Beginning of the current sb in the cb. */
^~~~~~~~~~~ ~~
fs/ntfs/compress.c:810:4: warning: Value stored to 'cb_pos' is never read [clang-analyzer-deadcode.DeadStores]
cb_pos += cb_max_ofs - cur_ofs;
^ ~~~~~~~~~~~~~~~~~~~~
fs/ntfs/compress.c:810:4: note: Value stored to 'cb_pos' is never read
cb_pos += cb_max_ofs - cur_ofs;
^ ~~~~~~~~~~~~~~~~~~~~
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.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
fs/ntfs/dir.c:1107:2: warning: Value stored to 'rc' is never read [clang-analyzer-deadcode.DeadStores]
rc = err = 0;
^ ~~~~~~~
fs/ntfs/dir.c:1107:2: note: Value stored to 'rc' is never read
rc = err = 0;
^ ~~~~~~~
fs/ntfs/dir.c:1306:36: warning: Access to field 'magic' results in a dereference of a null pointer (loaded from variable 'ia') [clang-analyzer-core.NullDereference]
if (unlikely(!ntfs_is_indx_record(ia->magic))) {
^
fs/ntfs/layout.h:139:50: note: expanded from macro 'ntfs_is_indx_record'
#define ntfs_is_indx_record(x) ( ntfs_is_magic (x, INDX) )
^
fs/ntfs/layout.h:124:45: note: expanded from macro 'ntfs_is_magic'
#define ntfs_is_magic(x, m) __ntfs_is_magic(x, magic_##m)
^
include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^
fs/ntfs/dir.c:1105:2: note: Taking false branch
ntfs_debug("Entering for inode 0x%lx, fpos 0x%llx.",
^
fs/ntfs/debug.h:39:2: note: expanded from macro 'ntfs_debug'
if (0) \
^
fs/ntfs/dir.c:1105:2: note: Loop condition is false. Exiting loop
ntfs_debug("Entering for inode 0x%lx, fpos 0x%llx.",
^
fs/ntfs/debug.h:37:35: note: expanded from macro 'ntfs_debug'
#define ntfs_debug(fmt, ...) \
^
fs/ntfs/dir.c:1110:6: note: Assuming the condition is false
if (actor->pos >= i_size + vol->mft_record_size)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ntfs/dir.c:1110:2: note: Taking false branch
if (actor->pos >= i_size + vol->mft_record_size)
^
fs/ntfs/dir.c:1113:7: note: Calling 'dir_emit_dots'
if (!dir_emit_dots(file, actor))
^~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/fs.h:3653:6: note: Assuming field 'pos' is not equal to 0
if (ctx->pos == 0) {
^~~~~~~~~~~~~
include/linux/fs.h:3653:2: note: Taking false branch
if (ctx->pos == 0) {
^
include/linux/fs.h:3658:6: note: Assuming field 'pos' is not equal to 1
if (ctx->pos == 1) {
^~~~~~~~~~~~~
include/linux/fs.h:3658:2: note: Taking false branch
if (ctx->pos == 1) {
^
include/linux/fs.h:3663:2: note: Returning the value 1, which participates in a condition later
return true;
vim +/dev +640 drivers/pinctrl/pinctrl-starfive.c
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 635
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 636 static int starfive_set_mux(struct pinctrl_dev *pctldev,
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 637 unsigned int fsel, unsigned int gsel)
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 638 {
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 639 struct starfive_pinctrl *sfp = pinctrl_dev_get_drvdata(pctldev);
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 @640 struct device *dev = sfp->gc.parent;
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 641 const struct group_desc *group;
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 642 const u32 *pinmux;
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 643 unsigned int i;
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 644
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 645 group = pinctrl_generic_get_group(pctldev, gsel);
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 646 if (!group)
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 647 return -EINVAL;
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 648
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 649 pinmux = group->data;
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 650 for (i = 0; i < group->num_pins; i++) {
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 651 u32 v = pinmux[i];
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 652 unsigned int gpio = starfive_pinmux_to_gpio(v);
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 653 u32 dout = starfive_pinmux_to_dout(v);
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 654 u32 doen = starfive_pinmux_to_doen(v);
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 655 u32 din = starfive_pinmux_to_din(v);
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 656 void __iomem *reg_dout;
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 657 void __iomem *reg_doen;
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 658 void __iomem *reg_din;
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 659 unsigned long flags;
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 660
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 661 dev_dbg(dev, "GPIO%u: dout=0x%x doen=0x%x din=0x%x\n",
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 662 gpio, dout, doen, din);
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 663
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 664 reg_dout = sfp->base + GPON_DOUT_CFG + 8 * gpio;
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 665 reg_doen = sfp->base + GPON_DOEN_CFG + 8 * gpio;
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 666 if (din != GPI_NONE)
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 667 reg_din = sfp->base + GPI_CFG_OFFSET + 4 * din;
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 668 else
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 669 reg_din = NULL;
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 670
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 671 raw_spin_lock_irqsave(&sfp->lock, flags);
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 672 writel_relaxed(dout, reg_dout);
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 673 writel_relaxed(doen, reg_doen);
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 674 if (reg_din)
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 675 writel_relaxed(gpio + 2, reg_din);
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 676 raw_spin_unlock_irqrestore(&sfp->lock, flags);
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 677 }
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 678
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 679 return 0;
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 680 }
ec648f6b7686b71 Emil Renner Berthing 2021-07-06 681
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
next reply other threads:[~2022-01-26 21:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-26 21:56 kernel test robot [this message]
2022-02-03 0:18 drivers/pinctrl/pinctrl-starfive.c:640:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores] kernel test robot
2022-06-03 12:20 kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202201270546.QG2iciS2-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.