.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * CXL Flash Device Driver |
---|
3 | 4 | * |
---|
.. | .. |
---|
5 | 6 | * Matthew R. Ochs <mrochs@linux.vnet.ibm.com>, IBM Corporation |
---|
6 | 7 | * |
---|
7 | 8 | * 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. |
---|
13 | 9 | */ |
---|
14 | 10 | |
---|
15 | 11 | #include <linux/delay.h> |
---|
.. | .. |
---|
379 | 375 | switch (sshdr.sense_key) { |
---|
380 | 376 | case NO_SENSE: |
---|
381 | 377 | case RECOVERED_ERROR: |
---|
382 | | - /* fall through */ |
---|
383 | 378 | case NOT_READY: |
---|
384 | 379 | result &= ~SAM_STAT_CHECK_CONDITION; |
---|
385 | 380 | break; |
---|
386 | 381 | case UNIT_ATTENTION: |
---|
387 | 382 | switch (sshdr.asc) { |
---|
388 | 383 | case 0x29: /* Power on Reset or Device Reset */ |
---|
389 | | - /* fall through */ |
---|
| 384 | + fallthrough; |
---|
390 | 385 | case 0x2A: /* Device capacity changed */ |
---|
391 | 386 | case 0x3F: /* Report LUNs changed */ |
---|
392 | 387 | /* Retry the command once more */ |
---|
.. | .. |
---|
1795 | 1790 | switch (sshdr.sense_key) { |
---|
1796 | 1791 | case NO_SENSE: |
---|
1797 | 1792 | case RECOVERED_ERROR: |
---|
1798 | | - /* fall through */ |
---|
1799 | 1793 | case NOT_READY: |
---|
1800 | 1794 | break; |
---|
1801 | 1795 | case UNIT_ATTENTION: |
---|
1802 | 1796 | switch (sshdr.asc) { |
---|
1803 | 1797 | case 0x29: /* Power on Reset or Device Reset */ |
---|
1804 | | - /* fall through */ |
---|
| 1798 | + fallthrough; |
---|
1805 | 1799 | case 0x2A: /* Device settings/capacity changed */ |
---|
1806 | 1800 | rc = read_cap16(sdev, lli); |
---|
1807 | 1801 | if (rc) { |
---|
.. | .. |
---|
1924 | 1918 | * |
---|
1925 | 1919 | * Return: A string identifying the decoded ioctl. |
---|
1926 | 1920 | */ |
---|
1927 | | -static char *decode_ioctl(int cmd) |
---|
| 1921 | +static char *decode_ioctl(unsigned int cmd) |
---|
1928 | 1922 | { |
---|
1929 | 1923 | switch (cmd) { |
---|
1930 | 1924 | case DK_CXLFLASH_ATTACH: |
---|
.. | .. |
---|
2051 | 2045 | * |
---|
2052 | 2046 | * Return: 0 on success, -errno on failure |
---|
2053 | 2047 | */ |
---|
2054 | | -static int ioctl_common(struct scsi_device *sdev, int cmd) |
---|
| 2048 | +static int ioctl_common(struct scsi_device *sdev, unsigned int cmd) |
---|
2055 | 2049 | { |
---|
2056 | 2050 | struct cxlflash_cfg *cfg = shost_priv(sdev->host); |
---|
2057 | 2051 | struct device *dev = &cfg->dev->dev; |
---|
.. | .. |
---|
2096 | 2090 | * |
---|
2097 | 2091 | * Return: 0 on success, -errno on failure |
---|
2098 | 2092 | */ |
---|
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) |
---|
2100 | 2094 | { |
---|
2101 | 2095 | typedef int (*sioctl) (struct scsi_device *, void *); |
---|
2102 | 2096 | |
---|
.. | .. |
---|
2161 | 2155 | if (unlikely(rc)) |
---|
2162 | 2156 | goto cxlflash_ioctl_exit; |
---|
2163 | 2157 | |
---|
2164 | | - /* fall through */ |
---|
| 2158 | + fallthrough; |
---|
2165 | 2159 | |
---|
2166 | 2160 | case DK_CXLFLASH_MANAGE_LUN: |
---|
2167 | 2161 | known_ioctl = true; |
---|
.. | .. |
---|
2172 | 2166 | if (likely(do_ioctl)) |
---|
2173 | 2167 | break; |
---|
2174 | 2168 | |
---|
2175 | | - /* fall through */ |
---|
| 2169 | + fallthrough; |
---|
2176 | 2170 | default: |
---|
2177 | 2171 | rc = -EINVAL; |
---|
2178 | 2172 | goto cxlflash_ioctl_exit; |
---|
2179 | 2173 | } |
---|
2180 | 2174 | |
---|
2181 | 2175 | 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", |
---|
2184 | 2177 | __func__, size, cmd, decode_ioctl(cmd), arg); |
---|
2185 | 2178 | rc = -EFAULT; |
---|
2186 | 2179 | goto cxlflash_ioctl_exit; |
---|
.. | .. |
---|
2203 | 2196 | rc = do_ioctl(sdev, (void *)&buf); |
---|
2204 | 2197 | if (likely(!rc)) |
---|
2205 | 2198 | 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", |
---|
2208 | 2200 | __func__, size, cmd, decode_ioctl(cmd), arg); |
---|
2209 | 2201 | rc = -EFAULT; |
---|
2210 | 2202 | } |
---|