hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/firewire/sbp2.c
....@@ -1,21 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * SBP2 driver (SCSI over IEEE1394)
34 *
45 * Copyright (C) 2005-2007 Kristian Hoegsberg <krh@bitplanet.net>
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; either version 2 of the License, or
9
- * (at your option) any later version.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program; if not, write to the Free Software Foundation,
18
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
196 */
207
218 /*
....@@ -421,7 +408,7 @@
421408 void *payload, size_t length, void *callback_data)
422409 {
423410 struct sbp2_logical_unit *lu = callback_data;
424
- struct sbp2_orb *orb;
411
+ struct sbp2_orb *orb = NULL, *iter;
425412 struct sbp2_status status;
426413 unsigned long flags;
427414
....@@ -446,17 +433,18 @@
446433
447434 /* Lookup the orb corresponding to this status write. */
448435 spin_lock_irqsave(&lu->tgt->lock, flags);
449
- list_for_each_entry(orb, &lu->orb_list, link) {
436
+ list_for_each_entry(iter, &lu->orb_list, link) {
450437 if (STATUS_GET_ORB_HIGH(status) == 0 &&
451
- STATUS_GET_ORB_LOW(status) == orb->request_bus) {
452
- orb->rcode = RCODE_COMPLETE;
453
- list_del(&orb->link);
438
+ STATUS_GET_ORB_LOW(status) == iter->request_bus) {
439
+ iter->rcode = RCODE_COMPLETE;
440
+ list_del(&iter->link);
441
+ orb = iter;
454442 break;
455443 }
456444 }
457445 spin_unlock_irqrestore(&lu->tgt->lock, flags);
458446
459
- if (&orb->link != &lu->orb_list) {
447
+ if (orb) {
460448 orb->callback(orb, &status);
461449 kref_put(&orb->kref, free_orb); /* orb callback reference */
462450 } else {
....@@ -1144,10 +1132,6 @@
11441132 if (device->is_local)
11451133 return -ENODEV;
11461134
1147
- if (dma_get_max_seg_size(device->card->device) > SBP2_MAX_SEG_SIZE)
1148
- WARN_ON(dma_set_max_seg_size(device->card->device,
1149
- SBP2_MAX_SEG_SIZE));
1150
-
11511135 shost = scsi_host_alloc(&scsi_driver_template, sizeof(*tgt));
11521136 if (shost == NULL)
11531137 return -ENOMEM;
....@@ -1610,7 +1594,7 @@
16101594 .eh_abort_handler = sbp2_scsi_abort,
16111595 .this_id = -1,
16121596 .sg_tablesize = SG_ALL,
1613
- .use_clustering = ENABLE_CLUSTERING,
1597
+ .max_segment_size = SBP2_MAX_SEG_SIZE,
16141598 .can_queue = 1,
16151599 .sdev_attrs = sbp2_scsi_sysfs_attrs,
16161600 };