media: rockchip: ispp: move from strlcpy with unused retval to strscpy

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I14768fca655f95aaa8d82457bb16d9f621ab67af
This commit is contained in:
Tao Huang
2025-02-17 19:25:02 +08:00
parent 7c6ba8e2df
commit ebf55f0cd7
5 changed files with 8 additions and 8 deletions

View File

@@ -294,7 +294,7 @@ static int rkispp_plat_probe(struct platform_device *pdev)
ispp_dev->media_dev.dev = &pdev->dev;
v4l2_dev = &ispp_dev->v4l2_dev;
v4l2_dev->mdev = &ispp_dev->media_dev;
strlcpy(v4l2_dev->name, ispp_dev->name, sizeof(v4l2_dev->name));
strscpy(v4l2_dev->name, ispp_dev->name, sizeof(v4l2_dev->name));
v4l2_ctrl_handler_init(&ispp_dev->ctrl_handler, 5);
v4l2_dev->ctrl_handler = &ispp_dev->ctrl_handler;

View File

@@ -423,7 +423,7 @@ int rkispp_register_fec(struct rkispp_hw_dev *hw)
fec->hw = hw;
hw->is_fec_ext = true;
v4l2_dev = &fec->v4l2_dev;
strlcpy(v4l2_dev->name, fec_videodev.name, sizeof(v4l2_dev->name));
strscpy(v4l2_dev->name, fec_videodev.name, sizeof(v4l2_dev->name));
ret = v4l2_device_register(hw->dev, v4l2_dev);
if (ret)
return ret;

View File

@@ -55,8 +55,8 @@ static int rkispp_params_querycap(struct file *file,
snprintf(cap->driver, sizeof(cap->driver),
"%s_v%d", DRIVER_NAME,
params_vdev->dev->ispp_ver >> 4);
strlcpy(cap->card, vdev->name, sizeof(cap->card));
strlcpy(cap->bus_info, "platform: " DRIVER_NAME, sizeof(cap->bus_info));
strscpy(cap->card, vdev->name, sizeof(cap->card));
strscpy(cap->bus_info, "platform: " DRIVER_NAME, sizeof(cap->bus_info));
return 0;
}

View File

@@ -143,8 +143,8 @@ static int rkispp_stats_querycap(struct file *file,
snprintf(cap->driver, sizeof(cap->driver),
"%s_v%d", DRIVER_NAME,
stats_vdev->dev->ispp_ver >> 4);
strlcpy(cap->card, vdev->name, sizeof(cap->card));
strlcpy(cap->bus_info, "platform: " DRIVER_NAME, sizeof(cap->bus_info));
strscpy(cap->card, vdev->name, sizeof(cap->card));
strscpy(cap->bus_info, "platform: " DRIVER_NAME, sizeof(cap->bus_info));
return 0;
}

View File

@@ -1463,7 +1463,7 @@ static int rkispp_querycap(struct file *file, void *priv,
struct device *dev = stream->isppdev->dev;
struct video_device *vdev = video_devdata(file);
strlcpy(cap->card, vdev->name, sizeof(cap->card));
strscpy(cap->card, vdev->name, sizeof(cap->card));
snprintf(cap->driver, sizeof(cap->driver),
"%s_v%d", dev->driver->name,
stream->isppdev->ispp_ver >> 4);
@@ -2014,7 +2014,7 @@ int rkispp_register_stream_vdevs(struct rkispp_device *dev)
v4l2_err(&dev->v4l2_dev, "Invalid stream:%d\n", i);
return -EINVAL;
}
strlcpy(vdev->name, vdev_name, sizeof(vdev->name));
strscpy(vdev->name, vdev_name, sizeof(vdev->name));
ret = rkispp_register_stream_video(stream);
if (ret < 0)
goto err;