From patchwork Fri Sep 22 12:58:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 13395771 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 0A91AE6FE22 for ; Fri, 22 Sep 2023 12:58:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231894AbjIVM6r (ORCPT ); Fri, 22 Sep 2023 08:58:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229947AbjIVM6q (ORCPT ); Fri, 22 Sep 2023 08:58:46 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3443DCE for ; Fri, 22 Sep 2023 05:58:40 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2200FC433C7; Fri, 22 Sep 2023 12:58:38 +0000 (UTC) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Arnd Bergmann Subject: [PATCH 0/6] media: string truncate warnings: increase name fields Date: Fri, 22 Sep 2023 14:58:31 +0200 Message-Id: <20230922125837.3290073-1-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This is a second batch of patches: the first 3 fix some more low-hanging fruit that I missed in the first round. The next two patches increase two internal name fields: one in struct video_device and one in struct v4l2_subdev. Generally speaking: sizeof(v4l2_device.name) < sizeof(v4l2_subdev.name) < sizeof(video_device.name) With this patch series these become: 36 < 52 < 64. The exact sizes are a bit trial and error, I'm afraid. Typically v4l2_subdev.name uses v4l2_device.name with some extra text, and the same happens for video_device.name. The last patch removes V4L2_SUBDEV_NAME_SIZE and replaces all uses of it by sizeof(), which is much safer than relying on a define. With these changes I am left with 11 warnings, 10 of which are bus_info related (uAPI). Especially for the platform devices this can likely be dropped altogether since today it is filled in by the core for platform devices. Something to look at in the next round. Regards, Hans Hans Verkuil (6): media: cec.h: increase input_phys buffer media: renesas-ceu: keep input name simple media: zoran: increase name size media: v4l2-dev.h: increase struct video_device name size media: v4l2-subdev.h: increase struct v4l2_subdev name size media: use sizeof() instead of V4L2_SUBDEV_NAME_SIZE drivers/media/i2c/msp3400-driver.c | 2 +- drivers/media/pci/zoran/zoran.h | 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/renesas/renesas-ceu.c | 6 +----- drivers/media/platform/ti/omap3isp/ispstat.c | 2 +- drivers/staging/media/omap4iss/iss_csi2.c | 2 +- drivers/staging/media/tegra-video/csi.c | 4 ++-- drivers/staging/media/tegra-video/vip.c | 2 +- include/media/cec.h | 2 +- include/media/v4l2-dev.h | 2 +- include/media/v4l2-subdev.h | 4 +--- 14 files changed, 17 insertions(+), 23 deletions(-)