Commit Graph

1216013 Commits

Author SHA1 Message Date
Hans Verkuil
8b7f3cf4eb media: radio-isa: use dev_name to fill in bus_info
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: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2023-09-27 10:47:23 +02:00
Hans Verkuil
127299a41c media: atmel: drop bus_info
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: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
2023-09-27 10:47:23 +02:00
Hans Verkuil
bd6ef41067 media: am437x: don't fill in bus_info
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: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Lad Prabhakar <prabhakar.csengg@gmail.com>
2023-09-27 10:47:23 +02:00
Hans Verkuil
37272d21ce media: rcar_drif: use explicit name for bus_info
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: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2023-09-27 10:47:23 +02:00
Hans Verkuil
4ebdec2aee media: microchip: don't set bus_info
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: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
2023-09-27 10:47:23 +02:00
Hans Verkuil
10939357c4 media: vivid: use VIVID_MODULE_NAME to fill bus_info
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>
2023-09-27 10:47:23 +02:00
Hans Verkuil
06016a67c6 media: v4l2-device.h: drop V4L2_DEVICE_NAME_SIZE
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: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2023-09-27 10:47:23 +02:00
Hans Verkuil
8cdd708f11 media: use sizeof() instead of V4L2_SUBDEV_NAME_SIZE
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: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Tested-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
2023-09-27 10:47:22 +02:00
Hans Verkuil
d9d432af14 media: v4l2-subdev.h: increase struct v4l2_subdev name size
This resolves a lot of the string truncate compiler warnings.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2023-09-27 10:47:22 +02:00
Hans Verkuil
9cc0f40cac media: v4l2-dev.h: increase struct video_device name size
Increase the size of the name field to prevent a lot of
string truncate compiler warnings.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2023-09-27 10:47:22 +02:00
Hans Verkuil
3e80a88911 media: zoran: increase name size
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: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2023-09-27 10:47:22 +02:00
Hans Verkuil
acec3a11c3 media: renesas-ceu: keep input name simple
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: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
2023-09-27 10:47:22 +02:00
Hans Verkuil
7ba5e7b78b media: cec.h: increase input_phys buffer
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: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2023-09-27 10:47:22 +02:00
Hans Verkuil
b05aba9fff media: rc: ati_remote: increase mouse_name buffer size
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: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Sean Young <sean@mess.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
2023-09-27 10:47:22 +02:00
Hans Verkuil
7c051b6800 media: cx18: increase in_workq_name size
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: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Arnd Bergmann <arnd@arndb.de>
2023-09-27 10:47:22 +02:00
Hans Verkuil
83d0d4cc14 media: ipu-bridge: increase sensor_name size
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: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Arnd Bergmann <arnd@arndb.de>
2023-09-27 10:47:22 +02:00
Hans Verkuil
4567ebf8e8 media: vivid: avoid integer overflow
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: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Arnd Bergmann <arnd@arndb.de>
2023-09-27 10:47:22 +02:00
Hans Verkuil
f55254c96a media: atomisp: ia_ccs_debug.c: increase enable_info buffer
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: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
2023-09-27 10:47:22 +02:00
Hans Verkuil
9445118216 media: cadence: increase buffer size in csi2tx_get_resources()
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: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Maxime Ripard <mripard@kernel.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
2023-09-27 10:47:22 +02:00
Hans Verkuil
41c4c6fd81 media: allegro-dvt: increase buffer size in msg_type_name()
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: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
2023-09-27 10:47:22 +02:00
Hans Verkuil
0301a15a42 media: atomisp: fix 'read beyond size of field'
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: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2023-09-27 10:47:22 +02:00
Hans de Goede
a0bcd433b9 media: atomisp: Drop atomisp-ov5693 sensor driver
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: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27 09:40:04 +02:00
Hans de Goede
18fa57148a media: atomisp: Disable VCM for OV5693 for now
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: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27 09:40:04 +02:00
Hans de Goede
2b5a90f08c media: atomisp: gc0310: Stop setting v4l2_subdev.fwnode to the endpoint fwnode
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: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27 09:40:04 +02:00
Hans de Goede
61d6b3503c media: atomisp: Drop VIDEO_ATOMISP_ISP2401 Kconfig option
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: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27 09:40:04 +02:00
Hans de Goede
00c408775a media: atomisp: Drop ia_css_debug_dump_debug_info() and functions only used by it
ia_css_debug_dump_debug_info() is defined but never called anywhere,
drop it.

Also drop all the other ia_css_debug_dump_* functions only called by
ia_css_debug_dump_debug_info(), as well as *_get_state() functions only
used by those.

Link: https://lore.kernel.org/r/20230812133523.355581-1-hdegoede@redhat.com

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27 09:40:04 +02:00
Hans de Goede
42c26b4cd1 media: atomisp: Simplify some if (IS_ISP2401...) statements
Replace:

 if (!IS_ISP2401 || (IS_ISP2401 && xxx))

with:

 if (!IS_ISP2401 || xxx)

If the right side of the '||' needs to be evaluated then it is
already known that IS_ISP2401 is true, so no need to check for it.

Link: https://lore.kernel.org/r/20230812104612.38806-1-hdegoede@redhat.com

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27 09:40:04 +02:00
Kate Hsuan
65214188ca media: atomisp: atomisp_v4l2: Removed unnecessary code
Here is the last step of #ifdef ISP2401 removal work. Since the driver
became generic, this part of the code was no longer needed and can
be removed.

Link: https://lore.kernel.org/r/20230802095606.1298152-13-hpa@redhat.com

Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27 09:40:04 +02:00
Kate Hsuan
ec1f9f15a9 media: atomisp: sh_css: Removed #ifdef ISP2401 to make the driver generic
Removed #ifdef ISP2401 to make the driver generic.

Link: https://lore.kernel.org/r/20230802095606.1298152-12-hpa@redhat.com

Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27 09:40:04 +02:00
Kate Hsuan
113401c673 media: atomisp: sh_css: Removed #ifdef ISP2401 to make code generic
Removed #ifdef ISP2401 to allow the destroy function can destroy the
data of both types of ISP.

Link: https://lore.kernel.org/r/20230802095606.1298152-11-hpa@redhat.com

Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27 09:40:04 +02:00
Kate Hsuan
ad69794770 media: atomisp: sh_css: Renamed sh_css_config_input_network()
sh_css_config_input_network() is renamed to
sh_css_config_input_network_2400() and sh_css_config_input_network_2401()
since a generic driver should cover the implementation for both types.

Link: https://lore.kernel.org/r/20230802095606.1298152-10-hpa@redhat.com

Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27 09:40:04 +02:00
Kate Hsuan
ade6b4c2b8 media: atomisp: sh_css: Removed #ifdef ISP2401 to make driver generic
Removed #ifdef ISP2401 to expose ia_css_stream_configure_rx() for ISP2400.

Link: https://lore.kernel.org/r/20230802095606.1298152-9-hpa@redhat.com

Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27 09:40:04 +02:00
Kate Hsuan
d1f3bed602 media: atomisp: sh_css_sp: Remove #ifdef ISP2401 to make driver generic
Removed #ifdef ISP2401 to make the driver generic. The uncessary codes
were removed and the types of the ISP is determines in runtime.

Link: https://lore.kernel.org/r/20230802095606.1298152-8-hpa@redhat.com

Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27 09:40:04 +02:00
Kate Hsuan
1e1ea859e4 media: atomisp: sh_css: Removed #ifdef ISP2401 to make the driver generic
Removed #ifdef ISP2401 to expose the necessary functions for ISP2401 and
also make the driver generic.

Link: https://lore.kernel.org/r/20230802095606.1298152-7-hpa@redhat.com

Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27 09:40:04 +02:00
Kate Hsuan
fc280df3aa media: atomisp: sh_css_mipi: Removed unused code ia_css_mipi_frame_enable_check_on_size()
ia_css_mipi_frame_enable_check_on_size() wasn't used by any functions.
So, it can be removed.

Link: https://lore.kernel.org/r/20230802095606.1298152-6-hpa@redhat.com

Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27 09:40:04 +02:00
Kate Hsuan
fdd9681f7e media: atomisp: atomisp_compat_css20: Removed #ifdef ISP2401 to make driver generic
Removed #ifdef ISP2401 to make code to be generic. The driver flow is
determined in runtime.

Link: https://lore.kernel.org/r/20230802095606.1298152-5-hpa@redhat.com

Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27 09:40:03 +02:00
Kate Hsuan
7d5901b49c media: atomisp: hive_isp_css_include: Removed #ifdef ISP2401 to make driver generic
Removed #ifdef ISP2401 to make the driver generic.

Link: https://lore.kernel.org/r/20230802095606.1298152-4-hpa@redhat.com

Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27 09:40:03 +02:00
Kate Hsuan
2b5d1e149e media: atomisp: binary: Removed #ifdef ISP2401 to make driver generic
Removed #ifdef ISP2401 to make the driver generic. The driver flow is
determined in runtime.

Link: https://lore.kernel.org/r/20230802095606.1298152-3-hpa@redhat.com

Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27 09:40:03 +02:00
Kate Hsuan
68b9a816ca media: atomisp: ia_css_raw.host: Remove #ifdef ISP2401 to make the driver generic
Remove #ifdef from the code and made the code generic. The raw image
configuration was determined during runtime.

Link: https://lore.kernel.org/r/20230802095606.1298152-2-hpa@redhat.com

Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27 09:40:03 +02:00
Hans de Goede
b6e5978323 media: atomisp: Mark ia_css_isys_240?_init() static
ia_css_isys_240?_init() are only used inside the C file where they are
declared, mark them as static fixing:

drivers/staging/media/atomisp/pci/runtime/isys/src/isys_init.c:24:20:
   warning: no previous prototype for 'ia_css_isys_2400_init'
   24 | input_system_err_t ia_css_isys_2400_init(void)
      |                    ^~~~~~~~~~~~~~~~~~~~~
drivers/staging/media/atomisp/pci/runtime/isys/src/isys_init.c:87:20:
   warning: no previous prototype for 'ia_css_isys_2401_init'
   87 | input_system_err_t ia_css_isys_2401_init(void)
      |                    ^~~~~~~~~~~~~~~~~~~~~

Closes: https://lore.kernel.org/oe-kbuild-all/202307152046.rvhFGrbz-lkp@intel.com/
Link: https://lore.kernel.org/r/20230715170906.3627-3-hdegoede@redhat.com

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27 09:40:03 +02:00
Hans de Goede
983993cb82 media: atomisp: Remove aliases for MIPI_FORMAT_2400_CUSTOM0
isp2400_input_system_local.h defines 2 aliases for MIPI_FORMAT_2400_CUSTOM0
MIPI_FORMAT_JPEG, which is entirely unused and MIPI_FORMAT_BINARY_8 which
is used once in ia_css_isys_2400_set_fmt_type().

Drop these aliases and directly use MIPI_FORMAT_2400_CUSTOM0 in
ia_css_isys_2400_set_fmt_type().

Link: https://lore.kernel.org/r/20230715170906.3627-2-hdegoede@redhat.com

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27 09:40:03 +02:00
Hans de Goede
b70fbcd650 media: atomisp: Remove empty isys_public.h
isys_public.h is empty, remove it.

Link: https://lore.kernel.org/r/20230715170906.3627-1-hdegoede@redhat.com

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27 09:40:03 +02:00
Kate Hsuan
16fb1d5b2b media: atomisp: isys_init: Initiate atomisp in a generic manner
The original implementation distinguishes and initiates atomisp during
compiler time. This commit allows isys_init to initiate isys for both types
of atomisp in a generic manner.

Link: https://lore.kernel.org/r/20230713100231.308923-12-hpa@redhat.com

Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27 09:40:03 +02:00
Kate Hsuan
0df4319c55 media: atomisp: rx: Removed #if defined(ISP2401) to make driver generic
The conflicts of variable declarations were resolved through previous
commits so the #if defined(ISP2401) can be removed.

Link: https://lore.kernel.org/r/20230713100231.308923-11-hpa@redhat.com

Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27 09:40:03 +02:00
Kate Hsuan
feae4208b4 media: atomisp: Compile the object codes for a generic driver
Since a generic driver should support every type of atomisp, all the
codes need to be compiled. The ISP2401 flag controls the Makefile to build
the binary file for ISP2400 and ISP2401. Therefore, this section of
Makefile should be removed allowing all the necessary codes can be built.
Moreover, some parts of "removing #ifdef ISP2401" works are related to it
so they were also removed here.

Link: https://lore.kernel.org/r/20230713100231.308923-10-hpa@redhat.com

Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27 09:40:03 +02:00
Kate Hsuan
f6675353fe media: atomisp: ifmtr: Removed #if defined(ISP2401) to make driver generic
Removed #if defined(ISP2401) to make driver generic.

Link: https://lore.kernel.org/r/20230713100231.308923-9-hpa@redhat.com

Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27 09:40:03 +02:00
Kate Hsuan
404af81df6 media: atomisp: pipeline: Removed #if defined(ISP2401) to make driver generic
Removed #if defined(ISP2401) to make driver generic.

Link: https://lore.kernel.org/r/20230713100231.308923-8-hpa@redhat.com

Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27 09:40:03 +02:00
Kate Hsuan
58e6d7d80b media: atomisp: hive_isp_css_common: Removed #if defined(ISP2401) to make driver generic
Removed #if defined(ISP2401) to make code generic.

Link: https://lore.kernel.org/r/20230713100231.308923-7-hpa@redhat.com

Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27 09:40:03 +02:00
Kate Hsuan
db401104fa media: atomisp: isys: Removed #if defined(ISP2401) to make driver generic
Removed #if defined(ISP2401) to make code generic.

Link: https://lore.kernel.org/r/20230713100231.308923-6-hpa@redhat.com

Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27 09:40:03 +02:00
Kate Hsuan
7ed0c6c069 media: atomisp: css_2401_system: Remove #ifdef ISP2401 to make the driver generic
Removed #if defined(2401) to make the driver generic.

Link: https://lore.kernel.org/r/20230713100231.308923-5-hpa@redhat.com

Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27 09:40:03 +02:00