Hi Mariia, > Date: 2026-11-10 19:24:46-0800 > From: Mariia Nikitash > > In preparation for removing the deprecated strlcat() API [1], replace the > strscpy() and strlcat() calls in hantro_add_func() with a single > scnprintf() call. > > This preserves the resulting string, including NUL termination > and truncation behavior. > > Link: https://github.com/KSPP/linux/issues/370 [1] > Signed-off-by: Mariia Nikitash Reviewed-by: Alejandro Colomar Have a lovely day! Alex > --- > Changes in v2: > - Replace seq_buf with a single scnprintf() call, as suggested > by Hans Verkuil. > > drivers/media/platform/verisilicon/hantro_drv.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c > index 26e5d5547466..d8854ceb4fed 100644 > --- a/drivers/media/platform/verisilicon/hantro_drv.c > +++ b/drivers/media/platform/verisilicon/hantro_drv.c > @@ -902,9 +902,8 @@ 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; > - strscpy(vfd->name, match->compatible, sizeof(vfd->name)); > - strlcat(vfd->name, funcid == MEDIA_ENT_F_PROC_VIDEO_ENCODER ? > - "-enc" : "-dec", sizeof(vfd->name)); > + scnprintf(vfd->name, sizeof(vfd->name), "%s%s", match->compatible, > + funcid == MEDIA_ENT_F_PROC_VIDEO_ENCODER ? "-enc" : "-dec"); > > if (funcid == MEDIA_ENT_F_PROC_VIDEO_ENCODER) { > vpu->encoder = func; > -- > 2.43.0 > > --