All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/pinctrl/pinctrl-starfive.c:640:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
@ 2022-02-03  0:18 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2022-02-03  0:18 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 17875 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:   88808fbbead481aedb46640a5ace69c58287f56a
commit: ec648f6b7686b716424e8e73eebb4c11ae199187 pinctrl: starfive: Add pinctrl driver for StarFive SoCs
date:   7 weeks ago
:::::: branch date: 5 hours ago
:::::: commit date: 7 weeks ago
config: arm-randconfig-c002-20220201 (https://download.01.org/0day-ci/archive/20220203/202202030746.ZZk8x0QQ-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 6b1e844b69f15bb7dffaf9365cd2b355d2eb7579)
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/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=arm 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 >>)
                                                   ^
   fs/ext4/extents.c:4181:6: note: Assuming the condition is false
           if ((flags & EXT4_GET_BLOCKS_CREATE) == 0) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ext4/extents.c:4181:2: note: Taking false branch
           if ((flags & EXT4_GET_BLOCKS_CREATE) == 0) {
           ^
   fs/ext4/extents.c:4211:6: note: Assuming 'cluster_offset' is 0
           if (cluster_offset && ex &&
               ^~~~~~~~~~~~~~
   fs/ext4/extents.c:4211:21: note: Left side of '&&' is false
           if (cluster_offset && ex &&
                              ^
   fs/ext4/extents.c:4221:6: note: 'err' is 0
           if (err)
               ^~~
   fs/ext4/extents.c:4221:2: note: Taking false branch
           if (err)
           ^
   fs/ext4/extents.c:4224:8: note: Calling 'ext4_ext_search_right'
           err = ext4_ext_search_right(inode, path, &ar.lright, &ar.pright, &ex2);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ext4/extents.c:1539:15: note: 'path' is not equal to null
           if (unlikely(path == NULL)) {
                        ^
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   fs/ext4/extents.c:1539:2: note: Taking false branch
           if (unlikely(path == NULL)) {
           ^
   fs/ext4/extents.c:1546:6: note: 'depth' is not equal to 0
           if (depth == 0 && path->p_ext == NULL)
               ^~~~~
   fs/ext4/extents.c:1546:17: note: Left side of '&&' is false
           if (depth == 0 && path->p_ext == NULL)
                          ^
   fs/ext4/extents.c:1555:2: note: Taking false branch
           if (*logical < le32_to_cpu(ex->ee_block)) {
           ^
   fs/ext4/extents.c:1574:2: note: Taking false branch
           if (unlikely(*logical < (le32_to_cpu(ex->ee_block) + ee_len))) {
           ^
   fs/ext4/extents.c:1581:6: note: Assuming the condition is false
           if (ex != EXT_LAST_EXTENT(path[depth].p_hdr)) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ext4/extents.c:1581:2: note: Taking false branch
           if (ex != EXT_LAST_EXTENT(path[depth].p_hdr)) {
           ^
   fs/ext4/extents.c:1588:2: note: Loop condition is true.  Entering loop body
           while (--depth >= 0) {
           ^
   fs/ext4/extents.c:1590:7: note: Assuming the condition is true
                   if (ix != EXT_LAST_INDEX(path[depth].p_hdr))
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ext4/extents.c:1590:3: note: Taking true branch
                   if (ix != EXT_LAST_INDEX(path[depth].p_hdr))
                   ^
   fs/ext4/extents.c:1591:4: note: Control jumps to line 1601
                           goto got_index;
                           ^
   fs/ext4/extents.c:1602:2: note: Loop condition is false. Execution continues on line 1612
           while (++depth < path->p_depth) {
           ^
   fs/ext4/extents.c:1613:2: note: Taking true branch
           if (IS_ERR(bh))
           ^
   fs/ext4/extents.c:1614:3: note: Returning without writing to 'ret_ex->ee_block'
                   return PTR_ERR(bh);
                   ^
   fs/ext4/extents.c:4224:8: note: Returning from 'ext4_ext_search_right'
           err = ext4_ext_search_right(inode, path, &ar.lright, &ar.pright, &ex2);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ext4/extents.c:4225:6: note: 'err' is >= 0
           if (err < 0)
               ^~~
   fs/ext4/extents.c:4225:2: note: Taking false branch
           if (err < 0)
           ^
   fs/ext4/extents.c:4230:7: note: Assuming field 's_cluster_ratio' is > 1
           if ((sbi->s_cluster_ratio > 1) && err &&
                ^~~~~~~~~~~~~~~~~~~~~~~~
   fs/ext4/extents.c:4230:6: note: Left side of '&&' is true
           if ((sbi->s_cluster_ratio > 1) && err &&
               ^
   fs/ext4/extents.c:4230:36: note: 'err' is not equal to 0
           if ((sbi->s_cluster_ratio > 1) && err &&
                                             ^~~
   fs/ext4/extents.c:4230:6: note: Left side of '&&' is true
           if ((sbi->s_cluster_ratio > 1) && err &&
               ^
   fs/ext4/extents.c:4231:6: note: Calling 'get_implied_cluster_alloc'
               get_implied_cluster_alloc(inode->i_sb, map, &ex2, path)) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ext4/extents.c:4013:2: note: Assigned value is garbage or undefined
           ext4_lblk_t ee_block = le32_to_cpu(ex->ee_block);
           ^
   Suppressed 4 warnings (4 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/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 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.
   drivers/pinctrl/pinctrl-ingenic.c:3627:15: warning: Value stored to 'idx' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           unsigned int idx = pin % PINS_PER_GPIO_CHIP;
                        ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-ingenic.c:3627:15: note: Value stored to 'idx' during its initialization is never read
           unsigned int idx = pin % PINS_PER_GPIO_CHIP;
                        ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-ingenic.c:3628:15: warning: Value stored to 'offt' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           unsigned int offt = pin / PINS_PER_GPIO_CHIP;
                        ^~~~   ~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-ingenic.c:3628:15: note: Value stored to 'offt' during its initialization is never read
           unsigned int offt = pin / PINS_PER_GPIO_CHIP;
                        ^~~~   ~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-ingenic.c:3696:15: warning: Value stored to 'idx' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           unsigned int idx = pin % PINS_PER_GPIO_CHIP;
                        ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-ingenic.c:3696:15: note: Value stored to 'idx' during its initialization is never read
           unsigned int idx = pin % PINS_PER_GPIO_CHIP;
                        ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-ingenic.c:3697:15: warning: Value stored to 'offt' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           unsigned int offt = pin / PINS_PER_GPIO_CHIP;
                        ^~~~   ~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/pinctrl/pinctrl-ingenic.c:3697:15: note: Value stored to 'offt' during its initialization is never read
           unsigned int offt = pin / PINS_PER_GPIO_CHIP;
                        ^~~~   ~~~~~~~~~~~~~~~~~~~~~~~~
   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.
   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.
   9 warnings generated.
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:73:2: warning: Value stored to 'temp' is never read [clang-analyzer-deadcode.DeadStores]
           temp = RREG32(rec->mask_clk_reg);
           ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:73:2: note: Value stored to 'temp' is never read
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:77:2: warning: Value stored to 'temp' is never read [clang-analyzer-deadcode.DeadStores]
           temp = RREG32(rec->mask_data_reg);
           ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:77:2: note: Value stored to 'temp' is never read
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:92:2: warning: Value stored to 'temp' is never read [clang-analyzer-deadcode.DeadStores]
           temp = RREG32(rec->mask_clk_reg);
           ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:92:2: note: Value stored to 'temp' is never read
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:96:2: warning: Value stored to 'temp' is never read [clang-analyzer-deadcode.DeadStores]
           temp = RREG32(rec->mask_data_reg);
           ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:96:2: note: Value stored to 'temp' is never read
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:312:3: warning: 4th function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
                   DRM_DEBUG("i2c 0x%02x 0x%02x read failed\n",
                   ^
   include/drm/drm_print.h:526:2: note: expanded from macro 'DRM_DEBUG'
           __drm_dbg(DRM_UT_CORE, fmt, ##__VA_ARGS__)
           ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:371:2: note: 'val' declared without an initial value
           u8 val;
           ^~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:373:6: note: Assuming field 'cd_valid' is true
           if (!amdgpu_connector->router.cd_valid)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:373:2: note: Taking false branch
           if (!amdgpu_connector->router.cd_valid)
           ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:376:6: note: Assuming field 'router_bus' is non-null
           if (!amdgpu_connector->router_bus)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:376:2: note: Taking false branch
           if (!amdgpu_connector->router_bus)
           ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:379:2: note: Calling 'amdgpu_i2c_get_byte'
           amdgpu_i2c_get_byte(amdgpu_connector->router_bus,
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:308:6: note: Assuming the condition is false
           if (i2c_transfer(&i2c_bus->adapter, msgs, 2) == 2) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:308:2: note: Taking false branch
           if (i2c_transfer(&i2c_bus->adapter, msgs, 2) == 2) {
           ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:312:3: note: 4th function call argument is an uninitialized value
                   DRM_DEBUG("i2c 0x%02x 0x%02x read failed\n",
                   ^
   include/drm/drm_print.h:526:2: note: expanded from macro 'DRM_DEBUG'

vim +/dev +640 drivers/pinctrl/pinctrl-starfive.c

ec648f6b7686b7 Emil Renner Berthing 2021-07-06  635  
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  636  static int starfive_set_mux(struct pinctrl_dev *pctldev,
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  637  			    unsigned int fsel, unsigned int gsel)
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  638  {
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  639  	struct starfive_pinctrl *sfp = pinctrl_dev_get_drvdata(pctldev);
ec648f6b7686b7 Emil Renner Berthing 2021-07-06 @640  	struct device *dev = sfp->gc.parent;
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  641  	const struct group_desc *group;
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  642  	const u32 *pinmux;
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  643  	unsigned int i;
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  644  
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  645  	group = pinctrl_generic_get_group(pctldev, gsel);
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  646  	if (!group)
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  647  		return -EINVAL;
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  648  
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  649  	pinmux = group->data;
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  650  	for (i = 0; i < group->num_pins; i++) {
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  651  		u32 v = pinmux[i];
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  652  		unsigned int gpio = starfive_pinmux_to_gpio(v);
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  653  		u32 dout = starfive_pinmux_to_dout(v);
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  654  		u32 doen = starfive_pinmux_to_doen(v);
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  655  		u32 din = starfive_pinmux_to_din(v);
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  656  		void __iomem *reg_dout;
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  657  		void __iomem *reg_doen;
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  658  		void __iomem *reg_din;
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  659  		unsigned long flags;
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  660  
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  661  		dev_dbg(dev, "GPIO%u: dout=0x%x doen=0x%x din=0x%x\n",
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  662  			gpio, dout, doen, din);
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  663  
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  664  		reg_dout = sfp->base + GPON_DOUT_CFG + 8 * gpio;
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  665  		reg_doen = sfp->base + GPON_DOEN_CFG + 8 * gpio;
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  666  		if (din != GPI_NONE)
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  667  			reg_din = sfp->base + GPI_CFG_OFFSET + 4 * din;
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  668  		else
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  669  			reg_din = NULL;
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  670  
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  671  		raw_spin_lock_irqsave(&sfp->lock, flags);
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  672  		writel_relaxed(dout, reg_dout);
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  673  		writel_relaxed(doen, reg_doen);
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  674  		if (reg_din)
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  675  			writel_relaxed(gpio + 2, reg_din);
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  676  		raw_spin_unlock_irqrestore(&sfp->lock, flags);
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  677  	}
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  678  
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  679  	return 0;
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  680  }
ec648f6b7686b7 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* drivers/pinctrl/pinctrl-starfive.c:640:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
@ 2022-06-03 12:20 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2022-06-03 12:20 UTC (permalink / raw)
  To: kbuild

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

:::::: 
:::::: Manual check reason: "low confidence static check first_new_problem: drivers/pinctrl/pinctrl-starfive.c:640: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: Emil Renner Berthing <kernel@esmil.dk>
CC: Arnd Bergmann <arnd@arndb.de>

Hi Emil,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   50fd82b3a9a9335df5d50c7ddcb81c81d358c4fc
commit: 299e6f788eab0b0aef97efb29ddc6971e7d0daf3 reset: starfive-jh7100: Fix 32bit compilation
date:   6 months ago
:::::: branch date: 14 hours ago
:::::: commit date: 6 months ago
config: arm-randconfig-c002-20220531 (https://download.01.org/0day-ci/archive/20220603/202206032016.QOZxWZ22-lkp(a)intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project c825abd6b0198fb088d9752f556a70705bc99dfd)
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/torvalds/linux.git/commit/?id=299e6f788eab0b0aef97efb29ddc6971e7d0daf3
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 299e6f788eab0b0aef97efb29ddc6971e7d0daf3
        # save the config file
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm 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 >>)
           struct delta_dev *delta = ctx->dev;
                             ^~~~~   ~~~~~~~~
   drivers/media/platform/sti/delta/delta-v4l2.c:431:16: warning: Value stored to 'str' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           unsigned char str[100] = "";
                         ^~~        ~~
   drivers/media/platform/sti/delta/delta-v4l2.c:431:16: note: Value stored to 'str' during its initialization is never read
           unsigned char str[100] = "";
                         ^~~        ~~
   drivers/media/platform/sti/delta/delta-v4l2.c:456:20: warning: Value stored to 'delta' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct delta_dev *delta = ctx->dev;
                             ^~~~~   ~~~~~~~~
   drivers/media/platform/sti/delta/delta-v4l2.c:456:20: note: Value stored to 'delta' during its initialization is never read
           struct delta_dev *delta = ctx->dev;
                             ^~~~~   ~~~~~~~~
   drivers/media/platform/sti/delta/delta-v4l2.c:460:16: warning: Value stored to 'str' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           unsigned char str[100] = "";
                         ^~~        ~~
   drivers/media/platform/sti/delta/delta-v4l2.c:460:16: note: Value stored to 'str' during its initialization is never read
           unsigned char str[100] = "";
                         ^~~        ~~
   drivers/media/platform/sti/delta/delta-v4l2.c:495:20: warning: Value stored to 'delta' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct delta_dev *delta = ctx->dev;
                             ^~~~~   ~~~~~~~~
   drivers/media/platform/sti/delta/delta-v4l2.c:495:20: note: Value stored to 'delta' during its initialization is never read
           struct delta_dev *delta = ctx->dev;
                             ^~~~~   ~~~~~~~~
   drivers/media/platform/sti/delta/delta-v4l2.c:549:20: warning: Value stored to 'delta' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct delta_dev *delta = ctx->dev;
                             ^~~~~   ~~~~~~~~
   drivers/media/platform/sti/delta/delta-v4l2.c:549:20: note: Value stored to 'delta' during its initialization is never read
           struct delta_dev *delta = ctx->dev;
                             ^~~~~   ~~~~~~~~
   drivers/media/platform/sti/delta/delta-v4l2.c:609:20: warning: Value stored to 'delta' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct delta_dev *delta = ctx->dev;
                             ^~~~~   ~~~~~~~~
   drivers/media/platform/sti/delta/delta-v4l2.c:609:20: note: Value stored to 'delta' during its initialization is never read
           struct delta_dev *delta = ctx->dev;
                             ^~~~~   ~~~~~~~~
   drivers/media/platform/sti/delta/delta-v4l2.c:645:20: warning: Value stored to 'delta' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct delta_dev *delta = ctx->dev;
                             ^~~~~   ~~~~~~~~
   drivers/media/platform/sti/delta/delta-v4l2.c:645:20: note: Value stored to 'delta' during its initialization is never read
           struct delta_dev *delta = ctx->dev;
                             ^~~~~   ~~~~~~~~
   drivers/media/platform/sti/delta/delta-v4l2.c:649:16: warning: Value stored to 'str' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           unsigned char str[100] = "";
                         ^~~        ~~
   drivers/media/platform/sti/delta/delta-v4l2.c:649:16: note: Value stored to 'str' during its initialization is never read
           unsigned char str[100] = "";
                         ^~~        ~~
   drivers/media/platform/sti/delta/delta-v4l2.c:766:20: warning: Value stored to 'delta' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct delta_dev *delta = ctx->dev;
                             ^~~~~   ~~~~~~~~
   drivers/media/platform/sti/delta/delta-v4l2.c:766:20: note: Value stored to 'delta' during its initialization is never read
           struct delta_dev *delta = ctx->dev;
                             ^~~~~   ~~~~~~~~
   drivers/media/platform/sti/delta/delta-v4l2.c:809:20: warning: Value stored to 'delta' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct delta_dev *delta = ctx->dev;
                             ^~~~~   ~~~~~~~~
   drivers/media/platform/sti/delta/delta-v4l2.c:809:20: note: Value stored to 'delta' during its initialization is never read
           struct delta_dev *delta = ctx->dev;
                             ^~~~~   ~~~~~~~~
   drivers/media/platform/sti/delta/delta-v4l2.c:1045:20: warning: Value stored to 'delta' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct delta_dev *delta = ctx->dev;
                             ^~~~~   ~~~~~~~~
   drivers/media/platform/sti/delta/delta-v4l2.c:1045:20: note: Value stored to 'delta' during its initialization is never read
           struct delta_dev *delta = ctx->dev;
                             ^~~~~   ~~~~~~~~
   drivers/media/platform/sti/delta/delta-v4l2.c:1055:20: warning: Value stored to 'delta' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct delta_dev *delta = ctx->dev;
                             ^~~~~   ~~~~~~~~
   drivers/media/platform/sti/delta/delta-v4l2.c:1055:20: note: Value stored to 'delta' during its initialization is never read
           struct delta_dev *delta = ctx->dev;
                             ^~~~~   ~~~~~~~~
   drivers/media/platform/sti/delta/delta-v4l2.c:1118:20: warning: Value stored to 'delta' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct delta_dev *delta = ctx->dev;
                             ^~~~~   ~~~~~~~~
   drivers/media/platform/sti/delta/delta-v4l2.c:1118:20: note: Value stored to 'delta' during its initialization is never read
           struct delta_dev *delta = ctx->dev;
                             ^~~~~   ~~~~~~~~
   drivers/media/platform/sti/delta/delta-v4l2.c:1314:16: warning: Value stored to 'str1' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           unsigned char str1[100] = "";
                         ^~~~        ~~
   drivers/media/platform/sti/delta/delta-v4l2.c:1314:16: note: Value stored to 'str1' during its initialization is never read
           unsigned char str1[100] = "";
                         ^~~~        ~~
   drivers/media/platform/sti/delta/delta-v4l2.c:1315:16: warning: Value stored to 'str2' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           unsigned char str2[100] = "";
                         ^~~~        ~~
   drivers/media/platform/sti/delta/delta-v4l2.c:1315:16: note: Value stored to 'str2' during its initialization is never read
           unsigned char str2[100] = "";
                         ^~~~        ~~
   drivers/media/platform/sti/delta/delta-v4l2.c:1420:20: warning: Value stored to 'delta' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct delta_dev *delta = ctx->dev;
                             ^~~~~   ~~~~~~~~
   drivers/media/platform/sti/delta/delta-v4l2.c:1420:20: note: Value stored to 'delta' during its initialization is never read
           struct delta_dev *delta = ctx->dev;
                             ^~~~~   ~~~~~~~~
   Suppressed 1 warnings (1 with check filters).
   1 warning 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;
                          ^~~   ~~~~~~~~~~~~~~
   1 warning generated.
   drivers/pinctrl/bcm/pinctrl-bcm281xx.c:1064:38: warning: Value stored to 'f' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           const struct bcm281xx_pin_function *f = &pdata->functions[function];
                                               ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/pinctrl/bcm/pinctrl-bcm281xx.c:1064:38: note: Value stored to 'f' during its initialization is never read
           const struct bcm281xx_pin_function *f = &pdata->functions[function];
                                               ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.
   drivers/gpu/drm/drm_framebuffer.c:855:2: warning: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
           strcpy(fb->comm, current->comm);
           ^~~~~~
   drivers/gpu/drm/drm_framebuffer.c:855:2: note: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119
           strcpy(fb->comm, current->comm);
           ^~~~~~
   1 warning generated.
   Suppressed 1 warnings (1 with check filters).
   1 warning generated.
   Suppressed 1 warnings (1 with check filters).
   1 warning generated.
   Suppressed 1 warnings (1 with check filters).
   1 warning generated.
   Suppressed 1 warnings (1 with check filters).
   1 warning generated.
   Suppressed 1 warnings (1 with check filters).
   1 warning generated.
   include/linux/hid.h:1007:9: warning: Access to field 'name' results in a dereference of a null pointer (loaded from variable 'input') [clang-analyzer-core.NullDereference]
                                       input->name, c, type);
                                       ^
   drivers/hid/hid-petalynx.c:41:6: note: Assuming the condition is true
           if ((usage->hid & HID_USAGE_PAGE) == HID_UP_LOGIVENDOR) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hid/hid-petalynx.c:41:2: note: Taking true branch
           if ((usage->hid & HID_USAGE_PAGE) == HID_UP_LOGIVENDOR) {
           ^
   drivers/hid/hid-petalynx.c:42:3: note: Control jumps to 'case 90:'  at line 43
                   switch (usage->hid & HID_USAGE) {
                   ^
   drivers/hid/hid-petalynx.c:43:15: note: Calling 'hid_map_usage_clear'
                   case 0x05a: pl_map_key_clear(KEY_TEXT);         break;
                               ^
   drivers/hid/hid-petalynx.c:35:29: note: expanded from macro 'pl_map_key_clear'
   #define pl_map_key_clear(c)     hid_map_usage_clear(hi, usage, bit, max, \
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/hid.h:1035:2: note: Calling 'hid_map_usage'
           hid_map_usage(hidinput, usage, bit, max, type, c);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/hid.h:982:2: note: 'input' initialized here
           struct input_dev *input = hidinput->input;
           ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/hid.h:986:2: note: Control jumps to 'case 1:'  at line 995
           switch (type) {
           ^
   include/linux/hid.h:998:3: note:  Execution continues on line 1005
                   break;
                   ^
   include/linux/hid.h:1005:15: note: 'c' is <= 'limit'
           if (unlikely(c > limit || !bmap)) {
                        ^
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   include/linux/hid.h:1005:15: note: Left side of '||' is false
           if (unlikely(c > limit || !bmap)) {
                        ^
   include/linux/hid.h:1005:28: note: Assuming 'bmap' is null
           if (unlikely(c > limit || !bmap)) {
                                     ^
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   include/linux/hid.h:1005:28: note: Assuming pointer value is null
           if (unlikely(c > limit || !bmap)) {
                                     ^
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   include/linux/hid.h:1005:2: note: Taking true branch
           if (unlikely(c > limit || !bmap)) {
           ^
   include/linux/hid.h:1006:3: note: Assuming the condition is true
                   pr_warn_ratelimited("%s: Invalid code %d type %d\n",
                   ^
   include/linux/printk.h:660:2: note: expanded from macro 'pr_warn_ratelimited'
           printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/printk.h:643:6: note: expanded from macro 'printk_ratelimited'
           if (__ratelimit(&_rs))                                          \
               ^~~~~~~~~~~~~~~~~
   include/linux/ratelimit_types.h:41:28: note: expanded from macro '__ratelimit'
   #define __ratelimit(state) ___ratelimit(state, __func__)
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/hid.h:1006:3: note: Taking true branch
                   pr_warn_ratelimited("%s: Invalid code %d type %d\n",
                   ^
   include/linux/printk.h:660:2: note: expanded from macro 'pr_warn_ratelimited'
--
   include/asm-generic/bug.h:65:32: note: expanded from macro 'BUG_ON'
   #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
                                  ^
   fs/btrfs/check-integrity.c:874:2: note: Loop condition is false.  Exiting loop
           BUG_ON(!(NULL == sf ||
           ^
   include/asm-generic/bug.h:65:27: note: expanded from macro 'BUG_ON'
   #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
                             ^
   fs/btrfs/check-integrity.c:876:2: note: Argument to kfree() is the address of the local variable 'initial_stack_frame', which is not memory allocated by malloc()
           kfree(sf);
           ^     ~~
   include/asm-generic/unaligned.h:37:2: warning: Undefined or garbage value returned to caller [clang-analyzer-core.uninitialized.UndefReturn]
           return le64_to_cpu(__get_unaligned_t(__le64, p));
           ^
   fs/btrfs/check-integrity.c:891:9: note: Assuming 'first_hdr' is non-null
           BUG_ON(!first_hdr);
                  ^
   include/asm-generic/bug.h:65:45: note: expanded from macro 'BUG_ON'
   #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
                                               ^~~~~~~~~
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   fs/btrfs/check-integrity.c:891:2: note: Taking false branch
           BUG_ON(!first_hdr);
           ^
   include/asm-generic/bug.h:65:32: note: expanded from macro 'BUG_ON'
   #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
                                  ^
   fs/btrfs/check-integrity.c:891:2: note: Loop condition is false.  Exiting loop
           BUG_ON(!first_hdr);
           ^
   include/asm-generic/bug.h:65:27: note: expanded from macro 'BUG_ON'
   #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
                             ^
   fs/btrfs/check-integrity.c:904:6: note: Assuming 0 is equal to field 'level'
           if (0 == sf->hdr->level) {
               ^~~~~~~~~~~~~~~~~~~
   fs/btrfs/check-integrity.c:904:2: note: Taking true branch
           if (0 == sf->hdr->level) {
           ^
   fs/btrfs/check-integrity.c:908:3: note: Taking true branch
                   if (-1 == sf->i) {
                   ^
   fs/btrfs/check-integrity.c:911:8: note: Assuming the condition is false
                           if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/btrfs/check-integrity.c:911:4: note: Taking false branch
                           if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
                           ^
   fs/btrfs/check-integrity.c:921:7: note: 0 is equal to field 'num_copies'
                   if (0 == sf->num_copies || sf->mirror_num > sf->num_copies) {
                       ^
   fs/btrfs/check-integrity.c:921:27: note: Left side of '||' is true
                   if (0 == sf->num_copies || sf->mirror_num > sf->num_copies) {
                                           ^
   fs/btrfs/check-integrity.c:926:7: note: Assuming field 'i' is < field 'nr'
                   if (sf->i < sf->nr) {
                       ^~~~~~~~~~~~~~
   fs/btrfs/check-integrity.c:926:3: note: Taking true branch
                   if (sf->i < sf->nr) {
                   ^
   fs/btrfs/check-integrity.c:936:8: note: Assuming the condition is false
                           if (disk_item_offset + sizeof(struct btrfs_item) >
                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/btrfs/check-integrity.c:936:4: note: Taking false branch
                           if (disk_item_offset + sizeof(struct btrfs_item) >
                           ^
   fs/btrfs/check-integrity.c:954:8: note: Assuming 'type' is equal to BTRFS_ROOT_ITEM_KEY
                           if (BTRFS_ROOT_ITEM_KEY == type) {
                               ^
   include/uapi/linux/btrfs_tree.h:170:29: note: expanded from macro 'BTRFS_ROOT_ITEM_KEY'
   #define BTRFS_ROOT_ITEM_KEY     132
                                   ^
   fs/btrfs/check-integrity.c:954:4: note: Taking true branch
                           if (BTRFS_ROOT_ITEM_KEY == type) {
                           ^
   fs/btrfs/check-integrity.c:961:9: note: Assuming the condition is false
                                   if (root_item_offset + item_size >
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/btrfs/check-integrity.c:961:5: note: Taking false branch
                                   if (root_item_offset + item_size >
                                   ^
   fs/btrfs/check-integrity.c:968:19: note: Calling 'btrfs_root_bytenr'
                                   next_bytenr = btrfs_root_bytenr(&root_item);
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/btrfs/ctree.h:2227:1: note: Calling 'get_unaligned_le64'
   BTRFS_SETGET_STACK_FUNCS(root_bytenr, struct btrfs_root_item, bytenr, 64);
   ^
   fs/btrfs/ctree.h:1645:9: note: expanded from macro 'BTRFS_SETGET_STACK_FUNCS'
           return get_unaligned_le##bits(&s->member);                      \
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   note: expanded from here
   include/asm-generic/unaligned.h:37:2: note: Undefined or garbage value returned to caller
           return le64_to_cpu(__get_unaligned_t(__le64, p));
           ^
   Suppressed 1 warnings (1 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.
   1 warning 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;
                          ^~~   ~~~~~~~~~~~~~~
   1 warning generated.
   drivers/pinctrl/bcm/pinctrl-bcm281xx.c:1064:38: warning: Value stored to 'f' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           const struct bcm281xx_pin_function *f = &pdata->functions[function];
                                               ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/pinctrl/bcm/pinctrl-bcm281xx.c:1064:38: note: Value stored to 'f' during its initialization is never read
           const struct bcm281xx_pin_function *f = &pdata->functions[function];
                                               ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.
   Suppressed 1 warnings (1 with check filters).
   1 warning generated.
   Suppressed 1 warnings (1 with check filters).
   1 warning generated.
   Suppressed 1 warnings (1 with check filters).
   4 warnings generated.
   drivers/media/i2c/tvp7002.c:637:37: warning: The right operand of '&' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
           lpfr = lpf_lsb | ((TVP7002_CL_MASK & lpf_msb) << TVP7002_CL_SHIFT);
                                              ^
   drivers/media/i2c/tvp7002.c:753:2: note: Calling 'tvp7002_query_dv'
           tvp7002_query_dv(sd, &detected);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/i2c/tvp7002.c:616:2: note: 'lpf_msb' declared without an initial value
           u8 lpf_msb;
           ^~~~~~~~~~
   drivers/media/i2c/tvp7002.c:625:2: note: Calling 'tvp7002_read_err'
           tvp7002_read_err(sd, TVP7002_L_FRAME_STAT_MSBS, &lpf_msb, &error);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/i2c/tvp7002.c:475:6: note: Assuming the condition is false
           if (!*err)
               ^~~~~
   drivers/media/i2c/tvp7002.c:475:2: note: Taking false branch
           if (!*err)
           ^
   drivers/media/i2c/tvp7002.c:477:1: note: Returning without writing to '*dst'
   }
   ^
   drivers/media/i2c/tvp7002.c:625:2: note: Returning from 'tvp7002_read_err'
           tvp7002_read_err(sd, TVP7002_L_FRAME_STAT_MSBS, &lpf_msb, &error);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/i2c/tvp7002.c:627:6: note: Assuming 'error' is >= 0
           if (error < 0)
               ^~~~~~~~~
   drivers/media/i2c/tvp7002.c:627:2: note: Taking false branch
           if (error < 0)
           ^
   drivers/media/i2c/tvp7002.c:633:6: note: 'error' is >= 0
           if (error < 0)
               ^~~~~
   drivers/media/i2c/tvp7002.c:633:2: note: Taking false branch
           if (error < 0)
           ^
   drivers/media/i2c/tvp7002.c:637:37: note: The right operand of '&' is a garbage value
           lpfr = lpf_lsb | ((TVP7002_CL_MASK & lpf_msb) << TVP7002_CL_SHIFT);
                                              ^ ~~~~~~~
   drivers/media/i2c/tvp7002.c:638:37: warning: The right operand of '&' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
           cpln = cpl_lsb | ((TVP7002_CL_MASK & cpl_msb) << TVP7002_CL_SHIFT);
                                              ^
   drivers/media/i2c/tvp7002.c:753:2: note: Calling 'tvp7002_query_dv'
           tvp7002_query_dv(sd, &detected);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/i2c/tvp7002.c:618:2: note: 'cpl_msb' declared without an initial value
           u8 cpl_msb;
           ^~~~~~~~~~
   drivers/media/i2c/tvp7002.c:627:6: note: Assuming 'error' is >= 0
           if (error < 0)
               ^~~~~~~~~
   drivers/media/i2c/tvp7002.c:627:2: note: Taking false branch
           if (error < 0)
           ^
   drivers/media/i2c/tvp7002.c:631:2: note: Calling 'tvp7002_read_err'
           tvp7002_read_err(sd, TVP7002_CLK_L_STAT_MSBS, &cpl_msb, &error);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/i2c/tvp7002.c:475:2: note: Taking false branch
           if (!*err)
           ^
   drivers/media/i2c/tvp7002.c:477:1: note: Returning without writing to '*dst'
   }
   ^
   drivers/media/i2c/tvp7002.c:631:2: note: Returning from 'tvp7002_read_err'
           tvp7002_read_err(sd, TVP7002_CLK_L_STAT_MSBS, &cpl_msb, &error);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/i2c/tvp7002.c:633:6: note: 'error' is >= 0
           if (error < 0)
               ^~~~~
   drivers/media/i2c/tvp7002.c:633:2: note: Taking false branch
           if (error < 0)
           ^
   drivers/media/i2c/tvp7002.c:638:37: note: The right operand of '&' is a garbage value
           cpln = cpl_lsb | ((TVP7002_CL_MASK & cpl_msb) << TVP7002_CL_SHIFT);
                                              ^ ~~~~~~~
   drivers/media/i2c/tvp7002.c:1004:2: warning: Value stored to 'error' is never read [clang-analyzer-deadcode.DeadStores]
           error = tvp7002_s_dv_timings(sd, &timings);
           ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/i2c/tvp7002.c:1004:2: note: Value stored to 'error' is never read
           error = tvp7002_s_dv_timings(sd, &timings);
           ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/dev +640 drivers/pinctrl/pinctrl-starfive.c

ec648f6b7686b7 Emil Renner Berthing 2021-07-06  635  
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  636  static int starfive_set_mux(struct pinctrl_dev *pctldev,
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  637  			    unsigned int fsel, unsigned int gsel)
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  638  {
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  639  	struct starfive_pinctrl *sfp = pinctrl_dev_get_drvdata(pctldev);
ec648f6b7686b7 Emil Renner Berthing 2021-07-06 @640  	struct device *dev = sfp->gc.parent;
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  641  	const struct group_desc *group;
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  642  	const u32 *pinmux;
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  643  	unsigned int i;
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  644  
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  645  	group = pinctrl_generic_get_group(pctldev, gsel);
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  646  	if (!group)
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  647  		return -EINVAL;
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  648  
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  649  	pinmux = group->data;
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  650  	for (i = 0; i < group->num_pins; i++) {
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  651  		u32 v = pinmux[i];
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  652  		unsigned int gpio = starfive_pinmux_to_gpio(v);
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  653  		u32 dout = starfive_pinmux_to_dout(v);
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  654  		u32 doen = starfive_pinmux_to_doen(v);
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  655  		u32 din = starfive_pinmux_to_din(v);
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  656  		void __iomem *reg_dout;
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  657  		void __iomem *reg_doen;
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  658  		void __iomem *reg_din;
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  659  		unsigned long flags;
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  660  
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  661  		dev_dbg(dev, "GPIO%u: dout=0x%x doen=0x%x din=0x%x\n",
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  662  			gpio, dout, doen, din);
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  663  
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  664  		reg_dout = sfp->base + GPON_DOUT_CFG + 8 * gpio;
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  665  		reg_doen = sfp->base + GPON_DOEN_CFG + 8 * gpio;
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  666  		if (din != GPI_NONE)
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  667  			reg_din = sfp->base + GPI_CFG_OFFSET + 4 * din;
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  668  		else
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  669  			reg_din = NULL;
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  670  
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  671  		raw_spin_lock_irqsave(&sfp->lock, flags);
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  672  		writel_relaxed(dout, reg_dout);
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  673  		writel_relaxed(doen, reg_doen);
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  674  		if (reg_din)
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  675  			writel_relaxed(gpio + 2, reg_din);
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  676  		raw_spin_unlock_irqrestore(&sfp->lock, flags);
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  677  	}
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  678  
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  679  	return 0;
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  680  }
ec648f6b7686b7 Emil Renner Berthing 2021-07-06  681  

:::::: The code at line 640 was first introduced by commit
:::::: ec648f6b7686b716424e8e73eebb4c11ae199187 pinctrl: starfive: Add pinctrl driver for StarFive SoCs

:::::: TO: Emil Renner Berthing <kernel@esmil.dk>
:::::: CC: Emil Renner Berthing <kernel@esmil.dk>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

^ permalink raw reply	[flat|nested] 3+ messages in thread

* drivers/pinctrl/pinctrl-starfive.c:640:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
@ 2022-01-26 21:56 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2022-01-26 21:56 UTC (permalink / raw)
  To: kbuild

[-- 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-03 12:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
  -- strict thread matches above, loose matches on Subject: below --
2022-06-03 12:20 kernel test robot
2022-01-26 21:56 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.