diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2018-05-14 09:09:37 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-05-25 15:34:04 -0400 |
commit | df2b23861878f0128083f0d328ca2cfc6e721120 (patch) | |
tree | c677617b6cdbdebe361c2ca848cbf9eee1cb2fb1 /drivers/media/platform/soc_camera/soc_camera_platform.c | |
parent | 660f059782616aa883bd4e16dbb3c56961275c4e (diff) |
media: soc_camera: fix compiler warning
In function 'strncpy',
inlined from 'soc_camera_platform_probe' at drivers/media/platform/soc_camera/soc_camera_platform.c:162:2:
include/linux/string.h:246:9: warning: '__builtin_strncpy' specified bound 32 equals destination size [-Wstringop-truncation]
return __builtin_strncpy(p, q, size);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/platform/soc_camera/soc_camera_platform.c')
-rw-r--r-- | drivers/media/platform/soc_camera/soc_camera_platform.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/platform/soc_camera/soc_camera_platform.c b/drivers/media/platform/soc_camera/soc_camera_platform.c index cb4986b8f798..ce00e90d4e3c 100644 --- a/drivers/media/platform/soc_camera/soc_camera_platform.c +++ b/drivers/media/platform/soc_camera/soc_camera_platform.c @@ -159,7 +159,8 @@ static int soc_camera_platform_probe(struct platform_device *pdev) v4l2_subdev_init(&priv->subdev, &platform_subdev_ops); v4l2_set_subdevdata(&priv->subdev, p); - strncpy(priv->subdev.name, dev_name(&pdev->dev), V4L2_SUBDEV_NAME_SIZE); + strlcpy(priv->subdev.name, dev_name(&pdev->dev), + sizeof(priv->subdev.name)); return v4l2_device_register_subdev(&ici->v4l2_dev, &priv->subdev); } |