forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/scsi/cxlflash/superpipe.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * CXL Flash Device Driver
34 *
....@@ -5,11 +6,6 @@
56 * Matthew R. Ochs <mrochs@linux.vnet.ibm.com>, IBM Corporation
67 *
78 * Copyright (C) 2015 IBM Corporation
8
- *
9
- * This program is free software; you can redistribute it and/or
10
- * modify it under the terms of the GNU General Public License
11
- * as published by the Free Software Foundation; either version
12
- * 2 of the License, or (at your option) any later version.
139 */
1410
1511 #include <linux/delay.h>
....@@ -379,14 +375,13 @@
379375 switch (sshdr.sense_key) {
380376 case NO_SENSE:
381377 case RECOVERED_ERROR:
382
- /* fall through */
383378 case NOT_READY:
384379 result &= ~SAM_STAT_CHECK_CONDITION;
385380 break;
386381 case UNIT_ATTENTION:
387382 switch (sshdr.asc) {
388383 case 0x29: /* Power on Reset or Device Reset */
389
- /* fall through */
384
+ fallthrough;
390385 case 0x2A: /* Device capacity changed */
391386 case 0x3F: /* Report LUNs changed */
392387 /* Retry the command once more */
....@@ -1795,13 +1790,12 @@
17951790 switch (sshdr.sense_key) {
17961791 case NO_SENSE:
17971792 case RECOVERED_ERROR:
1798
- /* fall through */
17991793 case NOT_READY:
18001794 break;
18011795 case UNIT_ATTENTION:
18021796 switch (sshdr.asc) {
18031797 case 0x29: /* Power on Reset or Device Reset */
1804
- /* fall through */
1798
+ fallthrough;
18051799 case 0x2A: /* Device settings/capacity changed */
18061800 rc = read_cap16(sdev, lli);
18071801 if (rc) {
....@@ -1924,7 +1918,7 @@
19241918 *
19251919 * Return: A string identifying the decoded ioctl.
19261920 */
1927
-static char *decode_ioctl(int cmd)
1921
+static char *decode_ioctl(unsigned int cmd)
19281922 {
19291923 switch (cmd) {
19301924 case DK_CXLFLASH_ATTACH:
....@@ -2051,7 +2045,7 @@
20512045 *
20522046 * Return: 0 on success, -errno on failure
20532047 */
2054
-static int ioctl_common(struct scsi_device *sdev, int cmd)
2048
+static int ioctl_common(struct scsi_device *sdev, unsigned int cmd)
20552049 {
20562050 struct cxlflash_cfg *cfg = shost_priv(sdev->host);
20572051 struct device *dev = &cfg->dev->dev;
....@@ -2096,7 +2090,7 @@
20962090 *
20972091 * Return: 0 on success, -errno on failure
20982092 */
2099
-int cxlflash_ioctl(struct scsi_device *sdev, int cmd, void __user *arg)
2093
+int cxlflash_ioctl(struct scsi_device *sdev, unsigned int cmd, void __user *arg)
21002094 {
21012095 typedef int (*sioctl) (struct scsi_device *, void *);
21022096
....@@ -2161,7 +2155,7 @@
21612155 if (unlikely(rc))
21622156 goto cxlflash_ioctl_exit;
21632157
2164
- /* fall through */
2158
+ fallthrough;
21652159
21662160 case DK_CXLFLASH_MANAGE_LUN:
21672161 known_ioctl = true;
....@@ -2172,15 +2166,14 @@
21722166 if (likely(do_ioctl))
21732167 break;
21742168
2175
- /* fall through */
2169
+ fallthrough;
21762170 default:
21772171 rc = -EINVAL;
21782172 goto cxlflash_ioctl_exit;
21792173 }
21802174
21812175 if (unlikely(copy_from_user(&buf, arg, size))) {
2182
- dev_err(dev, "%s: copy_from_user() fail "
2183
- "size=%lu cmd=%d (%s) arg=%p\n",
2176
+ dev_err(dev, "%s: copy_from_user() fail size=%lu cmd=%u (%s) arg=%p\n",
21842177 __func__, size, cmd, decode_ioctl(cmd), arg);
21852178 rc = -EFAULT;
21862179 goto cxlflash_ioctl_exit;
....@@ -2203,8 +2196,7 @@
22032196 rc = do_ioctl(sdev, (void *)&buf);
22042197 if (likely(!rc))
22052198 if (unlikely(copy_to_user(arg, &buf, size))) {
2206
- dev_err(dev, "%s: copy_to_user() fail "
2207
- "size=%lu cmd=%d (%s) arg=%p\n",
2199
+ dev_err(dev, "%s: copy_to_user() fail size=%lu cmd=%u (%s) arg=%p\n",
22082200 __func__, size, cmd, decode_ioctl(cmd), arg);
22092201 rc = -EFAULT;
22102202 }