Hi Kuninori,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on asoc/for-next]
[also build test WARNING on sound/for-next v5.14 next-20210910]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url:
https://github.com/0day-ci/linux/commits/Kuninori-Morimoto/ASoC-Add-Rich-...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: i386-randconfig-r005-20210912 (attached as .config)
compiler: clang version 14.0.0 (
https://github.com/llvm/llvm-project
261cbe98c38f8c1ee1a482fe76511110e790f58a)
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
#
https://github.com/0day-ci/linux/commit/75094c7c873a758d2196b5867d930669a...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Kuninori-Morimoto/ASoC-Add-Rich-Graph-Card-support/20210910-092924
git checkout 75094c7c873a758d2196b5867d930669a15d2e20
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
> sound/soc/generic/rich-graph-card.c:879:6: warning: variable
'ep0' is used uninitialized whenever 'if' condition is true
[-Wsometimes-uninitialized]
if (!of_get_property(ports, "rate",
&val)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/soc/generic/rich-graph-card.c:920:14: note: uninitialized use occurs here
of_node_put(ep0);
^~~
sound/soc/generic/rich-graph-card.c:879:2: note: remove the 'if' if its
condition is always false
if (!of_get_property(ports, "rate", &val)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/soc/generic/rich-graph-card.c:854:25: note: initialize the variable 'ep0'
to silence this warning
struct device_node *ep0, *ep1;
^
= NULL
> sound/soc/generic/rich-graph-card.c:879:6: warning: variable
'ep1' is used uninitialized whenever 'if' condition is true
[-Wsometimes-uninitialized]
if (!of_get_property(ports, "rate",
&val)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/soc/generic/rich-graph-card.c:921:14: note: uninitialized use occurs here
of_node_put(ep1);
^~~
sound/soc/generic/rich-graph-card.c:879:2: note: remove the 'if' if its
condition is always false
if (!of_get_property(ports, "rate", &val)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/soc/generic/rich-graph-card.c:854:31: note: initialize the variable 'ep1'
to silence this warning
struct device_node *ep0, *ep1;
^
= NULL
sound/soc/generic/rich-graph-card.c:1119:10: error: label at end of compound statement:
expected statement
default:
^
;
2 warnings and 1 error generated.
vim +879 sound/soc/generic/rich-graph-card.c
844
845 int rich_graph_link_c2c(struct asoc_simple_priv *priv,
846 struct device_node *lnk,
847 struct link_info *li)
848 {
849 struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link);
850 struct simple_dai_props *dai_props = simple_priv_to_props(priv, li->link);
851 struct snd_soc_pcm_stream *c2c_conf = dai_props->c2c_conf;
852 struct device_node *port0, *port1, *ports;
853 struct device_node *codec0_port, *codec1_port;
854 struct device_node *ep0, *ep1;
855 u32 val;
856 int ret = -EINVAL;
857
858 /*
859 * codec2codec {
860 * ports {
861 * rate = <48000>;
862 * => lnk: port@0 { c2c0_ep: { ... = codec0_ep; }; };
863 * port@1 { c2c1_ep: { ... = codec1_ep; }; };
864 * };
865 * };
866 *
867 * Codec {
868 * ports {
869 * port@0 { codec0_ep: ... }; };
870 * port@1 { codec1_ep: ... }; };
871 * };
872 * };
873 */
874 of_node_get(lnk);
875 port0 = lnk;
876 ports = of_get_parent(port0);
877 port1 = of_get_next_child(ports, lnk);
878
879 if (!of_get_property(ports, "rate", &val)) {
880 struct device *dev = simple_priv_to_dev(priv);
881
882 dev_err(dev, "Codec2Codec needs rate settings\n");
883 goto err;
884 }
885
886 c2c_conf->formats = SNDRV_PCM_FMTBIT_S32_LE; /* update ME */
887 c2c_conf->rate_min =
888 c2c_conf->rate_max = val;
889 c2c_conf->channels_min =
890 c2c_conf->channels_max = 2; /* update ME */
891 dai_link->params = c2c_conf;
892
893 ep0 = port_to_endpoint(port0);
894 ep1 = port_to_endpoint(port1);
895
896 codec0_port = of_graph_get_remote_port(ep0);
897 codec1_port = of_graph_get_remote_port(ep1);
898
899 /*
900 * call Codec first.
901 * see
902 * __graph_parse_node() :: DAI Naming
903 */
904 ret = graph_parse_node(priv, GRAPH_C2C, codec1_port, li, 0);
905 if (ret < 0)
906 goto err;
907
908 /*
909 * call CPU, and set DAI Name
910 */
911 ret = graph_parse_node(priv, GRAPH_C2C, codec0_port, li, 1);
912 if (ret < 0)
913 goto err;
914
915 graph_link_init(priv, codec0_port, li, 1);
916 err:
917 of_node_put(ports);
918 of_node_put(port0);
919 of_node_put(port1);
920 of_node_put(ep0);
921 of_node_put(ep1);
922
923 return ret;
924 }
925 EXPORT_SYMBOL_GPL(rich_graph_link_c2c);
926
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org