* [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
@ 2025-01-07 7:06 kernel test robot
2025-01-07 11:34 ` Charles Keepax
0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2025-01-07 7:06 UTC (permalink / raw)
To: Charles Keepax; +Cc: llvm, oe-kbuild-all, Mark Brown
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [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
2025-01-07 7:06 [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 kernel test robot
@ 2025-01-07 11:34 ` Charles Keepax
0 siblings, 0 replies; 2+ messages in thread
From: Charles Keepax @ 2025-01-07 11:34 UTC (permalink / raw)
To: kernel test robot; +Cc: llvm, oe-kbuild-all, Mark Brown
On Tue, Jan 07, 2025 at 03:06:49PM +0800, kernel test robot wrote:
> 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.
Apologies for the oversight. I have a couple suggestions from
Shuming Fan to add as well, I should be able to get a respin out
today at some point.
Thanks,
Charles
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-01-07 11:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-07 7:06 [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 kernel test robot
2025-01-07 11:34 ` Charles Keepax
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox