Skip to content

Commit 2d362b8

Browse files
Johannes Thumshirnmartinkpetersen
authored andcommitted
scsi: aacraid: remove AAC_STAT_GOOD define
Remove the AAC_STAT_GOOD definition and open code it in the places it was used. This will make subsequent refactoring in this area easier. Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Cc: Dave Carroll <david.carroll@microsemi.com> Cc: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com> Reviewed-by: Dave Carroll <david.carroll@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent fa519f7 commit 2d362b8

File tree

1 file changed

+27
-14
lines changed

1 file changed

+27
-14
lines changed

drivers/scsi/aacraid/aachba.c

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@
115115
#define ASENCODE_LUN_FAILED_SELF_CONFIG 0x00
116116
#define ASENCODE_OVERLAPPED_COMMAND 0x00
117117

118-
#define AAC_STAT_GOOD (DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_GOOD)
119-
120118
#define BYTE0(x) (unsigned char)(x)
121119
#define BYTE1(x) (unsigned char)((x) >> 8)
122120
#define BYTE2(x) (unsigned char)((x) >> 16)
@@ -2962,7 +2960,8 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
29622960

29632961
case SYNCHRONIZE_CACHE:
29642962
if (((aac_cache & 6) == 6) && dev->cache_protected) {
2965-
scsicmd->result = AAC_STAT_GOOD;
2963+
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
2964+
SAM_STAT_GOOD;
29662965
break;
29672966
}
29682967
/* Issue FIB to tell Firmware to flush it's cache */
@@ -2990,7 +2989,9 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
29902989
arr[1] = scsicmd->cmnd[2];
29912990
scsi_sg_copy_from_buffer(scsicmd, &inq_data,
29922991
sizeof(inq_data));
2993-
scsicmd->result = AAC_STAT_GOOD;
2992+
scsicmd->result = DID_OK << 16 |
2993+
COMMAND_COMPLETE << 8 |
2994+
SAM_STAT_GOOD;
29942995
} else if (scsicmd->cmnd[2] == 0x80) {
29952996
/* unit serial number page */
29962997
arr[3] = setinqserial(dev, &arr[4],
@@ -3001,7 +3002,9 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
30013002
if (aac_wwn != 2)
30023003
return aac_get_container_serial(
30033004
scsicmd);
3004-
scsicmd->result = AAC_STAT_GOOD;
3005+
scsicmd->result = DID_OK << 16 |
3006+
COMMAND_COMPLETE << 8 |
3007+
SAM_STAT_GOOD;
30053008
} else if (scsicmd->cmnd[2] == 0x83) {
30063009
/* vpd page 0x83 - Device Identification Page */
30073010
char *sno = (char *)&inq_data;
@@ -3010,7 +3013,9 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
30103013
if (aac_wwn != 2)
30113014
return aac_get_container_serial(
30123015
scsicmd);
3013-
scsicmd->result = AAC_STAT_GOOD;
3016+
scsicmd->result = DID_OK << 16 |
3017+
COMMAND_COMPLETE << 8 |
3018+
SAM_STAT_GOOD;
30143019
} else {
30153020
/* vpd page not implemented */
30163021
scsicmd->result = DID_OK << 16 |
@@ -3041,7 +3046,8 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
30413046
inq_data.inqd_pdt = INQD_PDT_PROC; /* Processor device */
30423047
scsi_sg_copy_from_buffer(scsicmd, &inq_data,
30433048
sizeof(inq_data));
3044-
scsicmd->result = AAC_STAT_GOOD;
3049+
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
3050+
SAM_STAT_GOOD;
30453051
break;
30463052
}
30473053
if (dev->in_reset)
@@ -3090,7 +3096,8 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
30903096
/* Do not cache partition table for arrays */
30913097
scsicmd->device->removable = 1;
30923098

3093-
scsicmd->result = AAC_STAT_GOOD;
3099+
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
3100+
SAM_STAT_GOOD;
30943101
break;
30953102
}
30963103

@@ -3116,7 +3123,8 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
31163123
scsi_sg_copy_from_buffer(scsicmd, cp, sizeof(cp));
31173124
/* Do not cache partition table for arrays */
31183125
scsicmd->device->removable = 1;
3119-
scsicmd->result = AAC_STAT_GOOD;
3126+
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
3127+
SAM_STAT_GOOD;
31203128
break;
31213129
}
31223130

@@ -3195,7 +3203,8 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
31953203
scsi_sg_copy_from_buffer(scsicmd,
31963204
(char *)&mpd,
31973205
mode_buf_length);
3198-
scsicmd->result = AAC_STAT_GOOD;
3206+
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
3207+
SAM_STAT_GOOD;
31993208
break;
32003209
}
32013210
case MODE_SENSE_10:
@@ -3272,7 +3281,8 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
32723281
(char *)&mpd10,
32733282
mode_buf_length);
32743283

3275-
scsicmd->result = AAC_STAT_GOOD;
3284+
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
3285+
SAM_STAT_GOOD;
32763286
break;
32773287
}
32783288
case REQUEST_SENSE:
@@ -3281,7 +3291,8 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
32813291
sizeof(struct sense_data));
32823292
memset(&dev->fsa_dev[cid].sense_data, 0,
32833293
sizeof(struct sense_data));
3284-
scsicmd->result = AAC_STAT_GOOD;
3294+
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
3295+
SAM_STAT_GOOD;
32853296
break;
32863297

32873298
case ALLOW_MEDIUM_REMOVAL:
@@ -3291,7 +3302,8 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
32913302
else
32923303
fsa_dev_ptr[cid].locked = 0;
32933304

3294-
scsicmd->result = AAC_STAT_GOOD;
3305+
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
3306+
SAM_STAT_GOOD;
32953307
break;
32963308
/*
32973309
* These commands are all No-Ops
@@ -3315,7 +3327,8 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
33153327
case REZERO_UNIT:
33163328
case REASSIGN_BLOCKS:
33173329
case SEEK_10:
3318-
scsicmd->result = AAC_STAT_GOOD;
3330+
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
3331+
SAM_STAT_GOOD;
33193332
break;
33203333

33213334
case START_STOP:

0 commit comments

Comments
 (0)