Skip to content

Commit 55c9d37

Browse files
Johannes Thumshirnmartinkpetersen
authored andcommitted
scsi: bfa: remove ScsiResult macro
Remove the ScsiResult macro and open code it on all call sites. This will make subsequent refactoring in this area easier. Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 2d362b8 commit 55c9d37

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

drivers/scsi/bfa/bfad_im.c

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,21 +70,18 @@ bfa_cb_ioim_done(void *drv, struct bfad_ioim_s *dio,
7070
host_status = DID_ERROR;
7171
}
7272
}
73-
cmnd->result = ScsiResult(host_status, scsi_status);
73+
cmnd->result = host_status << 16 | scsi_status;
7474

7575
break;
7676

7777
case BFI_IOIM_STS_TIMEDOUT:
78-
host_status = DID_TIME_OUT;
79-
cmnd->result = ScsiResult(host_status, 0);
78+
cmnd->result = DID_TIME_OUT << 16;
8079
break;
8180
case BFI_IOIM_STS_PATHTOV:
82-
host_status = DID_TRANSPORT_DISRUPTED;
83-
cmnd->result = ScsiResult(host_status, 0);
81+
cmnd->result = DID_TRANSPORT_DISRUPTED << 16;
8482
break;
8583
default:
86-
host_status = DID_ERROR;
87-
cmnd->result = ScsiResult(host_status, 0);
84+
cmnd->result = DID_ERROR << 16;
8885
}
8986

9087
/* Unmap DMA, if host is NULL, it means a scsi passthru cmd */
@@ -117,7 +114,7 @@ bfa_cb_ioim_good_comp(void *drv, struct bfad_ioim_s *dio)
117114
struct bfad_itnim_data_s *itnim_data;
118115
struct bfad_itnim_s *itnim;
119116

120-
cmnd->result = ScsiResult(DID_OK, SCSI_STATUS_GOOD);
117+
cmnd->result = DID_OK << 16 | SCSI_STATUS_GOOD;
121118

122119
/* Unmap DMA, if host is NULL, it means a scsi passthru cmd */
123120
if (cmnd->device->host != NULL)
@@ -144,7 +141,7 @@ bfa_cb_ioim_abort(void *drv, struct bfad_ioim_s *dio)
144141
struct scsi_cmnd *cmnd = (struct scsi_cmnd *)dio;
145142
struct bfad_s *bfad = drv;
146143

147-
cmnd->result = ScsiResult(DID_ERROR, 0);
144+
cmnd->result = DID_ERROR << 16;
148145

149146
/* Unmap DMA, if host is NULL, it means a scsi passthru cmd */
150147
if (cmnd->device->host != NULL)
@@ -1253,14 +1250,14 @@ bfad_im_queuecommand_lck(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd
12531250
printk(KERN_WARNING
12541251
"bfad%d, queuecommand %p %x failed, BFA stopped\n",
12551252
bfad->inst_no, cmnd, cmnd->cmnd[0]);
1256-
cmnd->result = ScsiResult(DID_NO_CONNECT, 0);
1253+
cmnd->result = DID_NO_CONNECT << 16;
12571254
goto out_fail_cmd;
12581255
}
12591256

12601257

12611258
itnim = itnim_data->itnim;
12621259
if (!itnim) {
1263-
cmnd->result = ScsiResult(DID_IMM_RETRY, 0);
1260+
cmnd->result = DID_IMM_RETRY << 16;
12641261
goto out_fail_cmd;
12651262
}
12661263

drivers/scsi/bfa/bfad_im.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ u32 bfad_im_supported_speeds(struct bfa_s *bfa);
4444
#define MAX_FCP_LUN 16384
4545
#define BFAD_TARGET_RESET_TMO 60
4646
#define BFAD_LUN_RESET_TMO 60
47-
#define ScsiResult(host_code, scsi_code) (((host_code) << 16) | scsi_code)
4847
#define BFA_QUEUE_FULL_RAMP_UP_TIME 120
4948

5049
/*

0 commit comments

Comments
 (0)