hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/media/usb/pwc/pwc-v4l.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /* Linux driver for Philips webcam
23 USB and Video4Linux interface part.
34 (C) 1999-2004 Nemosoft Unv.
....@@ -10,19 +11,6 @@
1011 The decompression routines have been implemented by reverse-engineering the
1112 Nemosoft binary pwcx module. Caveat emptor.
1213
13
- This program is free software; you can redistribute it and/or modify
14
- it under the terms of the GNU General Public License as published by
15
- the Free Software Foundation; either version 2 of the License, or
16
- (at your option) any later version.
17
-
18
- This program is distributed in the hope that it will be useful,
19
- but WITHOUT ANY WARRANTY; without even the implied warranty of
20
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
- GNU General Public License for more details.
22
-
23
- You should have received a copy of the GNU General Public License
24
- along with this program; if not, write to the Free Software
25
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2614
2715 */
2816
....@@ -492,12 +480,9 @@
492480 {
493481 struct pwc_device *pdev = video_drvdata(file);
494482
495
- strcpy(cap->driver, PWC_NAME);
496
- strlcpy(cap->card, pdev->vdev.name, sizeof(cap->card));
483
+ strscpy(cap->driver, PWC_NAME, sizeof(cap->driver));
484
+ strscpy(cap->card, pdev->vdev.name, sizeof(cap->card));
497485 usb_make_path(pdev->udev, cap->bus_info, sizeof(cap->bus_info));
498
- cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING |
499
- V4L2_CAP_READWRITE;
500
- cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
501486 return 0;
502487 }
503488
....@@ -506,7 +491,7 @@
506491 if (i->index) /* Only one INPUT is supported */
507492 return -EINVAL;
508493
509
- strlcpy(i->name, "Camera", sizeof(i->name));
494
+ strscpy(i->name, "Camera", sizeof(i->name));
510495 i->type = V4L2_INPUT_TYPE_CAMERA;
511496 return 0;
512497 }
....@@ -569,7 +554,7 @@
569554 if (!DEVICE_USE_CODEC3(pdev->type))
570555 break;
571556 /* For CODEC3 where autogain also controls expo */
572
- /* fall through */
557
+ fallthrough;
573558 case V4L2_CID_EXPOSURE_AUTO:
574559 if (pdev->exposure_valid && time_before(jiffies,
575560 pdev->last_exposure_update + HZ / 4)) {
....@@ -888,12 +873,9 @@
888873 case 0:
889874 /* RAW format */
890875 f->pixelformat = pdev->type <= 646 ? V4L2_PIX_FMT_PWC1 : V4L2_PIX_FMT_PWC2;
891
- f->flags = V4L2_FMT_FLAG_COMPRESSED;
892
- strlcpy(f->description, "Raw Philips Webcam", sizeof(f->description));
893876 break;
894877 case 1:
895878 f->pixelformat = V4L2_PIX_FMT_YUV420;
896
- strlcpy(f->description, "4:2:0, planar, Y-Cb-Cr", sizeof(f->description));
897879 break;
898880 default:
899881 return -EINVAL;