| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* Linux driver for Philips webcam |
|---|
| 2 | 3 | USB and Video4Linux interface part. |
|---|
| 3 | 4 | (C) 1999-2004 Nemosoft Unv. |
|---|
| .. | .. |
|---|
| 10 | 11 | The decompression routines have been implemented by reverse-engineering the |
|---|
| 11 | 12 | Nemosoft binary pwcx module. Caveat emptor. |
|---|
| 12 | 13 | |
|---|
| 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 |
|---|
| 26 | 14 | |
|---|
| 27 | 15 | */ |
|---|
| 28 | 16 | |
|---|
| .. | .. |
|---|
| 492 | 480 | { |
|---|
| 493 | 481 | struct pwc_device *pdev = video_drvdata(file); |
|---|
| 494 | 482 | |
|---|
| 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)); |
|---|
| 497 | 485 | 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; |
|---|
| 501 | 486 | return 0; |
|---|
| 502 | 487 | } |
|---|
| 503 | 488 | |
|---|
| .. | .. |
|---|
| 506 | 491 | if (i->index) /* Only one INPUT is supported */ |
|---|
| 507 | 492 | return -EINVAL; |
|---|
| 508 | 493 | |
|---|
| 509 | | - strlcpy(i->name, "Camera", sizeof(i->name)); |
|---|
| 494 | + strscpy(i->name, "Camera", sizeof(i->name)); |
|---|
| 510 | 495 | i->type = V4L2_INPUT_TYPE_CAMERA; |
|---|
| 511 | 496 | return 0; |
|---|
| 512 | 497 | } |
|---|
| .. | .. |
|---|
| 569 | 554 | if (!DEVICE_USE_CODEC3(pdev->type)) |
|---|
| 570 | 555 | break; |
|---|
| 571 | 556 | /* For CODEC3 where autogain also controls expo */ |
|---|
| 572 | | - /* fall through */ |
|---|
| 557 | + fallthrough; |
|---|
| 573 | 558 | case V4L2_CID_EXPOSURE_AUTO: |
|---|
| 574 | 559 | if (pdev->exposure_valid && time_before(jiffies, |
|---|
| 575 | 560 | pdev->last_exposure_update + HZ / 4)) { |
|---|
| .. | .. |
|---|
| 888 | 873 | case 0: |
|---|
| 889 | 874 | /* RAW format */ |
|---|
| 890 | 875 | 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)); |
|---|
| 893 | 876 | break; |
|---|
| 894 | 877 | case 1: |
|---|
| 895 | 878 | f->pixelformat = V4L2_PIX_FMT_YUV420; |
|---|
| 896 | | - strlcpy(f->description, "4:2:0, planar, Y-Cb-Cr", sizeof(f->description)); |
|---|
| 897 | 879 | break; |
|---|
| 898 | 880 | default: |
|---|
| 899 | 881 | return -EINVAL; |
|---|