hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/drivers/scsi/cxlflash/main.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>
....@@ -48,14 +44,9 @@
4844 struct afu *afu = cmd->parent;
4945 struct cxlflash_cfg *cfg = afu->parent;
5046 struct device *dev = &cfg->dev->dev;
51
- struct sisl_ioarcb *ioarcb;
5247 struct sisl_ioasa *ioasa;
5348 u32 resid;
5449
55
- if (unlikely(!cmd))
56
- return;
57
-
58
- ioarcb = &(cmd->rcb);
5950 ioasa = &(cmd->sa);
6051
6152 if (ioasa->rc.flags & SISL_RC_FLAGS_UNDERRUN) {
....@@ -757,13 +748,16 @@
757748 /* SISL_MSI_ASYNC_ERROR is setup only for the primary HWQ */
758749 if (index == PRIMARY_HWQ)
759750 cfg->ops->unmap_afu_irq(hwq->ctx_cookie, 3, hwq);
751
+ fallthrough;
760752 case UNMAP_TWO:
761753 cfg->ops->unmap_afu_irq(hwq->ctx_cookie, 2, hwq);
754
+ fallthrough;
762755 case UNMAP_ONE:
763756 cfg->ops->unmap_afu_irq(hwq->ctx_cookie, 1, hwq);
757
+ fallthrough;
764758 case FREE_IRQ:
765759 cfg->ops->free_afu_irqs(hwq->ctx_cookie);
766
- /* fall through */
760
+ fallthrough;
767761 case UNDO_NOOP:
768762 /* No action required */
769763 break;
....@@ -977,14 +971,18 @@
977971 switch (cfg->init_state) {
978972 case INIT_STATE_CDEV:
979973 cxlflash_release_chrdev(cfg);
974
+ fallthrough;
980975 case INIT_STATE_SCSI:
981976 cxlflash_term_local_luns(cfg);
982977 scsi_remove_host(cfg->host);
978
+ fallthrough;
983979 case INIT_STATE_AFU:
984980 term_afu(cfg);
981
+ fallthrough;
985982 case INIT_STATE_PCI:
986983 cfg->ops->destroy_afu(cfg->afu_cookie);
987984 pci_disable_device(pdev);
985
+ fallthrough;
988986 case INIT_STATE_NONE:
989987 free_mem(cfg);
990988 scsi_host_put(cfg->host);
....@@ -2357,11 +2355,11 @@
23572355 cxlflash_schedule_async_reset(cfg);
23582356 break;
23592357 }
2360
- /* fall through to retry */
2358
+ fallthrough; /* to retry */
23612359 case -EAGAIN:
23622360 if (++nretry < 2)
23632361 goto retry;
2364
- /* fall through to exit */
2362
+ fallthrough; /* to exit */
23652363 default:
23662364 break;
23672365 }
....@@ -2535,12 +2533,12 @@
25352533 cfg->state = STATE_NORMAL;
25362534 wake_up_all(&cfg->reset_waitq);
25372535 ssleep(1);
2538
- /* fall through */
2536
+ fallthrough;
25392537 case STATE_RESET:
25402538 wait_event(cfg->reset_waitq, cfg->state != STATE_RESET);
25412539 if (cfg->state == STATE_NORMAL)
25422540 break;
2543
- /* fall through */
2541
+ fallthrough;
25442542 default:
25452543 rc = FAILED;
25462544 break;
....@@ -3021,6 +3019,7 @@
30213019 wait_event(cfg->reset_waitq, cfg->state != STATE_RESET);
30223020 if (cfg->state == STATE_NORMAL)
30233021 goto retry;
3022
+ fallthrough;
30243023 default:
30253024 /* Ideally should not happen */
30263025 dev_err(dev, "%s: Device is not ready, state=%d\n",
....@@ -3085,12 +3084,6 @@
30853084
30863085 if (mode >= MAX_HWQ_MODE) {
30873086 dev_info(cfgdev, "Invalid HWQ steering mode.\n");
3088
- return -EINVAL;
3089
- }
3090
-
3091
- if ((mode == HWQ_MODE_TAG) && !shost_use_blk_mq(shost)) {
3092
- dev_info(cfgdev, "SCSI-MQ is not enabled, use a different "
3093
- "HWQ steering mode.\n");
30943087 return -EINVAL;
30953088 }
30963089
....@@ -3180,7 +3173,6 @@
31803173 .this_id = -1,
31813174 .sg_tablesize = 1, /* No scatter gather support */
31823175 .max_sectors = CXLFLASH_MAX_SECTORS,
3183
- .use_clustering = ENABLE_CLUSTERING,
31843176 .shost_attrs = cxlflash_host_attrs,
31853177 .sdev_attrs = cxlflash_dev_attrs,
31863178 };
....@@ -3289,7 +3281,7 @@
32893281 *
32903282 * Return: A string identifying the decoded host ioctl.
32913283 */
3292
-static char *decode_hioctl(int cmd)
3284
+static char *decode_hioctl(unsigned int cmd)
32933285 {
32943286 switch (cmd) {
32953287 case HT_CXLFLASH_LUN_PROVISION:
....@@ -3539,7 +3531,7 @@
35393531 if (likely(do_ioctl))
35403532 break;
35413533
3542
- /* fall through */
3534
+ fallthrough;
35433535 default:
35443536 rc = -EINVAL;
35453537 goto out;
....@@ -3596,7 +3588,7 @@
35963588 .owner = THIS_MODULE,
35973589 .open = cxlflash_chr_open,
35983590 .unlocked_ioctl = cxlflash_chr_ioctl,
3599
- .compat_ioctl = cxlflash_chr_ioctl,
3591
+ .compat_ioctl = compat_ptr_ioctl,
36003592 };
36013593
36023594 /**