From: kernel test robot <lkp@intel.com>
To: Pantelis Antoniou <pantelis.antoniou@linaro.org>,
alsa-devel@alsa-project.org
Cc: kbuild-all@lists.01.org, devicetree@vger.kernel.org,
linux-arm-msm@vger.kernel.org,
Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
Mark Brown <broonie@kernel.org>,
Matt Porter <mporter@konsulko.com>,
Shawn Guo <shawn.guo@linaro.org>
Subject: Re: [PATCH 2/2] ASoC: qcom: add apq8039 sound card support
Date: Sat, 20 Jun 2020 05:58:20 +0800 [thread overview]
Message-ID: <202006200522.pDubzL2F%lkp@intel.com> (raw)
In-Reply-To: <20200619193831.12528-3-pantelis.antoniou@linaro.org>
[-- Attachment #1: Type: text/plain, Size: 5810 bytes --]
Hi Pantelis,
I love your patch! Perhaps something to improve:
[auto build test WARNING on asoc/for-next]
[also build test WARNING on sound/for-next v5.8-rc1 next-20200618]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Pantelis-Antoniou/ASoC-qcom-add-apq8039-sound-card-and-bindings/20200620-034022
base: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: parisc-allyesconfig (attached as .config)
compiler: hppa-linux-gcc (GCC) 9.3.0
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
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=parisc
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 >>, old ones prefixed by <<):
sound/soc/qcom/apq8039.c: In function 'snd_soc_card_ctl_getset.constprop':
>> sound/soc/qcom/apq8039.c:176:5: warning: 'strncpy' destination unchanged after copying no bytes [-Wstringop-truncation]
176 | strncpy(orig, uinfo->value.enumerated.name,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
177 | origsz);
| ~~~~~~~
vim +/strncpy +176 sound/soc/qcom/apq8039.c
67
68 static int
69 snd_soc_card_ctl_getset(struct snd_soc_card *card,
70 const char *name,
71 char *orig, size_t origsz, const char *value)
72 {
73 struct snd_kcontrol *ctl;
74 struct snd_ctl_elem_info *uinfo = NULL;
75 struct snd_ctl_elem_value *uctl = NULL;
76 unsigned int i, count;
77 int ret;
78
79 /* get the control */
80 ctl = snd_soc_card_ctl_find(card, name, NULL);
81 if (!ctl)
82 return -ENOENT;
83
84 /* allocate info and value */
85 uinfo = kzalloc(sizeof(*uinfo), GFP_KERNEL);
86 uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
87 if (!uinfo || !uctl) {
88 ret = -ENOMEM;
89 goto out_free;
90 }
91
92 ret = ctl->info(ctl, uinfo);
93 if (ret)
94 goto out_free;
95 if (uinfo->count != 1) {
96 ret = -ENOTSUPP;
97 goto out_free;
98 }
99
100 ret = ctl->get(ctl, uctl);
101 if (ret)
102 goto out_free;
103
104 ret = 0;
105
106 switch (uinfo->type) {
107
108 case SNDRV_CTL_ELEM_TYPE_NONE:
109 break;
110
111 case SNDRV_CTL_ELEM_TYPE_BOOLEAN:
112 if (orig && origsz > 0)
113 snprintf(orig, origsz, "%s",
114 uctl->value.integer.value[0] ?
115 "true" : "false");
116
117 if (value) {
118 bool bval;
119
120 ret = kstrtobool(value, &bval);
121 if (ret)
122 goto out_free;
123 uctl->value.integer.value[0] = !!bval;
124
125 }
126 break;
127
128 case SNDRV_CTL_ELEM_TYPE_INTEGER:
129 if (orig && origsz > 0)
130 snprintf(orig, origsz, "%ld",
131 uctl->value.integer.value[0]);
132
133 if (value) {
134 ret = kstrtol(value, 10,
135 &uctl->value.integer.value[0]);
136 if (ret)
137 goto out_free;
138 }
139 break;
140
141 case SNDRV_CTL_ELEM_TYPE_ENUMERATED:
142 count = uinfo->value.enumerated.items;
143
144 if (value) { /* set */
145 for (i = 0; i < count; i++) {
146 uinfo->value.enumerated.item = i;
147 ret = ctl->info(ctl, uinfo);
148 if (ret)
149 goto out_free;
150
151 if (!strcmp(value,
152 uinfo->value.enumerated.name))
153 break;
154 }
155
156 /* setting without finding the enum */
157 if (i >= count) {
158 ret = -EINVAL;
159 goto out_free;
160 }
161 uctl->value.enumerated.item[0] = i;
162 } else { /* get */
163 uinfo->value.enumerated.item =
164 uctl->value.enumerated.item[0];
165 ret = ctl->info(ctl, uinfo);
166 if (ret)
167 goto out_free;
168
169 if (orig && origsz) {
170 if (origsz <
171 strlen(uinfo->value.enumerated.name)
172 + 1) {
173 ret = -ENOSPC;
174 goto out_free;
175 }
> 176 strncpy(orig, uinfo->value.enumerated.name,
177 origsz);
178 }
179 }
180 break;
181
182 case SNDRV_CTL_ELEM_TYPE_INTEGER64:
183 if (orig && origsz > 0)
184 snprintf(orig, origsz, "%lld",
185 uctl->value.integer64.value[0]);
186
187 if (value) {
188 ret = kstrtoll(value, 10,
189 &uctl->value.integer64.value[0]);
190 if (ret)
191 goto out_free;
192 }
193 break;
194
195 case SNDRV_CTL_ELEM_TYPE_BYTES:
196 case SNDRV_CTL_ELEM_TYPE_IEC958:
197 ret = -ENOTSUPP;
198 goto out_free;
199 default:
200 ret = -EINVAL;
201 goto out_free;
202 }
203
204 if (value) {
205 ret = ctl->put(ctl, uctl);
206 if (ret < 0)
207 goto out_free;
208
209 /* if it changed, report change to user space */
210 if (ret > 0)
211 snd_ctl_notify(card->snd_card,
212 SNDRV_CTL_EVENT_MASK_VALUE,
213 &uctl->id);
214 }
215
216 out_free:
217 kfree(uctl);
218 kfree(uinfo);
219
220 if (ret < 0)
221 dev_err(card->dev, "%s: %s operation failed for \"%s\"",
222 __func__, value ? "set" : "get", name);
223
224 return ret;
225 }
226
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 65331 bytes --]
next prev parent reply other threads:[~2020-06-19 22:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-19 19:38 [PATCH 0/2] ASoC: qcom: add apq8039 sound card and bindings Pantelis Antoniou
2020-06-19 19:38 ` [PATCH 1/2] dt-bindings: sound: Device tree bindings for the apq8039 sound complex Pantelis Antoniou
2020-06-19 21:41 ` Stephan Gerhold
2020-06-22 11:34 ` Pantelis Antoniou
2020-06-22 12:04 ` Mark Brown
2020-06-22 13:32 ` Pantelis Antoniou
2020-06-22 13:41 ` Mark Brown
2020-06-22 14:04 ` Pantelis Antoniou
2020-06-22 16:43 ` Mark Brown
2020-06-22 11:51 ` Mark Brown
2020-06-19 19:38 ` [PATCH 2/2] ASoC: qcom: add apq8039 sound card support Pantelis Antoniou
2020-06-19 21:58 ` kernel test robot [this message]
2020-06-20 6:39 ` kernel test robot
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=202006200522.pDubzL2F%lkp@intel.com \
--to=lkp@intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=kbuild-all@lists.01.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=mporter@konsulko.com \
--cc=pantelis.antoniou@linaro.org \
--cc=shawn.guo@linaro.org \
--cc=srinivas.kandagatla@linaro.org \
/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;
as well as URLs for NNTP newsgroup(s).