Skip to content
  1. Oct 07, 2023
  2. Sep 27, 2023
    • 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
    • Hans Verkuil's avatar
      media: v4l2-dev.h: increase struct video_device name size · 9cc0f40c
      Hans Verkuil authored
      
      
      Increase the size of the name field to prevent a lot of
      string truncate compiler warnings.
      
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      9cc0f40c
    • Hans Verkuil's avatar
      media: zoran: increase name size · 3e80a889
      Hans Verkuil authored
      
      
      Fixes this compiler warning:
      
      drivers/media/pci/zoran/zoran_card.c: In function 'zoran_probe':
      drivers/media/pci/zoran/zoran_card.c:1316:62: warning: '%u' directive output may be truncated writing between 1 and 5 bytes into a region of size between 0 and 31 [-Wformat-truncation=]
       1316 |         snprintf(ZR_DEVNAME(zr), sizeof(ZR_DEVNAME(zr)), "%s[%u]",
            |                                                              ^~
      drivers/media/pci/zoran/zoran_card.c:1316:58: note: directive argument in the range [0, 65535]
       1316 |         snprintf(ZR_DEVNAME(zr), sizeof(ZR_DEVNAME(zr)), "%s[%u]",
            |                                                          ^~~~~~~~
      drivers/media/pci/zoran/zoran_card.c:1316:9: note: 'snprintf' output between 4 and 39 bytes into a destination of size 32
       1316 |         snprintf(ZR_DEVNAME(zr), sizeof(ZR_DEVNAME(zr)), "%s[%u]",
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       1317 |                  zr->card.name, zr->id);
            |                  ~~~~~~~~~~~~~~~~~~~~~~
      
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      3e80a889
    • Hans Verkuil's avatar
      media: renesas-ceu: keep input name simple · acec3a11
      Hans Verkuil authored
      
      
      Just show the Camera index as input name in VIDIOC_ENUM_INPUT,
      no need to show the subdev name as well as that is meaningless for
      users anyway.
      
      This fixes this compiler warning:
      
      drivers/media/platform/renesas/renesas-ceu.c: In function 'ceu_enum_input':
      drivers/media/platform/renesas/renesas-ceu.c:1195:59: warning: '%s' directive output may be truncated writing up to 47 bytes into a region of size between 14 and 23 [-Wformat-truncation=]
       1195 |         snprintf(inp->name, sizeof(inp->name), "Camera%u: %s",
            |                                                           ^~
      drivers/media/platform/renesas/renesas-ceu.c:1195:9: note: 'snprintf' output between 10 and 66 bytes into a destination of size 32
       1195 |         snprintf(inp->name, sizeof(inp->name), "Camera%u: %s",
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       1196 |                  inp->index, ceusd->v4l2_sd->name);
            |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Reviewed-by: default avatarJacopo Mondi <jacopo.mondi@ideasonboard.com>
      acec3a11
    • Hans Verkuil's avatar
      media: cec.h: increase input_phys buffer · 7ba5e7b7
      Hans Verkuil authored
      
      
      Fixes this compiler warning:
      
      drivers/media/cec/core/cec-core.c: In function 'cec_allocate_adapter':
      drivers/media/cec/core/cec-core.c:317:21: warning: '/input0' directive output may be truncated writing 7 bytes into a region of size between 1 and 32 [-Wformat-truncation=]
        317 |                  "%s/input0", adap->name);
            |                     ^~~~~~~
      drivers/media/cec/core/cec-core.c:316:9: note: 'snprintf' output between 8 and 39 bytes into a destination of size 32
        316 |         snprintf(adap->input_phys, sizeof(adap->input_phys),
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        317 |                  "%s/input0", adap->name);
            |                  ~~~~~~~~~~~~~~~~~~~~~~~~
      
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      7ba5e7b7
    • Hans Verkuil's avatar
      media: rc: ati_remote: increase mouse_name buffer size · b05aba9f
      Hans Verkuil authored
      
      
      Fixes this compiler warning:
      
      drivers/media/rc/ati_remote.c: In function 'ati_remote_probe':
      drivers/media/rc/ati_remote.c:876:21: warning: ' mouse' directive output may be truncated writing 6 bytes into a region of size between 1 and 80 [-Wformat-truncation=]
        876 |                  "%s mouse", ati_remote->rc_name);
            |                     ^~~~~~
      drivers/media/rc/ati_remote.c:875:9: note: 'snprintf' output between 7 and 86 bytes into a destination of size 80
        875 |         snprintf(ati_remote->mouse_name, sizeof(ati_remote->mouse_name),
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        876 |                  "%s mouse", ati_remote->rc_name);
            |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Reviewed-by: default avatarSean Young <sean@mess.org>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
      b05aba9f
    • Hans Verkuil's avatar
      media: cx18: increase in_workq_name size · 7c051b68
      Hans Verkuil authored
      
      
      Fixes this compiler warning:
      
      drivers/media/pci/cx18/cx18-driver.c: In function 'cx18_init_struct1':
      drivers/media/pci/cx18/cx18-driver.c:688:65: warning: '%s' directive output may be truncated writing up to 35 bytes into a region of size 11 [-Wformat-truncation=]
        688 |         snprintf(cx->in_workq_name, sizeof(cx->in_workq_name), "%s-in",
            |                                                                 ^~
      In function 'cx18_create_in_workq',
          inlined from 'cx18_init_struct1' at drivers/media/pci/cx18/cx18-driver.c:724:8:
      drivers/media/pci/cx18/cx18-driver.c:688:9: note: 'snprintf' output between 4 and 39 bytes into a destination of size 11
        688 |         snprintf(cx->in_workq_name, sizeof(cx->in_workq_name), "%s-in",
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        689 |                  cx->v4l2_dev.name);
            |                  ~~~~~~~~~~~~~~~~~~
      
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
      7c051b68
    • Hans Verkuil's avatar
      media: ipu-bridge: increase sensor_name size · 83d0d4cc
      Hans Verkuil authored
      
      
      Fixes this compiler warning:
      
      In file included from include/linux/property.h:14,
                       from include/linux/acpi.h:16,
                       from drivers/media/pci/intel/ipu-bridge.c:4:
      In function 'ipu_bridge_init_swnode_names',
          inlined from 'ipu_bridge_create_connection_swnodes' at drivers/media/pci/intel/ipu-bridge.c:445:2,
          inlined from 'ipu_bridge_connect_sensor' at drivers/media/pci/intel/ipu-bridge.c:656:3:
      include/linux/fwnode.h:81:49: warning: '%u' directive output may be truncated writing between 1 and 3 bytes into a region of size 2 [-Wformat-truncation=]
         81 | #define SWNODE_GRAPH_PORT_NAME_FMT              "port@%u"
            |                                                 ^~~~~~~~~
      drivers/media/pci/intel/ipu-bridge.c:384:18: note: in expansion of macro 'SWNODE_GRAPH_PORT_NAME_FMT'
        384 |                  SWNODE_GRAPH_PORT_NAME_FMT, sensor->link);
            |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~
      include/linux/fwnode.h: In function 'ipu_bridge_connect_sensor':
      include/linux/fwnode.h:81:55: note: format string is defined here
         81 | #define SWNODE_GRAPH_PORT_NAME_FMT              "port@%u"
            |                                                       ^~
      In function 'ipu_bridge_init_swnode_names',
          inlined from 'ipu_bridge_create_connection_swnodes' at drivers/media/pci/intel/ipu-bridge.c:445:2,
          inlined from 'ipu_bridge_connect_sensor' at drivers/media/pci/intel/ipu-bridge.c:656:3:
      include/linux/fwnode.h:81:49: note: directive argument in the range [0, 255]
         81 | #define SWNODE_GRAPH_PORT_NAME_FMT              "port@%u"
            |                                                 ^~~~~~~~~
      drivers/media/pci/intel/ipu-bridge.c:384:18: note: in expansion of macro 'SWNODE_GRAPH_PORT_NAME_FMT'
        384 |                  SWNODE_GRAPH_PORT_NAME_FMT, sensor->link);
            |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/media/pci/intel/ipu-bridge.c:382:9: note: 'snprintf' output between 7 and 9 bytes into a destination of size 7
        382 |         snprintf(sensor->node_names.remote_port,
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        383 |                  sizeof(sensor->node_names.remote_port),
            |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        384 |                  SWNODE_GRAPH_PORT_NAME_FMT, sensor->link);
            |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
      83d0d4cc
    • Hans Verkuil's avatar
      media: vivid: avoid integer overflow · 4567ebf8
      Hans Verkuil authored
      
      
      Fixes these compiler warnings:
      
      drivers/media/test-drivers/vivid/vivid-rds-gen.c: In function 'vivid_rds_gen_fill':
      drivers/media/test-drivers/vivid/vivid-rds-gen.c:147:56: warning: '.' directive output may be truncated writing 1 byte into a region of size between 0 and 3 [-Wformat-truncation=]
        147 |         snprintf(rds->psname, sizeof(rds->psname), "%6d.%1d",
            |                                                        ^
      drivers/media/test-drivers/vivid/vivid-rds-gen.c:147:52: note: directive argument in the range [0, 9]
        147 |         snprintf(rds->psname, sizeof(rds->psname), "%6d.%1d",
            |                                                    ^~~~~~~~~
      drivers/media/test-drivers/vivid/vivid-rds-gen.c:147:9: note: 'snprintf' output between 9 and 12 bytes into a destination of size 9
        147 |         snprintf(rds->psname, sizeof(rds->psname), "%6d.%1d",
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        148 |                  freq / 16, ((freq & 0xf) * 10) / 16);
            |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
      4567ebf8
    • Hans Verkuil's avatar
      media: atomisp: ia_ccs_debug.c: increase enable_info buffer · f55254c9
      Hans Verkuil authored
      
      
      Fixes these compiler warnings:
      
      drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c: In function 'ia_css_debug_pipe_graph_dump_stage':
      drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c:2786:66: warning: '\n' directive output may be truncated writing 2 bytes into a region of size between 0 and 198 [-Wformat-truncation=]
       2786 |                                                          "%s\\n%s\\n%s",
            |                                                                  ^~~
      drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c:2785:49: note: 'snprintf' output between 5 and 302 bytes into a destination of size 200
       2785 |                                                 snprintf(enable_info, sizeof(enable_info),
            |                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       2786 |                                                          "%s\\n%s\\n%s",
            |                                                          ~~~~~~~~~~~~~~~
       2787 |                                                          enable_info1, enable_info2,
            |                                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~
       2788 |                                                          enable_info3);
            |                                                          ~~~~~~~~~~~~~
      drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c:2772:66: warning: '\n' directive output may be truncated writing 2 bytes into a region of size between 0 and 198 [-Wformat-truncation=]
       2772 |                                                          "%s\\n%s\\n%s",
            |                                                                  ^~~
      drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c:2771:49: note: 'snprintf' output between 5 and 302 bytes into a destination of size 200
       2771 |                                                 snprintf(enable_info, sizeof(enable_info),
            |                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       2772 |                                                          "%s\\n%s\\n%s",
            |                                                          ~~~~~~~~~~~~~~~
       2773 |                                                          enable_info1, enable_info2,
            |                                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~
       2774 |                                                          enable_info3);
            |                                                          ~~~~~~~~~~~~~
      drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c:2749:92: warning: 'snprintf' output may be truncated before the last format character [-Wformat-truncation=]
       2749 |                                         snprintf(enable_info, sizeof(enable_info), "%s\\n%s",
            |                                                                                            ^
      drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c:2749:41: note: 'snprintf' output between 3 and 201 bytes into a destination of size 200
       2749 |                                         snprintf(enable_info, sizeof(enable_info), "%s\\n%s",
            |                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       2750 |                                                  enable_info1, enable_info2);
            |                                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
      f55254c9
    • Hans Verkuil's avatar
      media: cadence: increase buffer size in csi2tx_get_resources() · 94451182
      Hans Verkuil authored
      
      
      Fixes this compiler warning:
      
      drivers/media/platform/cadence/cdns-csi2tx.c: In function 'csi2tx_get_resources':
      drivers/media/platform/cadence/cdns-csi2tx.c:485:63: warning: '%u' directive output may be truncated writing between 1 and 10 bytes into a region of size 8 [-Wformat-truncation=]
        485 |                 snprintf(clk_name, sizeof(clk_name), "pixel_if%u_clk", i);
            |                                                               ^~
      drivers/media/platform/cadence/cdns-csi2tx.c:485:54: note: directive argument in the range [0, 4294967294]
        485 |                 snprintf(clk_name, sizeof(clk_name), "pixel_if%u_clk", i);
            |                                                      ^~~~~~~~~~~~~~~~
      drivers/media/platform/cadence/cdns-csi2tx.c:485:17: note: 'snprintf' output between 14 and 23 bytes into a destination of size 16
        485 |                 snprintf(clk_name, sizeof(clk_name), "pixel_if%u_clk", i);
            |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Acked-by: default avatarMaxime Ripard <mripard@kernel.org>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
      94451182
    • Hans Verkuil's avatar
      media: allegro-dvt: increase buffer size in msg_type_name() · 41c4c6fd
      Hans Verkuil authored
      
      
      Fixes this compile error
      
      drivers/media/platform/allegro-dvt/allegro-mail.c: In function 'msg_type_name':
      drivers/media/platform/allegro-dvt/allegro-mail.c:37:48: warning: '%04x' directive output may be truncated writing between 4 and 8 bytes into a region of size 6 [-Wformat-truncation=]
         37 |                 snprintf(buf, sizeof(buf), "(0x%04x)", type);
            |                                                ^~~~
      drivers/media/platform/allegro-dvt/allegro-mail.c:37:44: note: directive argument in the range [1, 4294967295]
         37 |                 snprintf(buf, sizeof(buf), "(0x%04x)", type);
            |                                            ^~~~~~~~~~
      drivers/media/platform/allegro-dvt/allegro-mail.c:37:17: note: 'snprintf' output between 9 and 13 bytes into a destination of size 9
         37 |                 snprintf(buf, sizeof(buf), "(0x%04x)", type);
            |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Reviewed-by: default avatarMichael Tretter <m.tretter@pengutronix.de>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
      41c4c6fd
    • Hans Verkuil's avatar
      media: atomisp: fix 'read beyond size of field' · 0301a15a
      Hans Verkuil authored
      
      
      If CONFIG_FORTIFY_SOURCE=y, then this warning is produced:
      
      In file included from ./include/linux/string.h:254,
                       from ./include/linux/bitmap.h:11,
                       from ./include/linux/cpumask.h:12,
                       from ./arch/x86/include/asm/cpumask.h:5,
                       from ./arch/x86/include/asm/msr.h:11,
                       from ./arch/x86/include/asm/processor.h:23,
                       from ./arch/x86/include/asm/cpufeature.h:5,
                       from ./arch/x86/include/asm/thread_info.h:53,
                       from ./include/linux/thread_info.h:60,
                       from ./arch/x86/include/asm/preempt.h:9,
                       from ./include/linux/preempt.h:79,
                       from ./include/linux/spinlock.h:56,
                       from ./include/linux/mmzone.h:8,
                       from ./include/linux/gfp.h:7,
                       from ./include/linux/slab.h:16,
                       from ./drivers/staging/media/atomisp//include/hmm/hmm.h:26,
                       from drivers/staging/media/atomisp/pci/sh_css_params.c:26:
      In function ‘fortify_memcpy_chk’,
          inlined from ‘sh_css_store_sp_group_to_ddr’ at drivers/staging/media/atomisp/pci/sh_css_params.c:3736:3:
      ./include/linux/fortify-string.h:592:25: warning: call to ‘__read_overflow2_field’ declared with attribute warning: detected read beyond size of field (2nd parameter); maybe use struct_group()?
      [-Wattribute-warning]
        592 |                         __read_overflow2_field(q_size_field, size);
            |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      The reason is that the memcpy copies two fields (each a u8), when the source
      pointer points to the first field. It's a bit unexpected, so just make this
      explicit.
      
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
      0301a15a
    • Hans de Goede's avatar
      media: atomisp: Drop atomisp-ov5693 sensor driver · a0bcd433
      Hans de Goede authored
      After recent improvements to atomisp driver, the atomisp driver
      now works fine with the standard ov5693 driver.
      
      Drop the no longer necessary atomisp specific atomisp-ov5693
      sensor driver.
      
      Link: https://lore.kernel.org/r/20230813152645.45834-2-hdegoede@redhat.com
      
      
      
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
      a0bcd433
    • Hans de Goede's avatar
      media: atomisp: Disable VCM for OV5693 for now · 18fa5714
      Hans de Goede authored
      ov5693 sensor modules have a VCM, but for unknown reasons
      the sensor fails to start streaming when instantiating
      a VCM i2c-client (and the runtime-pm link between VCM
      and sensor).
      
      Disable the VCM for now, until this is resolved.
      
      Link: https://lore.kernel.org/r/20230813152645.45834-1-hdegoede@redhat.com
      
      
      
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
      18fa5714
    • Hans de Goede's avatar
      media: atomisp: gc0310: Stop setting v4l2_subdev.fwnode to the endpoint fwnode · 2b5a90f0
      Hans de Goede authored
      Endpoint matching is now handled by the v4l2-core and drivers no longer
      should set v4l2_subdev.fwnode to the endpoint fwnode.
      
      Link: https://lore.kernel.org/r/20230812133628.355812-1-hdegoede@redhat.com
      
      
      
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
      2b5a90f0
    • Hans de Goede's avatar
      media: atomisp: Drop VIDEO_ATOMISP_ISP2401 Kconfig option · 61d6b350
      Hans de Goede authored
      Drop the VIDEO_ATOMISP_ISP2401 Kconfig option and the -DISP2401
      cflags.
      
      This is no longer necessary since all ISP2400 vs ISP2401 differences
      are now dealt with at runtime.
      
      Many thanks to Kate Hsuan for all her work on this.
      
      Link: https://lore.kernel.org/r/20230812133523.355581-2-hdegoede@redhat.com
      
      
      
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
      61d6b350