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: Fri, 03 Jun 2022 20:20:46 +0800 [thread overview]
Message-ID: <202206032016.QOZxWZ22-lkp@intel.com> (raw)
[-- 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
next reply other threads:[~2022-06-03 12:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-03 12:20 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
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-01-26 21:56 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=202206032016.QOZxWZ22-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.