* [broonie-misc:asoc-5.14 5/23] sound/soc/qcom/qdsp6/q6afe.c:1213:18: warning: variable 'port_id' is uninitialized when used here
@ 2021-05-11 17:59 kernel test robot
2021-05-11 18:23 ` Nathan Chancellor
0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2021-05-11 17:59 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 6158 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc.git asoc-5.14
head: ae062a711aa2485fc4f6fe48cdb7229c849f2568
commit: 5f1b95d08de712327e452d082a50fded435ec884 [5/23] ASoC: q6dsp: q6afe: remove unneeded dead-store initialization
config: x86_64-randconfig-r006-20210511 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project a0fed635fe1701470062495a6ffee1c608f3f1bc)
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 x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc.git/commit/?id=5f1b95d08de712327e452d082a50fded435ec884
git remote add broonie-misc https://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc.git
git fetch --no-tags broonie-misc asoc-5.14
git checkout 5f1b95d08de712327e452d082a50fded435ec884
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> sound/soc/qcom/qdsp6/q6afe.c:1213:18: warning: variable 'port_id' is uninitialized when used here [-Wuninitialized]
stop->port_id = port_id;
^~~~~~~
sound/soc/qcom/qdsp6/q6afe.c:1186:13: note: initialize the variable 'port_id' to silence this warning
int port_id;
^
= 0
1 warning generated.
vim +/port_id +1213 sound/soc/qcom/qdsp6/q6afe.c
a4ae3af59bd585 Srinivas Kandagatla 2018-05-18 1173
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1174 /**
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1175 * q6afe_port_stop() - Stop a afe port
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1176 *
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1177 * @port: Instance of port to stop
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1178 *
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1179 * Return: Will be an negative on packet size on success.
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1180 */
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1181 int q6afe_port_stop(struct q6afe_port *port)
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1182 {
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1183 struct afe_port_cmd_device_stop *stop;
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1184 struct q6afe *afe = port->afe;
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1185 struct apr_pkt *pkt;
5f1b95d08de712 Yang Li 2021-04-25 1186 int port_id;
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1187 int ret = 0;
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1188 int index, pkt_size;
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1189 void *p;
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1190
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1191 index = port->token;
c54c1c5ee8e73b Dan Carpenter 2018-06-27 1192 if (index < 0 || index >= AFE_PORT_MAX) {
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1193 dev_err(afe->dev, "AFE port index[%d] invalid!\n", index);
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1194 return -EINVAL;
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1195 }
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1196
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1197 pkt_size = APR_HDR_SIZE + sizeof(*stop);
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1198 p = kzalloc(pkt_size, GFP_KERNEL);
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1199 if (!p)
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1200 return -ENOMEM;
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1201
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1202 pkt = p;
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1203 stop = p + APR_HDR_SIZE;
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1204
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1205 pkt->hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD,
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1206 APR_HDR_LEN(APR_HDR_SIZE),
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1207 APR_PKT_VER);
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1208 pkt->hdr.pkt_size = pkt_size;
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1209 pkt->hdr.src_port = 0;
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1210 pkt->hdr.dest_port = 0;
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1211 pkt->hdr.token = index;
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1212 pkt->hdr.opcode = AFE_PORT_CMD_DEVICE_STOP;
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 @1213 stop->port_id = port_id;
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1214 stop->reserved = 0;
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1215
342a4f8ca12b1c Srinivas Kandagatla 2020-09-10 1216 ret = afe_apr_send_pkt(afe, pkt, port, AFE_PORT_CMD_DEVICE_STOP);
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1217 if (ret)
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1218 dev_err(afe->dev, "AFE close failed %d\n", ret);
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1219
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1220 kfree(pkt);
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1221 return ret;
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1222 }
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1223 EXPORT_SYMBOL_GPL(q6afe_port_stop);
7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1224
:::::: The code at line 1213 was first introduced by commit
:::::: 7fa2d70f976657111a5ea4f3d16a738ddaa10c4f ASoC: qdsp6: q6afe: Add q6afe driver
:::::: TO: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
:::::: CC: Mark Brown <broonie@kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 47162 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [broonie-misc:asoc-5.14 5/23] sound/soc/qcom/qdsp6/q6afe.c:1213:18: warning: variable 'port_id' is uninitialized when used here
2021-05-11 17:59 [broonie-misc:asoc-5.14 5/23] sound/soc/qcom/qdsp6/q6afe.c:1213:18: warning: variable 'port_id' is uninitialized when used here kernel test robot
@ 2021-05-11 18:23 ` Nathan Chancellor
2021-05-11 18:32 ` Mark Brown
0 siblings, 1 reply; 3+ messages in thread
From: Nathan Chancellor @ 2021-05-11 18:23 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 6851 bytes --]
On 5/11/2021 10:59 AM, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc.git asoc-5.14
> head: ae062a711aa2485fc4f6fe48cdb7229c849f2568
> commit: 5f1b95d08de712327e452d082a50fded435ec884 [5/23] ASoC: q6dsp: q6afe: remove unneeded dead-store initialization
Mark, if it is not too late, please drop this commit. Nick pointed out
on the review of this commit that commit 12900bacb4f3 ("ASoC: qcom:
q6afe: remove useless assignments") in your tree already resolved this:
https://lore.kernel.org/r/CAKwvOdkXxyyLSTAaMsyeJ3jxCeAGY=9DxLZNX4DcvF=fmkx7mg(a)mail.gmail.com/
Having both commits in the tree causes port_id to be uninitialized. If
it is too late, I can send a revert.
Cheers,
Nathan
> config: x86_64-randconfig-r006-20210511 (attached as .config)
> compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project a0fed635fe1701470062495a6ffee1c608f3f1bc)
> 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 x86_64 cross compiling tool for clang build
> # apt-get install binutils-x86-64-linux-gnu
> # https://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc.git/commit/?id=5f1b95d08de712327e452d082a50fded435ec884
> git remote add broonie-misc https://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc.git
> git fetch --no-tags broonie-misc asoc-5.14
> git checkout 5f1b95d08de712327e452d082a50fded435ec884
> # save the attached .config to linux build tree
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=x86_64
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All warnings (new ones prefixed by >>):
>
>>> sound/soc/qcom/qdsp6/q6afe.c:1213:18: warning: variable 'port_id' is uninitialized when used here [-Wuninitialized]
> stop->port_id = port_id;
> ^~~~~~~
> sound/soc/qcom/qdsp6/q6afe.c:1186:13: note: initialize the variable 'port_id' to silence this warning
> int port_id;
> ^
> = 0
> 1 warning generated.
>
>
> vim +/port_id +1213 sound/soc/qcom/qdsp6/q6afe.c
>
> a4ae3af59bd585 Srinivas Kandagatla 2018-05-18 1173
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1174 /**
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1175 * q6afe_port_stop() - Stop a afe port
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1176 *
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1177 * @port: Instance of port to stop
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1178 *
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1179 * Return: Will be an negative on packet size on success.
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1180 */
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1181 int q6afe_port_stop(struct q6afe_port *port)
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1182 {
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1183 struct afe_port_cmd_device_stop *stop;
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1184 struct q6afe *afe = port->afe;
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1185 struct apr_pkt *pkt;
> 5f1b95d08de712 Yang Li 2021-04-25 1186 int port_id;
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1187 int ret = 0;
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1188 int index, pkt_size;
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1189 void *p;
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1190
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1191 index = port->token;
> c54c1c5ee8e73b Dan Carpenter 2018-06-27 1192 if (index < 0 || index >= AFE_PORT_MAX) {
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1193 dev_err(afe->dev, "AFE port index[%d] invalid!\n", index);
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1194 return -EINVAL;
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1195 }
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1196
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1197 pkt_size = APR_HDR_SIZE + sizeof(*stop);
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1198 p = kzalloc(pkt_size, GFP_KERNEL);
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1199 if (!p)
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1200 return -ENOMEM;
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1201
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1202 pkt = p;
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1203 stop = p + APR_HDR_SIZE;
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1204
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1205 pkt->hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD,
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1206 APR_HDR_LEN(APR_HDR_SIZE),
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1207 APR_PKT_VER);
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1208 pkt->hdr.pkt_size = pkt_size;
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1209 pkt->hdr.src_port = 0;
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1210 pkt->hdr.dest_port = 0;
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1211 pkt->hdr.token = index;
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1212 pkt->hdr.opcode = AFE_PORT_CMD_DEVICE_STOP;
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 @1213 stop->port_id = port_id;
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1214 stop->reserved = 0;
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1215
> 342a4f8ca12b1c Srinivas Kandagatla 2020-09-10 1216 ret = afe_apr_send_pkt(afe, pkt, port, AFE_PORT_CMD_DEVICE_STOP);
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1217 if (ret)
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1218 dev_err(afe->dev, "AFE close failed %d\n", ret);
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1219
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1220 kfree(pkt);
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1221 return ret;
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1222 }
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1223 EXPORT_SYMBOL_GPL(q6afe_port_stop);
> 7fa2d70f976657 Srinivas Kandagatla 2018-05-18 1224
>
> :::::: The code at line 1213 was first introduced by commit
> :::::: 7fa2d70f976657111a5ea4f3d16a738ddaa10c4f ASoC: qdsp6: q6afe: Add q6afe driver
>
> :::::: TO: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> :::::: CC: Mark Brown <broonie@kernel.org>
>
> ---
> 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
* Re: [broonie-misc:asoc-5.14 5/23] sound/soc/qcom/qdsp6/q6afe.c:1213:18: warning: variable 'port_id' is uninitialized when used here
2021-05-11 18:23 ` Nathan Chancellor
@ 2021-05-11 18:32 ` Mark Brown
0 siblings, 0 replies; 3+ messages in thread
From: Mark Brown @ 2021-05-11 18:32 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 271 bytes --]
On Tue, May 11, 2021 at 11:23:27AM -0700, Nathan Chancellor wrote:
> Having both commits in the tree causes port_id to be uninitialized. If it is
> too late, I can send a revert.
If it's in my tree then the patch has already been applied and a revert
is needed.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-05-11 18:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-11 17:59 [broonie-misc:asoc-5.14 5/23] sound/soc/qcom/qdsp6/q6afe.c:1213:18: warning: variable 'port_id' is uninitialized when used here kernel test robot
2021-05-11 18:23 ` Nathan Chancellor
2021-05-11 18:32 ` Mark Brown
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.