v4l2_subdev_init(sd, &file_input_ops);
sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
- strcpy(sd->name, "file_input_subdev");
+ strscpy(sd->name, "file_input_subdev", sizeof(sd->name));
v4l2_set_subdevdata(sd, file_dev);
pads[0].flags = MEDIA_PAD_FL_SINK;
if (vl > *out_len - 1)
return -ENOSPC;
- strcpy(out, gv->val);
+ strscpy(out, gv->val, *out_len);
*out_len = vl;
return 0;
}
struct video_device *vdev = video_devdata(file);
struct atomisp_device *isp = video_get_drvdata(vdev);
- strscpy(cap->driver, DRIVER, sizeof(cap->driver) - 1);
- strscpy(cap->card, CARD, sizeof(cap->card) - 1);
+ strscpy(cap->driver, DRIVER, sizeof(cap->driver));
+ strscpy(cap->card, CARD, sizeof(cap->card));
snprintf(cap->bus_info, sizeof(cap->bus_info), "PCI:%s",
pci_name(isp->pdev));
return -EINVAL;
memset(input, 0, sizeof(struct v4l2_input));
- strncpy(input->name, isp->inputs[index].camera->name,
- sizeof(input->name) - 1);
+ strscpy(input->name, isp->inputs[index].camera->name,
+ sizeof(input->name));
/*
* HACK: append actuator's name to sensor's
if (max_size > 1) {
input->name[cur_len] = '+';
- strncpy(&input->name[cur_len + 1],
- motor->name, max_size - 1);
+ strscpy(&input->name[cur_len + 1],
+ motor->name, max_size);
}
}
tpg->isp = isp;
v4l2_subdev_init(sd, &tpg_ops);
sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
- strcpy(sd->name, "tpg_subdev");
+ strscpy(sd->name, "tpg_subdev", sizeof(sd->name));
v4l2_set_subdevdata(sd, tpg);
pads[0].flags = MEDIA_PAD_FL_SINK;
),
TP_fast_assign(
- strlcpy(__entry->name, name, 24);
+ strscpy(__entry->name, name, 24);
__entry->uptr_size = uptr_size;
__entry->counter = counter;
__entry->sys_size = sys_size;
),
TP_fast_assign(
- strlcpy(__entry->name, name, 24);
- strlcpy(__entry->info, info, 24);
+ strscpy(__entry->name, name, 24);
+ strscpy(__entry->info, info, 24);
__entry->line = line;
),
isp->media_dev.dev = isp->dev;
- strlcpy(isp->media_dev.model, "Intel Atom ISP",
+ strscpy(isp->media_dev.model, "Intel Atom ISP",
sizeof(isp->media_dev.model));
media_device_init(&isp->media_dev);
/* Make sure binary name is smaller than allowed string size */
assert(strlen(binary_name) < SH_CSS_MAX_BINARY_NAME - 1);
- strncpy(sh_css_isp_stage.binary_name, binary_name, SH_CSS_MAX_BINARY_NAME - 1);
- sh_css_isp_stage.binary_name[SH_CSS_MAX_BINARY_NAME - 1] = 0;
+ strscpy(sh_css_isp_stage.binary_name, binary_name, SH_CSS_MAX_BINARY_NAME);
sh_css_isp_stage.mem_initializers = *isp_mem_if;
/*
if (max_size <= (int)strlen(css_version) + (int)strlen(sh_css_get_fw_version()) + 5)
return -EINVAL;
- strcpy(version, css_version);
+ strscpy(version, css_version, max_size);
strcat(version, "FW:");
strcat(version, sh_css_get_fw_version());
strcat(version, "; ");