diff options
author | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-09-10 16:20:42 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-09-11 13:32:17 -0400 |
commit | cc1e6315e83db0e517dd9279050b88adc83a7eba (patch) | |
tree | 2fab5c7b2a4f3f50a045357a41c419fccc975de2 /drivers/media/i2c | |
parent | c0decac19da3906d9b66291e57b7759489e1170f (diff) |
media: replace strcpy() by strscpy()
The strcpy() function is being deprecated upstream. Replace
it by the safer strscpy().
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/i2c')
-rw-r--r-- | drivers/media/i2c/ad5820.c | 2 | ||||
-rw-r--r-- | drivers/media/i2c/lm3560.c | 3 | ||||
-rw-r--r-- | drivers/media/i2c/lm3646.c | 3 | ||||
-rw-r--r-- | drivers/media/i2c/s5c73m3/s5c73m3-core.c | 2 | ||||
-rw-r--r-- | drivers/media/i2c/sr030pc30.c | 2 |
5 files changed, 7 insertions, 5 deletions
diff --git a/drivers/media/i2c/ad5820.c b/drivers/media/i2c/ad5820.c index 034ebf754007..907323f0ca3b 100644 --- a/drivers/media/i2c/ad5820.c +++ b/drivers/media/i2c/ad5820.c @@ -317,7 +317,7 @@ static int ad5820_probe(struct i2c_client *client, v4l2_i2c_subdev_init(&coil->subdev, client, &ad5820_ops); coil->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; coil->subdev.internal_ops = &ad5820_internal_ops; - strcpy(coil->subdev.name, "ad5820 focus"); + strscpy(coil->subdev.name, "ad5820 focus", sizeof(coil->subdev.name)); ret = media_entity_pads_init(&coil->subdev.entity, 0, NULL); if (ret < 0) diff --git a/drivers/media/i2c/lm3560.c b/drivers/media/i2c/lm3560.c index 49c6644cbba7..f122f03bd6b7 100644 --- a/drivers/media/i2c/lm3560.c +++ b/drivers/media/i2c/lm3560.c @@ -362,7 +362,8 @@ static int lm3560_subdev_init(struct lm3560_flash *flash, v4l2_i2c_subdev_init(&flash->subdev_led[led_no], client, &lm3560_ops); flash->subdev_led[led_no].flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; - strcpy(flash->subdev_led[led_no].name, led_name); + strscpy(flash->subdev_led[led_no].name, led_name, + sizeof(flash->subdev_led[led_no].name)); rval = lm3560_init_controls(flash, led_no); if (rval) goto err_out; diff --git a/drivers/media/i2c/lm3646.c b/drivers/media/i2c/lm3646.c index 7e9967af36ec..12ef2653987b 100644 --- a/drivers/media/i2c/lm3646.c +++ b/drivers/media/i2c/lm3646.c @@ -278,7 +278,8 @@ static int lm3646_subdev_init(struct lm3646_flash *flash) v4l2_i2c_subdev_init(&flash->subdev_led, client, &lm3646_ops); flash->subdev_led.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; - strcpy(flash->subdev_led.name, LM3646_NAME); + strscpy(flash->subdev_led.name, LM3646_NAME, + sizeof(flash->subdev_led.name)); rval = lm3646_init_controls(flash); if (rval) goto err_out; diff --git a/drivers/media/i2c/s5c73m3/s5c73m3-core.c b/drivers/media/i2c/s5c73m3/s5c73m3-core.c index 9ca9b3997073..21ca5186f9ed 100644 --- a/drivers/media/i2c/s5c73m3/s5c73m3-core.c +++ b/drivers/media/i2c/s5c73m3/s5c73m3-core.c @@ -1698,7 +1698,7 @@ static int s5c73m3_probe(struct i2c_client *client, return ret; v4l2_i2c_subdev_init(oif_sd, client, &oif_subdev_ops); - strcpy(oif_sd->name, "S5C73M3-OIF"); + strscpy(oif_sd->name, "S5C73M3-OIF", sizeof(oif_sd->name)); oif_sd->internal_ops = &oif_internal_ops; oif_sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; diff --git a/drivers/media/i2c/sr030pc30.c b/drivers/media/i2c/sr030pc30.c index 2a4882cddc51..344666293f7d 100644 --- a/drivers/media/i2c/sr030pc30.c +++ b/drivers/media/i2c/sr030pc30.c @@ -703,7 +703,7 @@ static int sr030pc30_probe(struct i2c_client *client, return -ENOMEM; sd = &info->sd; - strcpy(sd->name, MODULE_NAME); + strscpy(sd->name, MODULE_NAME, sizeof(sd->name)); info->pdata = client->dev.platform_data; v4l2_i2c_subdev_init(sd, client, &sr030pc30_ops); |