diff mbox series

[PATCHv2,15/23] media: vivid: use VIVID_MODULE_NAME to fill bus_info

Message ID 20230923152107.283289-16-hverkuil-cisco@xs4all.nl (mailing list archive)
State New, archived
Headers show
Series media: fix all string truncate warnings | expand

Commit Message

Hans Verkuil Sept. 23, 2023, 3:20 p.m. UTC
Fixes this compiler warning:

drivers/media/test-drivers/vivid/vivid-core.c: In function 'vidioc_querycap':
drivers/media/test-drivers/vivid/vivid-core.c:243:35: warning: '%s' directive output may be truncated writing up to 35 bytes into a region of size 23 [-Wformat-truncation=]
  243 |                         "platform:%s", dev->v4l2_dev.name);
      |                                   ^~
drivers/media/test-drivers/vivid/vivid-core.c:242:9: note: 'snprintf' output between 10 and 45 bytes into a destination of size 32
  242 |         snprintf(cap->bus_info, sizeof(cap->bus_info),
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  243 |                         "platform:%s", dev->v4l2_dev.name);
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
---
 drivers/media/test-drivers/vivid/vivid-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/media/test-drivers/vivid/vivid-core.c b/drivers/media/test-drivers/vivid/vivid-core.c
index e95bdccfc18e..394c9f81ea72 100644
--- a/drivers/media/test-drivers/vivid/vivid-core.c
+++ b/drivers/media/test-drivers/vivid/vivid-core.c
@@ -240,7 +240,7 @@  static int vidioc_querycap(struct file *file, void  *priv,
 	strscpy(cap->driver, "vivid", sizeof(cap->driver));
 	strscpy(cap->card, "vivid", sizeof(cap->card));
 	snprintf(cap->bus_info, sizeof(cap->bus_info),
-			"platform:%s", dev->v4l2_dev.name);
+		 "platform:%s-%03d", VIVID_MODULE_NAME, dev->inst);
 
 	cap->capabilities = dev->vid_cap_caps | dev->vid_out_caps |
 		dev->vbi_cap_caps | dev->vbi_out_caps |