Message ID | e5ba9c47436888e9cc4c0cda6ca61ade31e703c0.1553873376.git.mchehab+samsung@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | media: staging: use strscpy() instead of strlcpy() | expand |
On 3/29/19 4:29 PM, Mauro Carvalho Chehab wrote: > There are a few left overs at staging with were still using the > deprecated strlcpy() function. > > Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Thanks! Hans > --- > drivers/staging/media/imx/imx-media-dev-common.c | 4 ++-- > drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/staging/media/imx/imx-media-dev-common.c b/drivers/staging/media/imx/imx-media-dev-common.c > index 910594125889..6cd93419b81d 100644 > --- a/drivers/staging/media/imx/imx-media-dev-common.c > +++ b/drivers/staging/media/imx/imx-media-dev-common.c > @@ -30,7 +30,7 @@ struct imx_media_dev *imx_media_dev_init(struct device *dev) > > dev_set_drvdata(dev, imxmd); > > - strlcpy(imxmd->md.model, "imx-media", sizeof(imxmd->md.model)); > + strscpy(imxmd->md.model, "imx-media", sizeof(imxmd->md.model)); > imxmd->md.ops = &imx_media_md_ops; > imxmd->md.dev = dev; > > @@ -38,7 +38,7 @@ struct imx_media_dev *imx_media_dev_init(struct device *dev) > > imxmd->v4l2_dev.mdev = &imxmd->md; > imxmd->v4l2_dev.notify = imx_media_notify; > - strlcpy(imxmd->v4l2_dev.name, "imx-media", > + strscpy(imxmd->v4l2_dev.name, "imx-media", > sizeof(imxmd->v4l2_dev.name)); > > media_device_init(&imxmd->md); > diff --git a/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c b/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c > index 57611464ad07..58721c46fba4 100644 > --- a/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c > +++ b/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c > @@ -462,7 +462,7 @@ static int rockchip_vpu_probe(struct platform_device *pdev) > } > > vpu->mdev.dev = vpu->dev; > - strlcpy(vpu->mdev.model, DRIVER_NAME, sizeof(vpu->mdev.model)); > + strscpy(vpu->mdev.model, DRIVER_NAME, sizeof(vpu->mdev.model)); > media_device_init(&vpu->mdev); > vpu->v4l2_dev.mdev = &vpu->mdev; > >
On 3/29/2019 8:59 PM, Mauro Carvalho Chehab wrote: > There are a few left overs at staging with were still using the > deprecated strlcpy() function. > > Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> s/with/which Reviewed-by: Mukesh Ojha <mojha@codeaurora.org> Cheers, -Mukesh > --- > drivers/staging/media/imx/imx-media-dev-common.c | 4 ++-- > drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/staging/media/imx/imx-media-dev-common.c b/drivers/staging/media/imx/imx-media-dev-common.c > index 910594125889..6cd93419b81d 100644 > --- a/drivers/staging/media/imx/imx-media-dev-common.c > +++ b/drivers/staging/media/imx/imx-media-dev-common.c > @@ -30,7 +30,7 @@ struct imx_media_dev *imx_media_dev_init(struct device *dev) > > dev_set_drvdata(dev, imxmd); > > - strlcpy(imxmd->md.model, "imx-media", sizeof(imxmd->md.model)); > + strscpy(imxmd->md.model, "imx-media", sizeof(imxmd->md.model)); > imxmd->md.ops = &imx_media_md_ops; > imxmd->md.dev = dev; > > @@ -38,7 +38,7 @@ struct imx_media_dev *imx_media_dev_init(struct device *dev) > > imxmd->v4l2_dev.mdev = &imxmd->md; > imxmd->v4l2_dev.notify = imx_media_notify; > - strlcpy(imxmd->v4l2_dev.name, "imx-media", > + strscpy(imxmd->v4l2_dev.name, "imx-media", > sizeof(imxmd->v4l2_dev.name)); > > media_device_init(&imxmd->md); > diff --git a/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c b/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c > index 57611464ad07..58721c46fba4 100644 > --- a/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c > +++ b/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c > @@ -462,7 +462,7 @@ static int rockchip_vpu_probe(struct platform_device *pdev) > } > > vpu->mdev.dev = vpu->dev; > - strlcpy(vpu->mdev.model, DRIVER_NAME, sizeof(vpu->mdev.model)); > + strscpy(vpu->mdev.model, DRIVER_NAME, sizeof(vpu->mdev.model)); > media_device_init(&vpu->mdev); > vpu->v4l2_dev.mdev = &vpu->mdev; >
diff --git a/drivers/staging/media/imx/imx-media-dev-common.c b/drivers/staging/media/imx/imx-media-dev-common.c index 910594125889..6cd93419b81d 100644 --- a/drivers/staging/media/imx/imx-media-dev-common.c +++ b/drivers/staging/media/imx/imx-media-dev-common.c @@ -30,7 +30,7 @@ struct imx_media_dev *imx_media_dev_init(struct device *dev) dev_set_drvdata(dev, imxmd); - strlcpy(imxmd->md.model, "imx-media", sizeof(imxmd->md.model)); + strscpy(imxmd->md.model, "imx-media", sizeof(imxmd->md.model)); imxmd->md.ops = &imx_media_md_ops; imxmd->md.dev = dev; @@ -38,7 +38,7 @@ struct imx_media_dev *imx_media_dev_init(struct device *dev) imxmd->v4l2_dev.mdev = &imxmd->md; imxmd->v4l2_dev.notify = imx_media_notify; - strlcpy(imxmd->v4l2_dev.name, "imx-media", + strscpy(imxmd->v4l2_dev.name, "imx-media", sizeof(imxmd->v4l2_dev.name)); media_device_init(&imxmd->md); diff --git a/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c b/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c index 57611464ad07..58721c46fba4 100644 --- a/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c +++ b/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c @@ -462,7 +462,7 @@ static int rockchip_vpu_probe(struct platform_device *pdev) } vpu->mdev.dev = vpu->dev; - strlcpy(vpu->mdev.model, DRIVER_NAME, sizeof(vpu->mdev.model)); + strscpy(vpu->mdev.model, DRIVER_NAME, sizeof(vpu->mdev.model)); media_device_init(&vpu->mdev); vpu->v4l2_dev.mdev = &vpu->mdev;
There are a few left overs at staging with were still using the deprecated strlcpy() function. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> --- drivers/staging/media/imx/imx-media-dev-common.c | 4 ++-- drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)