* drivers/soc/qcom/qcom_aoss.c:230:9: warning: function 'qmp_send' might be a candidate for 'gnu_printf' format attribute
@ 2023-12-08 12:50 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2023-12-08 12:50 UTC (permalink / raw)
To: Bjorn Andersson; +Cc: oe-kbuild-all, linux-kernel, Konrad Dybcio
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 5e3f5b81de80c98338bcb47c233aebefee5a4801
commit: 8873d1e2f88afbe89c99d8f49f88934a2da2991f soc: qcom: aoss: Format string in qmp_send()
date: 4 months ago
config: mips-allyesconfig (https://download.01.org/0day-ci/archive/20231208/202312082016.BRzEllrB-lkp@intel.com/config)
compiler: mips-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231208/202312082016.BRzEllrB-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/202312082016.BRzEllrB-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/soc/qcom/qcom_aoss.c: In function 'qmp_send':
>> drivers/soc/qcom/qcom_aoss.c:230:9: warning: function 'qmp_send' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
230 | len = vsnprintf(buf, sizeof(buf), fmt, args);
| ^~~
vim +230 drivers/soc/qcom/qcom_aoss.c
204
205 /**
206 * qmp_send() - send a message to the AOSS
207 * @qmp: qmp context
208 * @fmt: format string for message to be sent
209 * @...: arguments for the format string
210 *
211 * Transmit message to AOSS and wait for the AOSS to acknowledge the message.
212 * data must not be longer than the mailbox size. Access is synchronized by
213 * this implementation.
214 *
215 * Return: 0 on success, negative errno on failure
216 */
217 int qmp_send(struct qmp *qmp, const char *fmt, ...)
218 {
219 char buf[QMP_MSG_LEN];
220 long time_left;
221 va_list args;
222 int len;
223 int ret;
224
225 if (WARN_ON(IS_ERR_OR_NULL(qmp) || !fmt))
226 return -EINVAL;
227
228 memset(buf, 0, sizeof(buf));
229 va_start(args, fmt);
> 230 len = vsnprintf(buf, sizeof(buf), fmt, args);
231 va_end(args);
232
233 if (WARN_ON(len >= sizeof(buf)))
234 return -EINVAL;
235
236 mutex_lock(&qmp->tx_lock);
237
238 /* The message RAM only implements 32-bit accesses */
239 __iowrite32_copy(qmp->msgram + qmp->offset + sizeof(u32),
240 buf, sizeof(buf) / sizeof(u32));
241 writel(sizeof(buf), qmp->msgram + qmp->offset);
242
243 /* Read back length to confirm data written in message RAM */
244 readl(qmp->msgram + qmp->offset);
245 qmp_kick(qmp);
246
247 time_left = wait_event_interruptible_timeout(qmp->event,
248 qmp_message_empty(qmp), HZ);
249 if (!time_left) {
250 dev_err(qmp->dev, "ucore did not ack channel\n");
251 ret = -ETIMEDOUT;
252
253 /* Clear message from buffer */
254 writel(0, qmp->msgram + qmp->offset);
255 } else {
256 ret = 0;
257 }
258
259 mutex_unlock(&qmp->tx_lock);
260
261 return ret;
262 }
263 EXPORT_SYMBOL(qmp_send);
264
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
* drivers/soc/qcom/qcom_aoss.c:230:9: warning: function 'qmp_send' might be a candidate for 'gnu_printf' format attribute
@ 2024-01-10 0:28 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2024-01-10 0:28 UTC (permalink / raw)
To: Bjorn Andersson; +Cc: oe-kbuild-all, linux-kernel, Konrad Dybcio
Hi Bjorn,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 6c1dd1fe5d8a1d43ed96e2e0ed44a88c73c5c039
commit: 8873d1e2f88afbe89c99d8f49f88934a2da2991f soc: qcom: aoss: Format string in qmp_send()
date: 5 months ago
config: sparc-allmodconfig (https://download.01.org/0day-ci/archive/20240110/202401100855.UYl3HPPt-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240110/202401100855.UYl3HPPt-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/202401100855.UYl3HPPt-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/soc/qcom/qcom_aoss.c: In function 'qmp_send':
>> drivers/soc/qcom/qcom_aoss.c:230:9: warning: function 'qmp_send' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
230 | len = vsnprintf(buf, sizeof(buf), fmt, args);
| ^~~
vim +230 drivers/soc/qcom/qcom_aoss.c
204
205 /**
206 * qmp_send() - send a message to the AOSS
207 * @qmp: qmp context
208 * @fmt: format string for message to be sent
209 * @...: arguments for the format string
210 *
211 * Transmit message to AOSS and wait for the AOSS to acknowledge the message.
212 * data must not be longer than the mailbox size. Access is synchronized by
213 * this implementation.
214 *
215 * Return: 0 on success, negative errno on failure
216 */
217 int qmp_send(struct qmp *qmp, const char *fmt, ...)
218 {
219 char buf[QMP_MSG_LEN];
220 long time_left;
221 va_list args;
222 int len;
223 int ret;
224
225 if (WARN_ON(IS_ERR_OR_NULL(qmp) || !fmt))
226 return -EINVAL;
227
228 memset(buf, 0, sizeof(buf));
229 va_start(args, fmt);
> 230 len = vsnprintf(buf, sizeof(buf), fmt, args);
231 va_end(args);
232
233 if (WARN_ON(len >= sizeof(buf)))
234 return -EINVAL;
235
236 mutex_lock(&qmp->tx_lock);
237
238 /* The message RAM only implements 32-bit accesses */
239 __iowrite32_copy(qmp->msgram + qmp->offset + sizeof(u32),
240 buf, sizeof(buf) / sizeof(u32));
241 writel(sizeof(buf), qmp->msgram + qmp->offset);
242
243 /* Read back length to confirm data written in message RAM */
244 readl(qmp->msgram + qmp->offset);
245 qmp_kick(qmp);
246
247 time_left = wait_event_interruptible_timeout(qmp->event,
248 qmp_message_empty(qmp), HZ);
249 if (!time_left) {
250 dev_err(qmp->dev, "ucore did not ack channel\n");
251 ret = -ETIMEDOUT;
252
253 /* Clear message from buffer */
254 writel(0, qmp->msgram + qmp->offset);
255 } else {
256 ret = 0;
257 }
258
259 mutex_unlock(&qmp->tx_lock);
260
261 return ret;
262 }
263 EXPORT_SYMBOL(qmp_send);
264
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-01-10 0:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-08 12:50 drivers/soc/qcom/qcom_aoss.c:230:9: warning: function 'qmp_send' might be a candidate for 'gnu_printf' format attribute kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2024-01-10 0:28 kernel test robot
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.