X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fmedia%2Fvideo%2Fcpia.c;h=78c9699eafbbe46e791cc7c228c413b47182394c;hb=b7a01e723c9edaefcadb99d42c1409371c01dde1;hp=95c5aceecc5bb9566f64887d805713d4cfc28286;hpb=1d77062b1402aef5b26e1d3776991126e8026bde;p=linux-2.6-omap-h63xx.git diff --git a/drivers/media/video/cpia.c b/drivers/media/video/cpia.c index 95c5aceecc5..78c9699eafb 100644 --- a/drivers/media/video/cpia.c +++ b/drivers/media/video/cpia.c @@ -26,7 +26,6 @@ /* define _CPIA_DEBUG_ for verbose debug output (see cpia.h) */ /* #define _CPIA_DEBUG_ 1 */ -#include #include #include @@ -1351,13 +1350,13 @@ out: static void create_proc_cpia_cam(struct cam_data *cam) { - char name[7]; + char name[5 + 1 + 10 + 1]; struct proc_dir_entry *ent; if (!cpia_proc_root || !cam) return; - sprintf(name, "video%d", cam->vdev.minor); + snprintf(name, sizeof(name), "video%d", cam->vdev.minor); ent = create_proc_entry(name, S_IFREG|S_IRUGO|S_IWUSR, cpia_proc_root); if (!ent) @@ -1377,12 +1376,12 @@ static void create_proc_cpia_cam(struct cam_data *cam) static void destroy_proc_cpia_cam(struct cam_data *cam) { - char name[7]; + char name[5 + 1 + 10 + 1]; if (!cam || !cam->proc_entry) return; - sprintf(name, "video%d", cam->vdev.minor); + snprintf(name, sizeof(name), "video%d", cam->vdev.minor); remove_proc_entry(name, cpia_proc_root); cam->proc_entry = NULL; } @@ -3154,8 +3153,7 @@ static int reset_camera(struct cam_data *cam) static void put_cam(struct cpia_camera_ops* ops) { - if (ops->owner) - module_put(ops->owner); + module_put(ops->owner); } /* ------------------------- V4L interface --------------------- */ @@ -3792,7 +3790,7 @@ static int cpia_mmap(struct file *file, struct vm_area_struct *vma) return 0; } -static struct file_operations cpia_fops = { +static const struct file_operations cpia_fops = { .owner = THIS_MODULE, .open = cpia_open, .release = cpia_close,