From patchwork Sat Sep 23 15:20:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 13396814 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0EBF3CE7A88 for ; Sat, 23 Sep 2023 15:21:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231849AbjIWPVV (ORCPT ); Sat, 23 Sep 2023 11:21:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231684AbjIWPVU (ORCPT ); Sat, 23 Sep 2023 11:21:20 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D8AD192 for ; Sat, 23 Sep 2023 08:21:13 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3387C433C9; Sat, 23 Sep 2023 15:21:10 +0000 (UTC) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Arnd Bergmann , Hans Verkuil , Michael Tretter , Arnd Bergmann Subject: [PATCHv2 01/23] media: allegro-dvt: increase buffer size in msg_type_name() Date: Sat, 23 Sep 2023 17:20:45 +0200 Message-Id: <20230923152107.283289-2-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> References: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 Reviewed-by: Michael Tretter Acked-by: Arnd Bergmann --- drivers/media/platform/allegro-dvt/allegro-mail.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/allegro-dvt/allegro-mail.c b/drivers/media/platform/allegro-dvt/allegro-mail.c index 16effad10746..aadc947a77ae 100644 --- a/drivers/media/platform/allegro-dvt/allegro-mail.c +++ b/drivers/media/platform/allegro-dvt/allegro-mail.c @@ -16,7 +16,7 @@ const char *msg_type_name(enum mcu_msg_type type) { - static char buf[9]; + static char buf[13]; switch (type) { case MCU_MSG_TYPE_INIT: From patchwork Sat Sep 23 15:20:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 13396816 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E89B8CE7A8C for ; Sat, 23 Sep 2023 15:21:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231878AbjIWPVW (ORCPT ); Sat, 23 Sep 2023 11:21:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231815AbjIWPVU (ORCPT ); Sat, 23 Sep 2023 11:21:20 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1DBA194 for ; Sat, 23 Sep 2023 08:21:13 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A100C433C8; Sat, 23 Sep 2023 15:21:12 +0000 (UTC) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Arnd Bergmann , Hans Verkuil , Maxime Ripard , Arnd Bergmann Subject: [PATCHv2 02/23] media: cadence: increase buffer size in csi2tx_get_resources() Date: Sat, 23 Sep 2023 17:20:46 +0200 Message-Id: <20230923152107.283289-3-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> References: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 Acked-by: Maxime Ripard Acked-by: Arnd Bergmann --- drivers/media/platform/cadence/cdns-csi2tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/cadence/cdns-csi2tx.c b/drivers/media/platform/cadence/cdns-csi2tx.c index 1e0400b7803e..cbbb77520112 100644 --- a/drivers/media/platform/cadence/cdns-csi2tx.c +++ b/drivers/media/platform/cadence/cdns-csi2tx.c @@ -480,7 +480,7 @@ static int csi2tx_get_resources(struct csi2tx_priv *csi2tx, csi2tx->has_internal_dphy = !!(dev_cfg & CSI2TX_DEVICE_CONFIG_HAS_DPHY); for (i = 0; i < csi2tx->max_streams; i++) { - char clk_name[16]; + char clk_name[23]; snprintf(clk_name, sizeof(clk_name), "pixel_if%u_clk", i); csi2tx->pixel_clk[i] = devm_clk_get(&pdev->dev, clk_name); From patchwork Sat Sep 23 15:20:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 13396817 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17EF4CE7A8E for ; Sat, 23 Sep 2023 15:21:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231890AbjIWPVY (ORCPT ); Sat, 23 Sep 2023 11:21:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231853AbjIWPVV (ORCPT ); Sat, 23 Sep 2023 11:21:21 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6ECE9196 for ; Sat, 23 Sep 2023 08:21:15 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 00B81C433CA; Sat, 23 Sep 2023 15:21:13 +0000 (UTC) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Arnd Bergmann , Hans Verkuil , Hans de Goede , Arnd Bergmann Subject: [PATCHv2 03/23] media: atomisp: ia_ccs_debug.c: increase enable_info buffer Date: Sat, 23 Sep 2023 17:20:47 +0200 Message-Id: <20230923152107.283289-4-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> References: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 Reviewed-by: Hans de Goede Acked-by: Arnd Bergmann --- .../staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c b/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c index bb6204cb42c5..8b0251073f93 100644 --- a/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c +++ b/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c @@ -2673,7 +2673,7 @@ ia_css_debug_pipe_graph_dump_stage( char enable_info1[100]; char enable_info2[100]; char enable_info3[100]; - char enable_info[200]; + char enable_info[302]; struct ia_css_binary_info *bi = stage->binary_info; /* Split it in 2 function-calls to keep the amount of From patchwork Sat Sep 23 15:20:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 13396818 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D849ECE7A88 for ; Sat, 23 Sep 2023 15:21:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231906AbjIWPVZ (ORCPT ); Sat, 23 Sep 2023 11:21:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231874AbjIWPVW (ORCPT ); Sat, 23 Sep 2023 11:21:22 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCA3A192 for ; Sat, 23 Sep 2023 08:21:16 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A0FFC433C9; Sat, 23 Sep 2023 15:21:15 +0000 (UTC) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Arnd Bergmann , Hans Verkuil , Arnd Bergmann Subject: [PATCHv2 04/23] media: vivid: avoid integer overflow Date: Sat, 23 Sep 2023 17:20:48 +0200 Message-Id: <20230923152107.283289-5-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> References: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 Acked-by: Arnd Bergmann --- drivers/media/test-drivers/vivid/vivid-rds-gen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/test-drivers/vivid/vivid-rds-gen.c b/drivers/media/test-drivers/vivid/vivid-rds-gen.c index b5b104ee64c9..c57771119a34 100644 --- a/drivers/media/test-drivers/vivid/vivid-rds-gen.c +++ b/drivers/media/test-drivers/vivid/vivid-rds-gen.c @@ -145,7 +145,7 @@ void vivid_rds_gen_fill(struct vivid_rds_gen *rds, unsigned freq, rds->ta = alt; rds->ms = true; snprintf(rds->psname, sizeof(rds->psname), "%6d.%1d", - freq / 16, ((freq & 0xf) * 10) / 16); + (freq / 16) % 1000000, (((freq & 0xf) * 10) / 16) % 10); if (alt) strscpy(rds->radiotext, " The Radio Data System can switch between different Radio Texts ", From patchwork Sat Sep 23 15:20:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 13396819 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8124CCE7A89 for ; Sat, 23 Sep 2023 15:21:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231928AbjIWPVZ (ORCPT ); Sat, 23 Sep 2023 11:21:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231880AbjIWPVX (ORCPT ); Sat, 23 Sep 2023 11:21:23 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17C47192 for ; Sat, 23 Sep 2023 08:21:18 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CAD8DC433C8; Sat, 23 Sep 2023 15:21:16 +0000 (UTC) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Arnd Bergmann , Hans Verkuil , Arnd Bergmann Subject: [PATCHv2 05/23] media: ipu-bridge: increase sensor_name size Date: Sat, 23 Sep 2023 17:20:49 +0200 Message-Id: <20230923152107.283289-6-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> References: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 Acked-by: Arnd Bergmann --- include/media/ipu-bridge.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/media/ipu-bridge.h b/include/media/ipu-bridge.h index bdc654a45521..783bda6d5cc3 100644 --- a/include/media/ipu-bridge.h +++ b/include/media/ipu-bridge.h @@ -108,7 +108,7 @@ struct ipu_node_names { char ivsc_sensor_port[7]; char ivsc_ipu_port[7]; char endpoint[11]; - char remote_port[7]; + char remote_port[9]; char vcm[16]; }; From patchwork Sat Sep 23 15:20:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 13396820 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4CCDACE7A8F for ; Sat, 23 Sep 2023 15:21:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231934AbjIWPV0 (ORCPT ); Sat, 23 Sep 2023 11:21:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231908AbjIWPVZ (ORCPT ); Sat, 23 Sep 2023 11:21:25 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D8A3192 for ; Sat, 23 Sep 2023 08:21:19 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27A5CC433D9; Sat, 23 Sep 2023 15:21:17 +0000 (UTC) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Arnd Bergmann , Hans Verkuil , Arnd Bergmann Subject: [PATCHv2 06/23] media: cx18: increase in_workq_name size Date: Sat, 23 Sep 2023 17:20:50 +0200 Message-Id: <20230923152107.283289-7-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> References: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 Acked-by: Arnd Bergmann --- drivers/media/pci/cx18/cx18-driver.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/cx18/cx18-driver.h b/drivers/media/pci/cx18/cx18-driver.h index 887d2aa36447..af05bde75816 100644 --- a/drivers/media/pci/cx18/cx18-driver.h +++ b/drivers/media/pci/cx18/cx18-driver.h @@ -631,7 +631,7 @@ struct cx18 { u32 hw2_irq_mask; struct workqueue_struct *in_work_queue; - char in_workq_name[11]; /* "cx18-NN-in" */ + char in_workq_name[39]; /* "cx18-NN-in" */ struct cx18_in_work_order in_work_order[CX18_MAX_IN_WORK_ORDERS]; char epu_debug_str[256]; /* CX18_EPU_DEBUG is rare: use shared space */ From patchwork Sat Sep 23 15:20:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 13396821 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7893CCE7A8C for ; Sat, 23 Sep 2023 15:21:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231908AbjIWPV2 (ORCPT ); Sat, 23 Sep 2023 11:21:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231939AbjIWPV0 (ORCPT ); Sat, 23 Sep 2023 11:21:26 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DECA2192 for ; Sat, 23 Sep 2023 08:21:20 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78F9FC433CB; Sat, 23 Sep 2023 15:21:19 +0000 (UTC) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Arnd Bergmann , Hans Verkuil , Sean Young , Arnd Bergmann Subject: [PATCHv2 07/23] media: rc: ati_remote: increase mouse_name buffer size Date: Sat, 23 Sep 2023 17:20:51 +0200 Message-Id: <20230923152107.283289-8-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> References: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 Reviewed-by: Sean Young Acked-by: Arnd Bergmann --- drivers/media/rc/ati_remote.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/rc/ati_remote.c b/drivers/media/rc/ati_remote.c index fff4dd48eaca..d7721e60776e 100644 --- a/drivers/media/rc/ati_remote.c +++ b/drivers/media/rc/ati_remote.c @@ -251,7 +251,7 @@ struct ati_remote { char rc_name[NAME_BUFSIZE]; char rc_phys[NAME_BUFSIZE]; - char mouse_name[NAME_BUFSIZE]; + char mouse_name[NAME_BUFSIZE + 6]; char mouse_phys[NAME_BUFSIZE]; wait_queue_head_t wait; From patchwork Sat Sep 23 15:20:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 13396822 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 769DFCE7A88 for ; Sat, 23 Sep 2023 15:21:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231948AbjIWPV3 (ORCPT ); Sat, 23 Sep 2023 11:21:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231949AbjIWPV2 (ORCPT ); Sat, 23 Sep 2023 11:21:28 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 139D819A for ; Sat, 23 Sep 2023 08:21:22 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F28F6C433C8; Sat, 23 Sep 2023 15:21:20 +0000 (UTC) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Arnd Bergmann , Hans Verkuil Subject: [PATCHv2 08/23] media: cec.h: increase input_phys buffer Date: Sat, 23 Sep 2023 17:20:52 +0200 Message-Id: <20230923152107.283289-9-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> References: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 --- include/media/cec.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/media/cec.h b/include/media/cec.h index 9c007f83569a..53e4b2eb2b26 100644 --- a/include/media/cec.h +++ b/include/media/cec.h @@ -275,7 +275,7 @@ struct cec_adapter { u32 sequence; - char input_phys[32]; + char input_phys[40]; }; static inline void *cec_get_drvdata(const struct cec_adapter *adap) From patchwork Sat Sep 23 15:20:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 13396823 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73DFBCE7A8E for ; Sat, 23 Sep 2023 15:21:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231965AbjIWPVa (ORCPT ); Sat, 23 Sep 2023 11:21:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231937AbjIWPV3 (ORCPT ); Sat, 23 Sep 2023 11:21:29 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A22A192 for ; Sat, 23 Sep 2023 08:21:23 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 276CCC43397; Sat, 23 Sep 2023 15:21:21 +0000 (UTC) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Arnd Bergmann , Hans Verkuil , Jacopo Mondi Subject: [PATCHv2 09/23] media: renesas-ceu: keep input name simple Date: Sat, 23 Sep 2023 17:20:53 +0200 Message-Id: <20230923152107.283289-10-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> References: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 Reviewed-by: Jacopo Mondi --- drivers/media/platform/renesas/renesas-ceu.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/media/platform/renesas/renesas-ceu.c b/drivers/media/platform/renesas/renesas-ceu.c index ec631c6e2a57..2562b30acfb9 100644 --- a/drivers/media/platform/renesas/renesas-ceu.c +++ b/drivers/media/platform/renesas/renesas-ceu.c @@ -1183,17 +1183,13 @@ static int ceu_enum_input(struct file *file, void *priv, struct v4l2_input *inp) { struct ceu_device *ceudev = video_drvdata(file); - struct ceu_subdev *ceusd; if (inp->index >= ceudev->num_sd) return -EINVAL; - ceusd = ceudev->subdevs[inp->index]; - inp->type = V4L2_INPUT_TYPE_CAMERA; inp->std = 0; - snprintf(inp->name, sizeof(inp->name), "Camera%u: %s", - inp->index, ceusd->v4l2_sd->name); + snprintf(inp->name, sizeof(inp->name), "Camera %u", inp->index); return 0; } From patchwork Sat Sep 23 15:20:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 13396824 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A50BCE7A88 for ; Sat, 23 Sep 2023 15:21:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231969AbjIWPVc (ORCPT ); Sat, 23 Sep 2023 11:21:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231959AbjIWPVa (ORCPT ); Sat, 23 Sep 2023 11:21:30 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAC09192 for ; Sat, 23 Sep 2023 08:21:24 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7903DC433C8; Sat, 23 Sep 2023 15:21:23 +0000 (UTC) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Arnd Bergmann , Hans Verkuil , Corentin Labbe Subject: [PATCHv2 10/23] media: zoran: increase name size Date: Sat, 23 Sep 2023 17:20:54 +0200 Message-Id: <20230923152107.283289-11-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> References: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 Cc: Corentin Labbe --- drivers/media/pci/zoran/zoran.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/zoran/zoran.h b/drivers/media/pci/zoran/zoran.h index 56340553b282..1cd990468d3d 100644 --- a/drivers/media/pci/zoran/zoran.h +++ b/drivers/media/pci/zoran/zoran.h @@ -219,7 +219,7 @@ struct zoran { const struct tvnorm *timing; unsigned short id; /* number of this device */ - char name[32]; /* name of this device */ + char name[40]; /* name of this device */ struct pci_dev *pci_dev; /* PCI device */ unsigned char revision; /* revision of zr36057 */ unsigned char __iomem *zr36057_mem;/* pointer to mapped IO memory */ From patchwork Sat Sep 23 15:20:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 13396826 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5DDFCE7A8F for ; Sat, 23 Sep 2023 15:21:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231959AbjIWPVd (ORCPT ); Sat, 23 Sep 2023 11:21:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231937AbjIWPVb (ORCPT ); Sat, 23 Sep 2023 11:21:31 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB40D192 for ; Sat, 23 Sep 2023 08:21:25 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA2EEC43391; Sat, 23 Sep 2023 15:21:24 +0000 (UTC) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Arnd Bergmann , Hans Verkuil Subject: [PATCHv2 11/23] media: v4l2-dev.h: increase struct video_device name size Date: Sat, 23 Sep 2023 17:20:55 +0200 Message-Id: <20230923152107.283289-12-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> References: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Increase the size of the name field to prevent a lot of string truncate compiler warnings. Signed-off-by: Hans Verkuil --- include/media/v4l2-dev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h index e0a13505f88d..d82dfdbf6e58 100644 --- a/include/media/v4l2-dev.h +++ b/include/media/v4l2-dev.h @@ -284,7 +284,7 @@ struct video_device { struct v4l2_prio_state *prio; /* device info */ - char name[32]; + char name[64]; enum vfl_devnode_type vfl_type; enum vfl_devnode_direction vfl_dir; int minor; From patchwork Sat Sep 23 15:20:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 13396825 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 484CFCE7A90 for ; Sat, 23 Sep 2023 15:21:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231972AbjIWPVe (ORCPT ); Sat, 23 Sep 2023 11:21:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231949AbjIWPVc (ORCPT ); Sat, 23 Sep 2023 11:21:32 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EF75192 for ; Sat, 23 Sep 2023 08:21:27 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 080E2C433C9; Sat, 23 Sep 2023 15:21:25 +0000 (UTC) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Arnd Bergmann , Hans Verkuil Subject: [PATCHv2 12/23] media: v4l2-subdev.h: increase struct v4l2_subdev name size Date: Sat, 23 Sep 2023 17:20:56 +0200 Message-Id: <20230923152107.283289-13-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> References: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This resolves a lot of the string truncate compiler warnings. Signed-off-by: Hans Verkuil --- drivers/staging/media/omap4iss/iss_csi2.c | 2 +- include/media/v4l2-subdev.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/omap4iss/iss_csi2.c b/drivers/staging/media/omap4iss/iss_csi2.c index 04ce0e7eb557..d2844414de4f 100644 --- a/drivers/staging/media/omap4iss/iss_csi2.c +++ b/drivers/staging/media/omap4iss/iss_csi2.c @@ -1260,7 +1260,7 @@ static int csi2_init_entities(struct iss_csi2_device *csi2, const char *subname) struct media_pad *pads = csi2->pads; struct media_entity *me = &sd->entity; int ret; - char name[V4L2_SUBDEV_NAME_SIZE]; + char name[32]; v4l2_subdev_init(sd, &csi2_ops); sd->internal_ops = &csi2_internal_ops; diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index 5f59ff0796b7..5711354056b9 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h @@ -951,7 +951,7 @@ struct v4l2_subdev_internal_ops { void (*release)(struct v4l2_subdev *sd); }; -#define V4L2_SUBDEV_NAME_SIZE 32 +#define V4L2_SUBDEV_NAME_SIZE 52 /* Set this flag if this subdev is a i2c device. */ #define V4L2_SUBDEV_FL_IS_I2C (1U << 0) From patchwork Sat Sep 23 15:20:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 13396827 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CFC7BCE7A88 for ; Sat, 23 Sep 2023 15:21:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231949AbjIWPVg (ORCPT ); Sat, 23 Sep 2023 11:21:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231869AbjIWPVf (ORCPT ); Sat, 23 Sep 2023 11:21:35 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DC3C19C for ; Sat, 23 Sep 2023 08:21:29 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 314C5C433CA; Sat, 23 Sep 2023 15:21:27 +0000 (UTC) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Arnd Bergmann , Hans Verkuil , Luca Ceresoli , Maxime Ripard , =?utf-8?q?Niklas_S=C3=B6derlund?= , Sowjanya Komatineni , Laurent Pinchart Subject: [PATCHv2 13/23] media: use sizeof() instead of V4L2_SUBDEV_NAME_SIZE Date: Sat, 23 Sep 2023 17:20:57 +0200 Message-Id: <20230923152107.283289-14-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> References: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 Cc: Luca Ceresoli Cc: Maxime Ripard Cc: Niklas Söderlund Cc: Sowjanya Komatineni Cc: Laurent Pinchart Reviewed-by: Laurent Pinchart Reviewed-by: Niklas Söderlund Reviewed-by: Maxime Ripard Reviewed-by: Luca Ceresoli Tested-by: Luca Ceresoli # tegra-video VIP --- drivers/media/i2c/msp3400-driver.c | 2 +- drivers/media/platform/cadence/cdns-csi2rx.c | 4 ++-- drivers/media/platform/cadence/cdns-csi2tx.c | 4 ++-- drivers/media/platform/renesas/rcar-isp.c | 2 +- drivers/media/platform/renesas/rcar-vin/rcar-csi2.c | 2 +- drivers/media/platform/ti/omap3isp/ispstat.c | 2 +- drivers/staging/media/tegra-video/csi.c | 4 ++-- drivers/staging/media/tegra-video/vip.c | 2 +- include/media/v4l2-subdev.h | 4 +--- 9 files changed, 12 insertions(+), 14 deletions(-) diff --git a/drivers/media/i2c/msp3400-driver.c b/drivers/media/i2c/msp3400-driver.c index bec76801487a..0ed8561edfee 100644 --- a/drivers/media/i2c/msp3400-driver.c +++ b/drivers/media/i2c/msp3400-driver.c @@ -561,7 +561,7 @@ static int msp_log_status(struct v4l2_subdev *sd) struct msp_state *state = to_state(sd); struct i2c_client *client = v4l2_get_subdevdata(sd); const char *p; - char prefix[V4L2_SUBDEV_NAME_SIZE + 20]; + char prefix[sizeof(sd->name) + 20]; if (state->opmode == OPMODE_AUTOSELECT) msp_detect_stereo(client); diff --git a/drivers/media/platform/cadence/cdns-csi2rx.c b/drivers/media/platform/cadence/cdns-csi2rx.c index 0d879d71d818..b9d9058e2ce3 100644 --- a/drivers/media/platform/cadence/cdns-csi2rx.c +++ b/drivers/media/platform/cadence/cdns-csi2rx.c @@ -516,8 +516,8 @@ static int csi2rx_probe(struct platform_device *pdev) csi2rx->subdev.dev = &pdev->dev; v4l2_subdev_init(&csi2rx->subdev, &csi2rx_subdev_ops); v4l2_set_subdevdata(&csi2rx->subdev, &pdev->dev); - snprintf(csi2rx->subdev.name, V4L2_SUBDEV_NAME_SIZE, "%s.%s", - KBUILD_MODNAME, dev_name(&pdev->dev)); + snprintf(csi2rx->subdev.name, sizeof(csi2rx->subdev.name), + "%s.%s", KBUILD_MODNAME, dev_name(&pdev->dev)); /* Create our media pads */ csi2rx->subdev.entity.function = MEDIA_ENT_F_VID_IF_BRIDGE; diff --git a/drivers/media/platform/cadence/cdns-csi2tx.c b/drivers/media/platform/cadence/cdns-csi2tx.c index cbbb77520112..c115742f347f 100644 --- a/drivers/media/platform/cadence/cdns-csi2tx.c +++ b/drivers/media/platform/cadence/cdns-csi2tx.c @@ -592,8 +592,8 @@ static int csi2tx_probe(struct platform_device *pdev) csi2tx->subdev.owner = THIS_MODULE; csi2tx->subdev.dev = &pdev->dev; csi2tx->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; - snprintf(csi2tx->subdev.name, V4L2_SUBDEV_NAME_SIZE, "%s.%s", - KBUILD_MODNAME, dev_name(&pdev->dev)); + snprintf(csi2tx->subdev.name, sizeof(csi2tx->subdev.name), + "%s.%s", KBUILD_MODNAME, dev_name(&pdev->dev)); ret = csi2tx_check_lanes(csi2tx); if (ret) diff --git a/drivers/media/platform/renesas/rcar-isp.c b/drivers/media/platform/renesas/rcar-isp.c index 7360cf3863f2..19a005d83733 100644 --- a/drivers/media/platform/renesas/rcar-isp.c +++ b/drivers/media/platform/renesas/rcar-isp.c @@ -467,7 +467,7 @@ static int risp_probe(struct platform_device *pdev) isp->subdev.dev = &pdev->dev; v4l2_subdev_init(&isp->subdev, &rcar_isp_subdev_ops); v4l2_set_subdevdata(&isp->subdev, &pdev->dev); - snprintf(isp->subdev.name, V4L2_SUBDEV_NAME_SIZE, "%s %s", + snprintf(isp->subdev.name, sizeof(isp->subdev.name), "%s %s", KBUILD_MODNAME, dev_name(&pdev->dev)); isp->subdev.flags = V4L2_SUBDEV_FL_HAS_DEVNODE; diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-csi2.c b/drivers/media/platform/renesas/rcar-vin/rcar-csi2.c index f6326df0b09b..66fe553a00e7 100644 --- a/drivers/media/platform/renesas/rcar-vin/rcar-csi2.c +++ b/drivers/media/platform/renesas/rcar-vin/rcar-csi2.c @@ -1889,7 +1889,7 @@ static int rcsi2_probe(struct platform_device *pdev) priv->subdev.dev = &pdev->dev; v4l2_subdev_init(&priv->subdev, &rcar_csi2_subdev_ops); v4l2_set_subdevdata(&priv->subdev, &pdev->dev); - snprintf(priv->subdev.name, V4L2_SUBDEV_NAME_SIZE, "%s %s", + snprintf(priv->subdev.name, sizeof(priv->subdev.name), "%s %s", KBUILD_MODNAME, dev_name(&pdev->dev)); priv->subdev.flags = V4L2_SUBDEV_FL_HAS_DEVNODE; diff --git a/drivers/media/platform/ti/omap3isp/ispstat.c b/drivers/media/platform/ti/omap3isp/ispstat.c index 68cf68dbcace..359a846205b0 100644 --- a/drivers/media/platform/ti/omap3isp/ispstat.c +++ b/drivers/media/platform/ti/omap3isp/ispstat.c @@ -1039,7 +1039,7 @@ static int isp_stat_init_entities(struct ispstat *stat, const char *name, struct media_entity *me = &subdev->entity; v4l2_subdev_init(subdev, sd_ops); - snprintf(subdev->name, V4L2_SUBDEV_NAME_SIZE, "OMAP3 ISP %s", name); + snprintf(subdev->name, sizeof(subdev->name), "OMAP3 ISP %s", name); subdev->grp_id = BIT(16); /* group ID for isp subdevs */ subdev->flags |= V4L2_SUBDEV_FL_HAS_EVENTS | V4L2_SUBDEV_FL_HAS_DEVNODE; v4l2_set_subdevdata(subdev, stat); diff --git a/drivers/staging/media/tegra-video/csi.c b/drivers/staging/media/tegra-video/csi.c index e79657920dc8..9aa72863c213 100644 --- a/drivers/staging/media/tegra-video/csi.c +++ b/drivers/staging/media/tegra-video/csi.c @@ -607,10 +607,10 @@ static int tegra_csi_channel_init(struct tegra_csi_channel *chan) v4l2_subdev_init(subdev, &tegra_csi_ops); subdev->dev = csi->dev; if (IS_ENABLED(CONFIG_VIDEO_TEGRA_TPG)) - snprintf(subdev->name, V4L2_SUBDEV_NAME_SIZE, "%s-%d", "tpg", + snprintf(subdev->name, sizeof(subdev->name), "%s-%d", "tpg", chan->csi_port_nums[0]); else - snprintf(subdev->name, V4L2_SUBDEV_NAME_SIZE, "%s", + snprintf(subdev->name, sizeof(subdev->name), "%s", kbasename(chan->of_node->full_name)); v4l2_set_subdevdata(subdev, chan); diff --git a/drivers/staging/media/tegra-video/vip.c b/drivers/staging/media/tegra-video/vip.c index 191ecd19a6a7..e95cc7bb190e 100644 --- a/drivers/staging/media/tegra-video/vip.c +++ b/drivers/staging/media/tegra-video/vip.c @@ -163,7 +163,7 @@ static int tegra_vip_channel_init(struct tegra_vip *vip) subdev = &vip->chan.subdev; v4l2_subdev_init(subdev, &tegra_vip_ops); subdev->dev = vip->dev; - snprintf(subdev->name, V4L2_SUBDEV_NAME_SIZE, "%s", + snprintf(subdev->name, sizeof(subdev->name), "%s", kbasename(vip->chan.of_node->full_name)); v4l2_set_subdevdata(subdev, &vip->chan); diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index 5711354056b9..c1f90c1223a7 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h @@ -951,8 +951,6 @@ struct v4l2_subdev_internal_ops { void (*release)(struct v4l2_subdev *sd); }; -#define V4L2_SUBDEV_NAME_SIZE 52 - /* Set this flag if this subdev is a i2c device. */ #define V4L2_SUBDEV_FL_IS_I2C (1U << 0) /* Set this flag if this subdev is a spi device. */ @@ -1062,7 +1060,7 @@ struct v4l2_subdev { const struct v4l2_subdev_ops *ops; const struct v4l2_subdev_internal_ops *internal_ops; struct v4l2_ctrl_handler *ctrl_handler; - char name[V4L2_SUBDEV_NAME_SIZE]; + char name[52]; u32 grp_id; void *dev_priv; void *host_priv; From patchwork Sat Sep 23 15:20:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 13396828 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48ECFCE7A8C for ; Sat, 23 Sep 2023 15:21:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231983AbjIWPVg (ORCPT ); Sat, 23 Sep 2023 11:21:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231966AbjIWPVg (ORCPT ); Sat, 23 Sep 2023 11:21:36 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C1CB196 for ; Sat, 23 Sep 2023 08:21:30 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F86AC43397; Sat, 23 Sep 2023 15:21:29 +0000 (UTC) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Arnd Bergmann , Hans Verkuil Subject: [PATCHv2 14/23] media: v4l2-device.h: drop V4L2_DEVICE_NAME_SIZE Date: Sat, 23 Sep 2023 17:20:58 +0200 Message-Id: <20230923152107.283289-15-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> References: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 --- include/media/v4l2-device.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/media/v4l2-device.h b/include/media/v4l2-device.h index 8a8977a33ec1..f6f111fae33c 100644 --- a/include/media/v4l2-device.h +++ b/include/media/v4l2-device.h @@ -13,8 +13,6 @@ #include #include -#define V4L2_DEVICE_NAME_SIZE (20 + 16) - struct v4l2_ctrl_handler; /** @@ -49,7 +47,7 @@ struct v4l2_device { struct media_device *mdev; struct list_head subdevs; spinlock_t lock; - char name[V4L2_DEVICE_NAME_SIZE]; + char name[36]; void (*notify)(struct v4l2_subdev *sd, unsigned int notification, void *arg); struct v4l2_ctrl_handler *ctrl_handler; From patchwork Sat Sep 23 15:20:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 13396829 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DCEDBCE7A89 for ; Sat, 23 Sep 2023 15:21:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231990AbjIWPVh (ORCPT ); Sat, 23 Sep 2023 11:21:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231989AbjIWPVh (ORCPT ); Sat, 23 Sep 2023 11:21:37 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 726CA197 for ; Sat, 23 Sep 2023 08:21:31 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57CEBC433C8; Sat, 23 Sep 2023 15:21:30 +0000 (UTC) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Arnd Bergmann , Hans Verkuil Subject: [PATCHv2 15/23] media: vivid: use VIVID_MODULE_NAME to fill bus_info Date: Sat, 23 Sep 2023 17:20:59 +0200 Message-Id: <20230923152107.283289-16-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> References: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 --- drivers/media/test-drivers/vivid/vivid-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 | From patchwork Sat Sep 23 15:21:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 13396830 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4267DCE7A88 for ; Sat, 23 Sep 2023 15:21:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231989AbjIWPVj (ORCPT ); Sat, 23 Sep 2023 11:21:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231993AbjIWPVj (ORCPT ); Sat, 23 Sep 2023 11:21:39 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E75D9193 for ; Sat, 23 Sep 2023 08:21:32 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80171C433C7; Sat, 23 Sep 2023 15:21:31 +0000 (UTC) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Arnd Bergmann , Hans Verkuil , Eugen Hristev , Nicolas Ferre Subject: [PATCHv2 16/23] media: microchip: don't set bus_info Date: Sat, 23 Sep 2023 17:21:00 +0200 Message-Id: <20230923152107.283289-17-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> References: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 Cc: Eugen Hristev Cc: Nicolas Ferre Acked-by: Nicolas Ferre --- drivers/media/platform/microchip/microchip-isc-base.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/media/platform/microchip/microchip-isc-base.c b/drivers/media/platform/microchip/microchip-isc-base.c index 8dbf7bc1e863..1f8528844497 100644 --- a/drivers/media/platform/microchip/microchip-isc-base.c +++ b/drivers/media/platform/microchip/microchip-isc-base.c @@ -478,12 +478,8 @@ static const struct vb2_ops isc_vb2_ops = { static int isc_querycap(struct file *file, void *priv, struct v4l2_capability *cap) { - struct isc_device *isc = video_drvdata(file); - strscpy(cap->driver, "microchip-isc", sizeof(cap->driver)); strscpy(cap->card, "Microchip Image Sensor Controller", sizeof(cap->card)); - snprintf(cap->bus_info, sizeof(cap->bus_info), - "platform:%s", isc->v4l2_dev.name); return 0; } @@ -1993,8 +1989,6 @@ int isc_mc_init(struct isc_device *isc, u32 ver) strscpy(isc->mdev.driver_name, KBUILD_MODNAME, sizeof(isc->mdev.driver_name)); strscpy(isc->mdev.model, match->compatible, sizeof(isc->mdev.model)); - snprintf(isc->mdev.bus_info, sizeof(isc->mdev.bus_info), "platform:%s", - isc->v4l2_dev.name); isc->mdev.hw_revision = ver; media_device_init(&isc->mdev); From patchwork Sat Sep 23 15:21:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 13396831 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69628CE7A89 for ; Sat, 23 Sep 2023 15:21:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231993AbjIWPVm (ORCPT ); Sat, 23 Sep 2023 11:21:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231991AbjIWPVl (ORCPT ); Sat, 23 Sep 2023 11:21:41 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 443B7196 for ; Sat, 23 Sep 2023 08:21:34 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06F03C433CA; Sat, 23 Sep 2023 15:21:32 +0000 (UTC) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Arnd Bergmann , Hans Verkuil , Fabrizio Castro Subject: [PATCHv2 17/23] media: rcar_drif: use explicit name for bus_info Date: Sat, 23 Sep 2023 17:21:01 +0200 Message-Id: <20230923152107.283289-18-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> References: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 Cc: Fabrizio Castro --- drivers/media/platform/renesas/rcar_drif.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/platform/renesas/rcar_drif.c b/drivers/media/platform/renesas/rcar_drif.c index 163a4ba61c17..292c5bf9e50c 100644 --- a/drivers/media/platform/renesas/rcar_drif.c +++ b/drivers/media/platform/renesas/rcar_drif.c @@ -871,8 +871,7 @@ static int rcar_drif_querycap(struct file *file, void *fh, strscpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver)); strscpy(cap->card, sdr->vdev->name, sizeof(cap->card)); - snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", - sdr->vdev->name); + strscpy(cap->bus_info, "platform:R-Car DRIF", sizeof(cap->bus_info)); return 0; } From patchwork Sat Sep 23 15:21:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 13396832 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2ECFBCE7A8C for ; Sat, 23 Sep 2023 15:21:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231997AbjIWPVn (ORCPT ); Sat, 23 Sep 2023 11:21:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232000AbjIWPVl (ORCPT ); Sat, 23 Sep 2023 11:21:41 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97F6E1A6 for ; Sat, 23 Sep 2023 08:21:35 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57B89C433C7; Sat, 23 Sep 2023 15:21:34 +0000 (UTC) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Arnd Bergmann , Hans Verkuil , "Lad, Prabhakar" Subject: [PATCHv2 18/23] media: am437x: don't fill in bus_info Date: Sat, 23 Sep 2023 17:21:02 +0200 Message-Id: <20230923152107.283289-19-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> References: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 Cc: "Lad, Prabhakar" Reviewed-by: Lad Prabhakar --- drivers/media/platform/ti/am437x/am437x-vpfe.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/media/platform/ti/am437x/am437x-vpfe.c b/drivers/media/platform/ti/am437x/am437x-vpfe.c index 63092013d476..5fa2ea9025d9 100644 --- a/drivers/media/platform/ti/am437x/am437x-vpfe.c +++ b/drivers/media/platform/ti/am437x/am437x-vpfe.c @@ -1271,12 +1271,8 @@ static inline void vpfe_attach_irq(struct vpfe_device *vpfe) static int vpfe_querycap(struct file *file, void *priv, struct v4l2_capability *cap) { - struct vpfe_device *vpfe = video_drvdata(file); - strscpy(cap->driver, VPFE_MODULE_NAME, sizeof(cap->driver)); strscpy(cap->card, "TI AM437x VPFE", sizeof(cap->card)); - snprintf(cap->bus_info, sizeof(cap->bus_info), - "platform:%s", vpfe->v4l2_dev.name); return 0; } From patchwork Sat Sep 23 15:21:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 13396833 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9C70CE7A88 for ; Sat, 23 Sep 2023 15:21:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232004AbjIWPVo (ORCPT ); Sat, 23 Sep 2023 11:21:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231995AbjIWPVm (ORCPT ); Sat, 23 Sep 2023 11:21:42 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E51719A for ; Sat, 23 Sep 2023 08:21:37 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A869CC433C8; Sat, 23 Sep 2023 15:21:35 +0000 (UTC) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Arnd Bergmann , Hans Verkuil , Eugen Hristev , Nicolas Ferre Subject: [PATCHv2 19/23] media: atmel: drop bus_info Date: Sat, 23 Sep 2023 17:21:03 +0200 Message-Id: <20230923152107.283289-20-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> References: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 Cc: Eugen Hristev Cc: Nicolas Ferre Acked-by: Nicolas Ferre --- drivers/staging/media/deprecated/atmel/atmel-isc-base.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/staging/media/deprecated/atmel/atmel-isc-base.c b/drivers/staging/media/deprecated/atmel/atmel-isc-base.c index f5d963904201..8e26663cecb6 100644 --- a/drivers/staging/media/deprecated/atmel/atmel-isc-base.c +++ b/drivers/staging/media/deprecated/atmel/atmel-isc-base.c @@ -488,12 +488,8 @@ static const struct vb2_ops isc_vb2_ops = { static int isc_querycap(struct file *file, void *priv, struct v4l2_capability *cap) { - struct isc_device *isc = video_drvdata(file); - strscpy(cap->driver, "microchip-isc", sizeof(cap->driver)); strscpy(cap->card, "Atmel Image Sensor Controller", sizeof(cap->card)); - snprintf(cap->bus_info, sizeof(cap->bus_info), - "platform:%s", isc->v4l2_dev.name); return 0; } From patchwork Sat Sep 23 15:21:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 13396834 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 918DBCE7A89 for ; Sat, 23 Sep 2023 15:21:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232016AbjIWPVp (ORCPT ); Sat, 23 Sep 2023 11:21:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232017AbjIWPVo (ORCPT ); Sat, 23 Sep 2023 11:21:44 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 452F6193 for ; Sat, 23 Sep 2023 08:21:38 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D747C433C7; Sat, 23 Sep 2023 15:21:37 +0000 (UTC) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Arnd Bergmann , Hans Verkuil Subject: [PATCHv2 20/23] media: radio-isa: use dev_name to fill in bus_info Date: Sat, 23 Sep 2023 17:21:04 +0200 Message-Id: <20230923152107.283289-21-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> References: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 --- drivers/media/radio/radio-isa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/radio/radio-isa.c b/drivers/media/radio/radio-isa.c index c591c0851fa2..ad49151f5ff0 100644 --- a/drivers/media/radio/radio-isa.c +++ b/drivers/media/radio/radio-isa.c @@ -36,7 +36,7 @@ static int radio_isa_querycap(struct file *file, void *priv, strscpy(v->driver, isa->drv->driver.driver.name, sizeof(v->driver)); strscpy(v->card, isa->drv->card, sizeof(v->card)); - snprintf(v->bus_info, sizeof(v->bus_info), "ISA:%s", isa->v4l2_dev.name); + snprintf(v->bus_info, sizeof(v->bus_info), "ISA:%s", dev_name(isa->v4l2_dev.dev)); return 0; } From patchwork Sat Sep 23 15:21:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 13396835 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8FFCCE7A8C for ; Sat, 23 Sep 2023 15:21:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232020AbjIWPVr (ORCPT ); Sat, 23 Sep 2023 11:21:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232007AbjIWPVp (ORCPT ); Sat, 23 Sep 2023 11:21:45 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FC34197 for ; Sat, 23 Sep 2023 08:21:39 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 561CEC433C9; Sat, 23 Sep 2023 15:21:38 +0000 (UTC) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Arnd Bergmann , Hans Verkuil Subject: [PATCHv2 21/23] media: radio-miropcm20: set bus_info to explicit name Date: Sat, 23 Sep 2023 17:21:05 +0200 Message-Id: <20230923152107.283289-22-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> References: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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: Hans Verkuil --- drivers/media/radio/radio-miropcm20.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/media/radio/radio-miropcm20.c b/drivers/media/radio/radio-miropcm20.c index 99788834c646..08be77b8f3b7 100644 --- a/drivers/media/radio/radio-miropcm20.c +++ b/drivers/media/radio/radio-miropcm20.c @@ -199,11 +199,9 @@ static int pcm20_setfreq(struct pcm20 *dev, unsigned long freq) static int vidioc_querycap(struct file *file, void *priv, struct v4l2_capability *v) { - struct pcm20 *dev = video_drvdata(file); - strscpy(v->driver, "Miro PCM20", sizeof(v->driver)); strscpy(v->card, "Miro PCM20", sizeof(v->card)); - snprintf(v->bus_info, sizeof(v->bus_info), "ISA:%s", dev->v4l2_dev.name); + strscpy(v->bus_info, "ISA:radio-miropcm20", sizeof(v->bus_info)); return 0; } From patchwork Sat Sep 23 15:21:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 13396836 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19165CE7A88 for ; Sat, 23 Sep 2023 15:21:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232018AbjIWPVs (ORCPT ); Sat, 23 Sep 2023 11:21:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232019AbjIWPVr (ORCPT ); Sat, 23 Sep 2023 11:21:47 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5655196 for ; Sat, 23 Sep 2023 08:21:40 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F010C433CD; Sat, 23 Sep 2023 15:21:39 +0000 (UTC) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Arnd Bergmann , Hans Verkuil , Ezequiel Garcia , Philipp Zabel Subject: [PATCHv2 22/23] media: verisilicon: replace snprintf with strscpy+strlcat Date: Sat, 23 Sep 2023 17:21:06 +0200 Message-Id: <20230923152107.283289-23-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> References: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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: Hans Verkuil Cc: Ezequiel Garcia Cc: Philipp Zabel --- drivers/media/platform/verisilicon/hantro_drv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c index 50ec24c753e9..a9fa05ac56a9 100644 --- a/drivers/media/platform/verisilicon/hantro_drv.c +++ b/drivers/media/platform/verisilicon/hantro_drv.c @@ -899,8 +899,9 @@ static int hantro_add_func(struct hantro_dev *vpu, unsigned int funcid) vfd->vfl_dir = VFL_DIR_M2M; vfd->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M_MPLANE; vfd->ioctl_ops = &hantro_ioctl_ops; - snprintf(vfd->name, sizeof(vfd->name), "%s-%s", match->compatible, - funcid == MEDIA_ENT_F_PROC_VIDEO_ENCODER ? "enc" : "dec"); + strscpy(vfd->name, match->compatible, sizeof(vfd->name)); + strlcat(vfd->name, funcid == MEDIA_ENT_F_PROC_VIDEO_ENCODER ? + "-enc" : "-dec", sizeof(vfd->name)); if (funcid == MEDIA_ENT_F_PROC_VIDEO_ENCODER) { vpu->encoder = func; From patchwork Sat Sep 23 15:21:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 13396837 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DBC6DCE7A8E for ; Sat, 23 Sep 2023 15:21:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232019AbjIWPVt (ORCPT ); Sat, 23 Sep 2023 11:21:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232017AbjIWPVr (ORCPT ); Sat, 23 Sep 2023 11:21:47 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1801E194 for ; Sat, 23 Sep 2023 08:21:42 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 046B5C433C9; Sat, 23 Sep 2023 15:21:40 +0000 (UTC) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Arnd Bergmann , Hans Verkuil Subject: [PATCHv2 23/23] media: radio-si476x: don't fill in bus_info Date: Sat, 23 Sep 2023 17:21:07 +0200 Message-Id: <20230923152107.283289-24-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> References: <20230923152107.283289-1-hverkuil-cisco@xs4all.nl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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: Hans Verkuil --- drivers/media/radio/radio-si476x.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/media/radio/radio-si476x.c b/drivers/media/radio/radio-si476x.c index 6061506159f1..b2c5809a8bc7 100644 --- a/drivers/media/radio/radio-si476x.c +++ b/drivers/media/radio/radio-si476x.c @@ -328,9 +328,7 @@ static int si476x_radio_querycap(struct file *file, void *priv, strscpy(capability->driver, radio->v4l2dev.name, sizeof(capability->driver)); - strscpy(capability->card, DRIVER_CARD, sizeof(capability->card)); - snprintf(capability->bus_info, sizeof(capability->bus_info), - "platform:%s", radio->v4l2dev.name); + strscpy(capability->card, DRIVER_CARD, sizeof(capability->card)); return 0; }