From: kernel test robot <lkp@intel.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [plbossart-sound:sdw/power-up-all-links 5/5] drivers/soundwire/intel_ace2x.c:150:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false
Date: Thu, 20 Jun 2024 01:36:10 +0800 [thread overview]
Message-ID: <202406200102.evyuf0TR-lkp@intel.com> (raw)
tree: https://github.com/plbossart/sound sdw/power-up-all-links
head: e217e91a2b35ae24464f985c4066597a3bf841b6
commit: 81326c8d060fffd191a6b2185057f229f064164a [5/5] soundwire: intel_ace2x: power-up/down all links at the same time
config: i386-buildonly-randconfig-002-20240619 (https://download.01.org/0day-ci/archive/20240620/202406200102.evyuf0TR-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240620/202406200102.evyuf0TR-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/202406200102.evyuf0TR-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/soundwire/intel_ace2x.c:150:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
150 | if (!*shim_mask) {
| ^~~~~~~~~~~
drivers/soundwire/intel_ace2x.c:191:9: note: uninitialized use occurs here
191 | return ret;
| ^~~
drivers/soundwire/intel_ace2x.c:150:2: note: remove the 'if' if its condition is always true
150 | if (!*shim_mask) {
| ^~~~~~~~~~~~~~~~
drivers/soundwire/intel_ace2x.c:133:9: note: initialize the variable 'ret' to silence this warning
133 | int ret;
| ^
| = 0
drivers/soundwire/intel_ace2x.c:206:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
206 | if (!*shim_mask) {
| ^~~~~~~~~~~
drivers/soundwire/intel_ace2x.c:223:9: note: uninitialized use occurs here
223 | return ret;
| ^~~
drivers/soundwire/intel_ace2x.c:206:2: note: remove the 'if' if its condition is always true
206 | if (!*shim_mask) {
| ^~~~~~~~~~~~~~~~
drivers/soundwire/intel_ace2x.c:198:9: note: initialize the variable 'ret' to silence this warning
198 | int ret;
| ^
| = 0
2 warnings generated.
vim +150 drivers/soundwire/intel_ace2x.c
124
125 static int intel_link_power_up(struct sdw_intel *sdw)
126 {
127 struct sdw_bus *bus = &sdw->cdns.bus;
128 struct sdw_master_prop *prop = &bus->prop;
129 u32 *shim_mask = sdw->link_res->shim_mask;
130 unsigned int link_id = sdw->instance;
131 u32 clock_source;
132 u32 syncprd;
133 int ret;
134
135 if (prop->mclk_freq % 6000000) {
136 if (prop->mclk_freq % 2400000) {
137 syncprd = SDW_SHIM_SYNC_SYNCPRD_VAL_24_576;
138 clock_source = SDW_SHIM2_MLCS_CARDINAL_CLK;
139 } else {
140 syncprd = SDW_SHIM_SYNC_SYNCPRD_VAL_38_4;
141 clock_source = SDW_SHIM2_MLCS_XTAL_CLK;
142 }
143 } else {
144 syncprd = SDW_SHIM_SYNC_SYNCPRD_VAL_96;
145 clock_source = SDW_SHIM2_MLCS_AUDIO_PLL_CLK;
146 }
147
148 mutex_lock(sdw->link_res->shim_lock);
149
> 150 if (!*shim_mask) {
151 dev_dbg(sdw->cdns.dev, "powering up all links\n");
152
153 ret = hdac_bus_eml_sdw_power_up_unlocked(sdw->link_res->hbus, sdw->link_res->link_mask);
154 if (ret < 0) {
155 dev_err(sdw->cdns.dev, "%s: hdac_bus_eml_sdw_power_up failed: %d\n",
156 __func__, ret);
157 goto out;
158 }
159
160 intel_shim_vs_set_clock_source(sdw, clock_source);
161
162 /* we first need to program the SyncPRD/CPU registers */
163 dev_dbg(sdw->cdns.dev, "first link up, programming SYNCPRD\n");
164
165 ret = hdac_bus_eml_sdw_set_syncprd_unlocked(sdw->link_res->hbus, syncprd);
166 if (ret < 0) {
167 dev_err(sdw->cdns.dev, "%s: hdac_bus_eml_sdw_set_syncprd failed: %d\n",
168 __func__, ret);
169 goto out;
170 }
171
172 /* SYNCPU will change once link is active */
173 ret = hdac_bus_eml_sdw_wait_syncpu_unlocked(sdw->link_res->hbus);
174 if (ret < 0) {
175 dev_err(sdw->cdns.dev, "%s: hdac_bus_eml_sdw_wait_syncpu failed: %d\n",
176 __func__, ret);
177 goto out;
178 }
179
180 }
181
182 *shim_mask |= BIT(link_id);
183
184 sdw->cdns.link_up = true;
185
186 intel_shim_vs_init(sdw);
187
188 out:
189 mutex_unlock(sdw->link_res->shim_lock);
190
191 return ret;
192 }
193
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-06-19 17:36 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202406200102.evyuf0TR-lkp@intel.com \
--to=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=pierre-louis.bossart@linux.intel.com \
/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.