* [PATCH resend] uvc: strncpy -> strscpy
@ 2021-02-01 8:40 Hans Verkuil
2021-02-04 15:26 ` Laurent Pinchart
0 siblings, 1 reply; 2+ messages in thread
From: Hans Verkuil @ 2021-02-01 8:40 UTC (permalink / raw)
To: Linux Media Mailing List; +Cc: Laurent Pinchart
The use of strncpy is discouraged, use strscpy instead.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
---
diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index 1abc122a0977..30ef2a3110f7 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -1553,7 +1553,7 @@ static int uvc_gpio_parse(struct uvc_device *dev)
unit->gpio.bmControls[0] = 1;
unit->get_cur = uvc_gpio_get_cur;
unit->get_info = uvc_gpio_get_info;
- strncpy(unit->name, "GPIO", sizeof(unit->name) - 1);
+ strscpy(unit->name, "GPIO", sizeof(unit->name));
list_add_tail(&unit->list, &dev->entities);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH resend] uvc: strncpy -> strscpy
2021-02-01 8:40 [PATCH resend] uvc: strncpy -> strscpy Hans Verkuil
@ 2021-02-04 15:26 ` Laurent Pinchart
0 siblings, 0 replies; 2+ messages in thread
From: Laurent Pinchart @ 2021-02-04 15:26 UTC (permalink / raw)
To: Hans Verkuil; +Cc: Linux Media Mailing List
Hi Hans,
Thank you for the patch.
On Mon, Feb 01, 2021 at 09:40:56AM +0100, Hans Verkuil wrote:
> The use of strncpy is discouraged, use strscpy instead.
>
> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Please feel free to pick this patch for your fixes pull request as I
have no other pending UVC patches.
> ---
> diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
> index 1abc122a0977..30ef2a3110f7 100644
> --- a/drivers/media/usb/uvc/uvc_driver.c
> +++ b/drivers/media/usb/uvc/uvc_driver.c
> @@ -1553,7 +1553,7 @@ static int uvc_gpio_parse(struct uvc_device *dev)
> unit->gpio.bmControls[0] = 1;
> unit->get_cur = uvc_gpio_get_cur;
> unit->get_info = uvc_gpio_get_info;
> - strncpy(unit->name, "GPIO", sizeof(unit->name) - 1);
> + strscpy(unit->name, "GPIO", sizeof(unit->name));
>
> list_add_tail(&unit->list, &dev->entities);
>
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-02-04 15:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-01 8:40 [PATCH resend] uvc: strncpy -> strscpy Hans Verkuil
2021-02-04 15:26 ` Laurent Pinchart
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.