aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-04-26 07:51:51 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-29 17:41:34 -0400
commitcebfadff4a5c877c524ae6014613edab9f50a2a9 (patch)
treef6cf91e323d4d9a90ba60868aceaf601796ff8e6 /drivers/media/video
parentecfcc83b8d6ff8ac65b072b309a1774ca52d955e (diff)
V4L/DVB (7756): ivtv: use strlcpy instead of strcpy
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/ivtv/ivtv-cards.c10
-rw-r--r--drivers/media/video/ivtv/ivtv-i2c.c3
-rw-r--r--drivers/media/video/ivtv/ivtv-ioctl.c13
-rw-r--r--drivers/media/video/ivtv/ivtvfb.c2
4 files changed, 15 insertions, 13 deletions
diff --git a/drivers/media/video/ivtv/ivtv-cards.c b/drivers/media/video/ivtv/ivtv-cards.c
index bf9b32a6c1ad..33a2f58f66d7 100644
--- a/drivers/media/video/ivtv/ivtv-cards.c
+++ b/drivers/media/video/ivtv/ivtv-cards.c
@@ -1122,7 +1122,8 @@ int ivtv_get_input(struct ivtv *itv, u16 index, struct v4l2_input *input)
1122 if (index >= itv->nof_inputs) 1122 if (index >= itv->nof_inputs)
1123 return -EINVAL; 1123 return -EINVAL;
1124 input->index = index; 1124 input->index = index;
1125 strcpy(input->name, input_strs[card_input->video_type - 1]); 1125 strlcpy(input->name, input_strs[card_input->video_type - 1],
1126 sizeof(input->name));
1126 input->type = (card_input->video_type == IVTV_CARD_INPUT_VID_TUNER ? 1127 input->type = (card_input->video_type == IVTV_CARD_INPUT_VID_TUNER ?
1127 V4L2_INPUT_TYPE_TUNER : V4L2_INPUT_TYPE_CAMERA); 1128 V4L2_INPUT_TYPE_TUNER : V4L2_INPUT_TYPE_CAMERA);
1128 input->audioset = (1 << itv->nof_audio_inputs) - 1; 1129 input->audioset = (1 << itv->nof_audio_inputs) - 1;
@@ -1139,7 +1140,7 @@ int ivtv_get_output(struct ivtv *itv, u16 index, struct v4l2_output *output)
1139 if (index >= itv->card->nof_outputs) 1140 if (index >= itv->card->nof_outputs)
1140 return -EINVAL; 1141 return -EINVAL;
1141 output->index = index; 1142 output->index = index;
1142 strcpy(output->name, card_output->name); 1143 strlcpy(output->name, card_output->name, sizeof(output->name));
1143 output->type = V4L2_OUTPUT_TYPE_ANALOG; 1144 output->type = V4L2_OUTPUT_TYPE_ANALOG;
1144 output->audioset = 1; 1145 output->audioset = 1;
1145 output->std = V4L2_STD_ALL; 1146 output->std = V4L2_STD_ALL;
@@ -1158,7 +1159,8 @@ int ivtv_get_audio_input(struct ivtv *itv, u16 index, struct v4l2_audio *audio)
1158 memset(audio, 0, sizeof(*audio)); 1159 memset(audio, 0, sizeof(*audio));
1159 if (index >= itv->nof_audio_inputs) 1160 if (index >= itv->nof_audio_inputs)
1160 return -EINVAL; 1161 return -EINVAL;
1161 strcpy(audio->name, input_strs[aud_input->audio_type - 1]); 1162 strlcpy(audio->name, input_strs[aud_input->audio_type - 1],
1163 sizeof(audio->name));
1162 audio->index = index; 1164 audio->index = index;
1163 audio->capability = V4L2_AUDCAP_STEREO; 1165 audio->capability = V4L2_AUDCAP_STEREO;
1164 return 0; 1166 return 0;
@@ -1169,6 +1171,6 @@ int ivtv_get_audio_output(struct ivtv *itv, u16 index, struct v4l2_audioout *aud
1169 memset(aud_output, 0, sizeof(*aud_output)); 1171 memset(aud_output, 0, sizeof(*aud_output));
1170 if (itv->card->video_outputs == NULL || index != 0) 1172 if (itv->card->video_outputs == NULL || index != 0)
1171 return -EINVAL; 1173 return -EINVAL;
1172 strcpy(aud_output->name, "A/V Audio Out"); 1174 strlcpy(aud_output->name, "A/V Audio Out", sizeof(aud_output->name));
1173 return 0; 1175 return 0;
1174} 1176}
diff --git a/drivers/media/video/ivtv/ivtv-i2c.c b/drivers/media/video/ivtv/ivtv-i2c.c
index 9824eafee021..771adf47e944 100644
--- a/drivers/media/video/ivtv/ivtv-i2c.c
+++ b/drivers/media/video/ivtv/ivtv-i2c.c
@@ -167,7 +167,8 @@ int ivtv_i2c_register(struct ivtv *itv, unsigned idx)
167 return -1; 167 return -1;
168 id = hw_driverids[idx]; 168 id = hw_driverids[idx];
169 memset(&info, 0, sizeof(info)); 169 memset(&info, 0, sizeof(info));
170 strcpy(info.driver_name, hw_drivernames[idx]); 170 strlcpy(info.driver_name, hw_drivernames[idx],
171 sizeof(info.driver_name));
171 info.addr = hw_addrs[idx]; 172 info.addr = hw_addrs[idx];
172 for (i = 0; itv->i2c_clients[i] && i < I2C_CLIENTS_MAX; i++) {} 173 for (i = 0; itv->i2c_clients[i] && i < I2C_CLIENTS_MAX; i++) {}
173 174
diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c
index 15cac1812122..6282387ca05c 100644
--- a/drivers/media/video/ivtv/ivtv-ioctl.c
+++ b/drivers/media/video/ivtv/ivtv-ioctl.c
@@ -741,10 +741,9 @@ int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, unsigned int cmd, void
741 struct v4l2_capability *vcap = arg; 741 struct v4l2_capability *vcap = arg;
742 742
743 memset(vcap, 0, sizeof(*vcap)); 743 memset(vcap, 0, sizeof(*vcap));
744 strcpy(vcap->driver, IVTV_DRIVER_NAME); /* driver name */ 744 strlcpy(vcap->driver, IVTV_DRIVER_NAME, sizeof(vcap->driver));
745 strncpy(vcap->card, itv->card_name, 745 strlcpy(vcap->card, itv->card_name, sizeof(vcap->card));
746 sizeof(vcap->card)-1); /* card type */ 746 strlcpy(vcap->bus_info, pci_name(itv->dev), sizeof(vcap->bus_info));
747 strcpy(vcap->bus_info, pci_name(itv->dev)); /* bus info... */
748 vcap->version = IVTV_DRIVER_VERSION; /* version */ 747 vcap->version = IVTV_DRIVER_VERSION; /* version */
749 vcap->capabilities = itv->v4l2_cap; /* capabilities */ 748 vcap->capabilities = itv->v4l2_cap; /* capabilities */
750 749
@@ -1018,7 +1017,7 @@ int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, unsigned int cmd, void
1018 ivtv_std_60hz : ivtv_std_50hz; 1017 ivtv_std_60hz : ivtv_std_50hz;
1019 vs->index = idx; 1018 vs->index = idx;
1020 vs->id = enum_stds[idx].std; 1019 vs->id = enum_stds[idx].std;
1021 strcpy(vs->name, enum_stds[idx].name); 1020 strlcpy(vs->name, enum_stds[idx].name, sizeof(vs->name));
1022 break; 1021 break;
1023 } 1022 }
1024 1023
@@ -1102,10 +1101,10 @@ int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, unsigned int cmd, void
1102 ivtv_call_i2c_clients(itv, VIDIOC_G_TUNER, vt); 1101 ivtv_call_i2c_clients(itv, VIDIOC_G_TUNER, vt);
1103 1102
1104 if (test_bit(IVTV_F_I_RADIO_USER, &itv->i_flags)) { 1103 if (test_bit(IVTV_F_I_RADIO_USER, &itv->i_flags)) {
1105 strcpy(vt->name, "ivtv Radio Tuner"); 1104 strlcpy(vt->name, "ivtv Radio Tuner", sizeof(vt->name));
1106 vt->type = V4L2_TUNER_RADIO; 1105 vt->type = V4L2_TUNER_RADIO;
1107 } else { 1106 } else {
1108 strcpy(vt->name, "ivtv TV Tuner"); 1107 strlcpy(vt->name, "ivtv TV Tuner", sizeof(vt->name));
1109 vt->type = V4L2_TUNER_ANALOG_TV; 1108 vt->type = V4L2_TUNER_ANALOG_TV;
1110 } 1109 }
1111 break; 1110 break;
diff --git a/drivers/media/video/ivtv/ivtvfb.c b/drivers/media/video/ivtv/ivtvfb.c
index 3b23fc05f7c4..df789f683e63 100644
--- a/drivers/media/video/ivtv/ivtvfb.c
+++ b/drivers/media/video/ivtv/ivtvfb.c
@@ -532,7 +532,7 @@ static int ivtvfb_get_fix(struct ivtv *itv, struct fb_fix_screeninfo *fix)
532 532
533 IVTVFB_DEBUG_INFO("ivtvfb_get_fix\n"); 533 IVTVFB_DEBUG_INFO("ivtvfb_get_fix\n");
534 memset(fix, 0, sizeof(struct fb_fix_screeninfo)); 534 memset(fix, 0, sizeof(struct fb_fix_screeninfo));
535 strcpy(fix->id, "cx23415 TV out"); 535 strlcpy(fix->id, "cx23415 TV out", sizeof(fix->id));
536 fix->smem_start = oi->video_pbase; 536 fix->smem_start = oi->video_pbase;
537 fix->smem_len = oi->video_buffer_size; 537 fix->smem_len = oi->video_buffer_size;
538 fix->type = FB_TYPE_PACKED_PIXELS; 538 fix->type = FB_TYPE_PACKED_PIXELS;