forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/scsi/device_handler/scsi_dh_hp_sw.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Basic HP/COMPAQ MSA 1000 support. This is only needed if your HW cannot be
34 * upgraded.
....@@ -5,20 +6,6 @@
56 * Copyright (C) 2006 Red Hat, Inc. All rights reserved.
67 * Copyright (C) 2006 Mike Christie
78 * Copyright (C) 2008 Hannes Reinecke <hare@suse.de>
8
- *
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License as published by
11
- * the Free Software Foundation; either version 2, or (at your option)
12
- * any later version.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- * GNU General Public License for more details.
18
- *
19
- * You should have received a copy of the GNU General Public License
20
- * along with this program; see the file COPYING. If not, write to
21
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
229 */
2310
2411 #include <linux/slab.h>
....@@ -73,7 +60,7 @@
7360 ret = SCSI_DH_OK;
7461 break;
7562 }
76
- /* Fallthrough */
63
+ fallthrough;
7764 default:
7865 sdev_printk(KERN_WARNING, sdev,
7966 "%s: sending tur failed, sense %x/%x/%x\n",
....@@ -160,7 +147,7 @@
160147 rc = SCSI_DH_RETRY;
161148 break;
162149 }
163
- /* fall through */
150
+ fallthrough;
164151 default:
165152 sdev_printk(KERN_WARNING, sdev,
166153 "%s: sending start_stop_unit failed, "
....@@ -172,17 +159,16 @@
172159 return rc;
173160 }
174161
175
-static int hp_sw_prep_fn(struct scsi_device *sdev, struct request *req)
162
+static blk_status_t hp_sw_prep_fn(struct scsi_device *sdev, struct request *req)
176163 {
177164 struct hp_sw_dh_data *h = sdev->handler_data;
178
- int ret = BLKPREP_OK;
179165
180166 if (h->path_state != HP_SW_PATH_ACTIVE) {
181
- ret = BLKPREP_KILL;
182167 req->rq_flags |= RQF_QUIET;
168
+ return BLK_STS_IOERR;
183169 }
184
- return ret;
185170
171
+ return BLK_STS_OK;
186172 }
187173
188174 /*