1. 07 Oct, 2023 28 commits
  2. 27 Sep, 2023 12 commits
    • Hans Verkuil's avatar
      media: radio-si476x: don't fill in bus_info · fd6627cb
      Hans Verkuil authored
      Let the V4L2 core fill in bus_info.
      
      This fixes this warning:
      
      drivers/media/radio/radio-si476x.c: In function 'si476x_radio_querycap':
      drivers/media/radio/radio-si476x.c:333:28: warning: '%s' directive output may be truncated writing up to 35 bytes into a region of size 23 [-Wformat-truncation=]
        333 |                  "platform:%s", radio->v4l2dev.name);
            |                            ^~
      drivers/media/radio/radio-si476x.c:332:9: note: 'snprintf' output between 10 and 45 bytes into a destination of size 32
        332 |         snprintf(capability->bus_info, sizeof(capability->bus_info),
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        333 |                  "platform:%s", radio->v4l2dev.name);
            |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      fd6627cb
    • Hans Verkuil's avatar
      media: verisilicon: replace snprintf with strscpy+strlcat · b66215e7
      Hans Verkuil authored
      Fixes this warning:
      
      drivers/media/platform/verisilicon/hantro_drv.c: In function 'hantro_add_func':
      drivers/media/platform/verisilicon/hantro_drv.c:902:49: warning: '%s' directive output may be truncated writing up to 127 bytes into a region of size 64 [-Wformat-truncation=]
        902 |         snprintf(vfd->name, sizeof(vfd->name), "%s-%s", match->compatible,
            |                                                 ^~
      drivers/media/platform/verisilicon/hantro_drv.c:902:9: note: 'snprintf' output between 5 and 132 bytes into a destination of size 64
        902 |         snprintf(vfd->name, sizeof(vfd->name), "%s-%s", match->compatible,
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        903 |                  funcid == MEDIA_ENT_F_PROC_VIDEO_ENCODER ? "enc" : "dec");
            |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/media/platform/verisilicon/hantro_drv.c:902:49: warning: '%s' directive output may be truncated writing up to 127 bytes into a region of size 64 [-Wformat-truncation=]
        902 |         snprintf(vfd->name, sizeof(vfd->name), "%s-%s", match->compatible,
            |                                                 ^~
      drivers/media/platform/verisilicon/hantro_drv.c:902:9: note: 'snprintf' output between 5 and 132 bytes into a destination of size 64
        902 |         snprintf(vfd->name, sizeof(vfd->name), "%s-%s", match->compatible,
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        903 |                  funcid == MEDIA_ENT_F_PROC_VIDEO_ENCODER ? "enc" : "dec");
            |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      b66215e7
    • Hans Verkuil's avatar
      media: radio-miropcm20: set bus_info to explicit name · b74093bf
      Hans Verkuil authored
      Fill in bus_info with fixed name.
      
      This fixes this compiler warning:
      
      drivers/media/radio/radio-miropcm20.c: In function 'vidioc_querycap':
      drivers/media/radio/radio-miropcm20.c:206:57: warning: '%s' directive output may be truncated writing up to 35 bytes into a region of size 28 [-Wformat-truncation=]
        206 |         snprintf(v->bus_info, sizeof(v->bus_info), "ISA:%s", dev->v4l2_dev.name);
            |                                                         ^~
      drivers/media/radio/radio-miropcm20.c:206:9: note: 'snprintf' output between 5 and 40 bytes into a destination of size 32
        206 |         snprintf(v->bus_info, sizeof(v->bus_info), "ISA:%s", dev->v4l2_dev.name);
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      b74093bf
    • Hans Verkuil's avatar
      media: radio-isa: use dev_name to fill in bus_info · 8b7f3cf4
      Hans Verkuil authored
      This fixes this warning:
      
      drivers/media/radio/radio-isa.c: In function 'radio_isa_querycap':
      drivers/media/radio/radio-isa.c:39:57: warning: '%s' directive output may be truncated writing up to 35 bytes into a region of size 28 [-Wformat-truncation=]
         39 |         snprintf(v->bus_info, sizeof(v->bus_info), "ISA:%s", isa->v4l2_dev.name);
            |                                                         ^~
      drivers/media/radio/radio-isa.c:39:9: note: 'snprintf' output between 5 and 40 bytes into a destination of size 32
         39 |         snprintf(v->bus_info, sizeof(v->bus_info), "ISA:%s", isa->v4l2_dev.name);
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      8b7f3cf4
    • Hans Verkuil's avatar
      media: atmel: drop bus_info · 127299a4
      Hans Verkuil authored
      Let the V4L2 core fill this in.
      
      Fixes this warning:
      
      drivers/staging/media/deprecated/atmel/atmel-isc-base.c: In function 'isc_querycap':
      drivers/staging/media/deprecated/atmel/atmel-isc-base.c:496:28: warning: '%s' directive output may be truncated writing up to 35 bytes into a region of size 23 [-Wformat-truncation=]
        496 |                  "platform:%s", isc->v4l2_dev.name);
            |                            ^~
      drivers/staging/media/deprecated/atmel/atmel-isc-base.c:495:9: note: 'snprintf' output between 10 and 45 bytes into a destination of size 32
        495 |         snprintf(cap->bus_info, sizeof(cap->bus_info),
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        496 |                  "platform:%s", isc->v4l2_dev.name);
            |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Acked-by: default avatarNicolas Ferre <nicolas.ferre@microchip.com>
      127299a4
    • Hans Verkuil's avatar
      media: am437x: don't fill in bus_info · bd6ef410
      Hans Verkuil authored
      Let the V4L2 core fill this in.
      
      This fixes this warning:
      
      drivers/media/platform/ti/am437x/am437x-vpfe.c: In function 'vpfe_querycap':
      drivers/media/platform/ti/am437x/am437x-vpfe.c:1279:35: warning: '%s' directive output may be truncated writing up to 35 bytes into a region of size 23 [-Wformat-truncation=]
       1279 |                         "platform:%s", vpfe->v4l2_dev.name);
            |                                   ^~
      drivers/media/platform/ti/am437x/am437x-vpfe.c:1278:9: note: 'snprintf' output between 10 and 45 bytes into a destination of size 32
       1278 |         snprintf(cap->bus_info, sizeof(cap->bus_info),
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       1279 |                         "platform:%s", vpfe->v4l2_dev.name);
            |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Reviewed-by: default avatarLad Prabhakar <prabhakar.csengg@gmail.com>
      bd6ef410
    • Hans Verkuil's avatar
      media: rcar_drif: use explicit name for bus_info · 37272d21
      Hans Verkuil authored
      Fixes this compiler warning:
      
      drivers/media/platform/renesas/rcar_drif.c: In function 'rcar_drif_querycap':
      drivers/media/platform/renesas/rcar_drif.c:874:66: warning: '%s' directive output may be truncated writing up to 63 bytes into a region of size 23 [-Wformat-truncation=]
        874 |         snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
            |                                                                  ^~
      drivers/media/platform/renesas/rcar_drif.c:874:9: note: 'snprintf' output between 10 and 73 bytes into a destination of size 32
        874 |         snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        875 |                  sdr->vdev->name);
            |                  ~~~~~~~~~~~~~~~~
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      37272d21
    • Hans Verkuil's avatar
      media: microchip: don't set bus_info · 4ebdec2a
      Hans Verkuil authored
      Let the V4L2 core fill this in.
      
      Fixes these compiler warnings:
      
      drivers/media/platform/microchip/microchip-isc-base.c: In function 'isc_querycap':
      drivers/media/platform/microchip/microchip-isc-base.c:486:28: warning: '%s' directive output may be truncated writing up to 35 bytes into a region of size 23 [-Wformat-truncation=]
        486 |                  "platform:%s", isc->v4l2_dev.name);
            |                            ^~
      drivers/media/platform/microchip/microchip-isc-base.c:485:9: note: 'snprintf' output between 10 and 45 bytes into a destination of size 32
        485 |         snprintf(cap->bus_info, sizeof(cap->bus_info),
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        486 |                  "platform:%s", isc->v4l2_dev.name);
            |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/media/platform/microchip/microchip-isc-base.c: In function 'isc_mc_init':
      drivers/media/platform/microchip/microchip-isc-base.c:1996:76: warning: '%s' directive output may be truncated writing up to 35 bytes into a region of size 23 [-Wformat-truncation=]
       1996 |         snprintf(isc->mdev.bus_info, sizeof(isc->mdev.bus_info), "platform:%s",
            |                                                                            ^~
      drivers/media/platform/microchip/microchip-isc-base.c:1996:9: note: 'snprintf' output between 10 and 45 bytes into a destination of size 32
       1996 |         snprintf(isc->mdev.bus_info, sizeof(isc->mdev.bus_info), "platform:%s",
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       1997 |                  isc->v4l2_dev.name);
            |                  ~~~~~~~~~~~~~~~~~~~
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Acked-by: default avatarNicolas Ferre <nicolas.ferre@microchip.com>
      4ebdec2a
    • Hans Verkuil's avatar
      media: vivid: use VIVID_MODULE_NAME to fill bus_info · 10939357
      Hans Verkuil authored
      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: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      10939357
    • Hans Verkuil's avatar
      media: v4l2-device.h: drop V4L2_DEVICE_NAME_SIZE · 06016a67
      Hans Verkuil authored
      Don't use defines for the size of a name field, everyone
      should just use sizeof(). In this case it was never used,
      but it is bad practice, so just drop it.
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      06016a67
    • Hans Verkuil's avatar
      media: use sizeof() instead of V4L2_SUBDEV_NAME_SIZE · 8cdd708f
      Hans Verkuil authored
      Don't rely on a define, let the compiler use the actual
      field size.
      
      Remove all uses of the V4L2_SUBDEV_NAME_SIZE define and also
      drop the define itself.
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
      Reviewed-by: default avatarNiklas Söderlund <niklas.soderlund@ragnatech.se>
      Reviewed-by: default avatarMaxime Ripard <mripard@kernel.org>
      Reviewed-by: default avatarLuca Ceresoli <luca.ceresoli@bootlin.com>
      Tested-by: default avatarLuca Ceresoli <luca.ceresoli@bootlin.com>
      8cdd708f
    • Hans Verkuil's avatar
      media: v4l2-subdev.h: increase struct v4l2_subdev name size · d9d432af
      Hans Verkuil authored
      This resolves a lot of the string truncate compiler warnings.
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      d9d432af