diff options
author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2023-09-23 17:20:57 +0200 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2023-09-27 10:47:22 +0200 |
commit | 8cdd708f11655d5f28fca1ab2fa0dbe5424f274c (patch) | |
tree | d5d4d6e24436144d00901115f44d8d7f04eac223 /drivers/staging/media | |
parent | d9d432af1415b358d76b110c9e37e4f07d2e1c7b (diff) | |
download | lwn-8cdd708f11655d5f28fca1ab2fa0dbe5424f274c.tar.gz lwn-8cdd708f11655d5f28fca1ab2fa0dbe5424f274c.zip |
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>
Diffstat (limited to 'drivers/staging/media')
-rw-r--r-- | drivers/staging/media/tegra-video/csi.c | 4 | ||||
-rw-r--r-- | drivers/staging/media/tegra-video/vip.c | 2 |
2 files changed, 3 insertions, 3 deletions
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); |