From: kernel test robot <lkp@intel.com>
To: Charles Keepax <ckeepax@opensource.cirrus.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
Mark Brown <broonie@kernel.org>
Subject: [broonie-ci:20241217_ckeepax_expand_soundwire_mbq_register_map_support 4/4] drivers/base/regmap/regmap-sdw-mbq.c:57:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false
Date: Tue, 7 Jan 2025 15:06:49 +0800 [thread overview]
Message-ID: <202501071455.Gv6kl3eR-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/ci.git 20241217_ckeepax_expand_soundwire_mbq_register_map_support
head: 766e902f1c1c12164474c206edae09c3af3a5318
commit: 766e902f1c1c12164474c206edae09c3af3a5318 [4/4] regmap: sdw-mbq: Add support for SDCA deferred controls
config: x86_64-randconfig-076-20250107 (https://download.01.org/0day-ci/archive/20250107/202501071455.Gv6kl3eR-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250107/202501071455.Gv6kl3eR-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202501071455.Gv6kl3eR-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/base/regmap/regmap-sdw-mbq.c:57:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
57 | if (ctx->readable_reg(dev, reg)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/base/regmap/regmap-sdw-mbq.c:70:9: note: uninitialized use occurs here
70 | return ret;
| ^~~
drivers/base/regmap/regmap-sdw-mbq.c:57:2: note: remove the 'if' if its condition is always true
57 | if (ctx->readable_reg(dev, reg)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
58 | ret = read_poll_timeout(sdw_read_no_pm, val,
59 | val < 0 || !(val & SDCA_CTL_ENTITY_0_FUNCTION_BUSY),
60 | ctx->cfg.timeout_us, ctx->cfg.retry_us,
61 | false, slave, reg);
62 | if (val < 0)
63 | return val;
64 | if (ret)
65 | dev_err(dev, "Function busy timed out 0x%x: %d\n", reg, val);
66 | } else {
| ~~~~~~
67 | fsleep(ctx->cfg.timeout_us);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
68 | }
| ~
drivers/base/regmap/regmap-sdw-mbq.c:50:14: note: initialize the variable 'ret' to silence this warning
50 | int val, ret;
| ^
| = 0
1 warning generated.
vim +57 drivers/base/regmap/regmap-sdw-mbq.c
45
46 static int regmap_sdw_mbq_poll_busy(struct sdw_slave *slave, unsigned int reg,
47 struct regmap_mbq_context *ctx)
48 {
49 struct device *dev = &slave->dev;
50 int val, ret;
51
52 dev_dbg(dev, "Deferring transaction for 0x%x\n", reg);
53
54 reg = SDW_SDCA_CTL(SDW_SDCA_CTL_FUNC(reg), 0,
55 SDCA_CTL_ENTITY_0_FUNCTION_STATUS, 0);
56
> 57 if (ctx->readable_reg(dev, reg)) {
58 ret = read_poll_timeout(sdw_read_no_pm, val,
59 val < 0 || !(val & SDCA_CTL_ENTITY_0_FUNCTION_BUSY),
60 ctx->cfg.timeout_us, ctx->cfg.retry_us,
61 false, slave, reg);
62 if (val < 0)
63 return val;
64 if (ret)
65 dev_err(dev, "Function busy timed out 0x%x: %d\n", reg, val);
66 } else {
67 fsleep(ctx->cfg.timeout_us);
68 }
69
70 return ret;
71 }
72
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2025-01-07 7:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-07 7:06 kernel test robot [this message]
2025-01-07 11:34 ` [broonie-ci:20241217_ckeepax_expand_soundwire_mbq_register_map_support 4/4] drivers/base/regmap/regmap-sdw-mbq.c:57:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false Charles Keepax
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=202501071455.Gv6kl3eR-lkp@intel.com \
--to=lkp@intel.com \
--cc=broonie@kernel.org \
--cc=ckeepax@opensource.cirrus.com \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox