forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 95099d4622f8cb224d94e314c7a8e0df60b13f87
kernel/drivers/media/usb/siano/smsusb.c
....@@ -1,21 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /****************************************************************
23
34 Siano Mobile Silicon, Inc.
45 MDTV receiver kernel modules.
56 Copyright (C) 2005-2009, Uri Shkolnik, Anatoly Greenblat
67
7
-This program is free software: you can redistribute it and/or modify
8
-it under the terms of the GNU General Public License as published by
9
-the Free Software Foundation, either version 2 of the License, or
10
-(at your option) any later version.
11
-
12
- This program is distributed in the hope that it will be useful,
13
-but WITHOUT ANY WARRANTY; without even the implied warranty of
14
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
-GNU General Public License for more details.
16
-
17
-You should have received a copy of the GNU General Public License
18
-along with this program. If not, see <http://www.gnu.org/licenses/>.
198
209 ****************************************************************/
2110
....@@ -75,7 +64,7 @@
7564 struct smsusb_urb_t *surb);
7665
7766 /*
78
- * Completing URB's callback handler - bottom half (proccess context)
67
+ * Completing URB's callback handler - bottom half (process context)
7968 * submits the URB prepared on smsusb_onresponse()
8069 */
8170 static void do_submit_urb(struct work_struct *work)
....@@ -225,10 +214,9 @@
225214 return -ENOENT;
226215 }
227216
228
- phdr = kmalloc(size, GFP_KERNEL);
217
+ phdr = kmemdup(buffer, size, GFP_KERNEL);
229218 if (!phdr)
230219 return -ENOMEM;
231
- memcpy(phdr, buffer, size);
232220
233221 pr_debug("sending %s(%d) size: %d\n",
234222 smscore_translate_msg(phdr->msg_type), phdr->msg_type,
....@@ -442,7 +430,7 @@
442430 break;
443431 case SMS_UNKNOWN_TYPE:
444432 pr_err("Unspecified sms device type!\n");
445
- /* fall-thru */
433
+ fallthrough;
446434 default:
447435 dev->buffer_size = USB2_BUFFER_SIZE;
448436 dev->response_alignment = align;