diff options
author | Shivasharan S <shivasharan.srikanteshwara@broadcom.com> | 2017-02-10 03:59:37 -0500 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2017-02-13 07:26:23 -0500 |
commit | 41064f1bf8886bc43afbd9aa23a698f97bc65664 (patch) | |
tree | c10ef7b5dab2a35c814f59a6f563d988dc2aaf23 | |
parent | e00731bc5abb8f00f64e74fc8deb3feca580f22d (diff) |
scsi: megaraid_sas: Indentation and smatch warning fixes
Fix indentation issues and smatch warning reported by Dan Carpenter
for previous series as discussed below.
http://www.spinics.net/lists/linux-scsi/msg103635.html
http://www.spinics.net/lists/linux-scsi/msg103603.html
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Sasikumar Chandrasekaran <sasikumar.pc@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas.h | 2 | ||||
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas_base.c | 10 | ||||
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas_fp.c | 57 | ||||
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas_fusion.c | 92 | ||||
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas_fusion.h | 2 |
5 files changed, 80 insertions, 83 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index dc331e8224da..8c06cbfd07b8 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h | |||
@@ -1376,7 +1376,7 @@ struct megasas_ctrl_info { | |||
1376 | u16 reserved:8; | 1376 | u16 reserved:8; |
1377 | #endif | 1377 | #endif |
1378 | } adapter_operations4; | 1378 | } adapter_operations4; |
1379 | u8 pad[0x800-0x7FE]; /* 0x7FE pad to 2K for expansion */ | 1379 | u8 pad[0x800 - 0x7FE]; /* 0x7FE pad to 2K for expansion */ |
1380 | } __packed; | 1380 | } __packed; |
1381 | 1381 | ||
1382 | /* | 1382 | /* |
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 5e0dea14287f..dc9f42e135bb 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c | |||
@@ -5343,14 +5343,14 @@ static int megasas_init_fw(struct megasas_instance *instance) | |||
5343 | memset(instance->ld_ids, 0xff, MEGASAS_MAX_LD_IDS); | 5343 | memset(instance->ld_ids, 0xff, MEGASAS_MAX_LD_IDS); |
5344 | 5344 | ||
5345 | /* stream detection initialization */ | 5345 | /* stream detection initialization */ |
5346 | if (instance->is_ventura) { | 5346 | if (instance->is_ventura && fusion) { |
5347 | fusion->stream_detect_by_ld = | 5347 | fusion->stream_detect_by_ld = |
5348 | kzalloc(sizeof(struct LD_STREAM_DETECT *) | 5348 | kzalloc(sizeof(struct LD_STREAM_DETECT *) |
5349 | * MAX_LOGICAL_DRIVES_EXT, | 5349 | * MAX_LOGICAL_DRIVES_EXT, |
5350 | GFP_KERNEL); | 5350 | GFP_KERNEL); |
5351 | if (!fusion->stream_detect_by_ld) { | 5351 | if (!fusion->stream_detect_by_ld) { |
5352 | dev_err(&instance->pdev->dev, | 5352 | dev_err(&instance->pdev->dev, |
5353 | "unable to allocate stream detection for pool of LDs\n"); | 5353 | "unable to allocate stream detection for pool of LDs\n"); |
5354 | goto fail_get_ld_pd_list; | 5354 | goto fail_get_ld_pd_list; |
5355 | } | 5355 | } |
5356 | for (i = 0; i < MAX_LOGICAL_DRIVES_EXT; ++i) { | 5356 | for (i = 0; i < MAX_LOGICAL_DRIVES_EXT; ++i) { |
diff --git a/drivers/scsi/megaraid/megaraid_sas_fp.c b/drivers/scsi/megaraid/megaraid_sas_fp.c index 7dc7708a7957..62affa76133d 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fp.c +++ b/drivers/scsi/megaraid/megaraid_sas_fp.c | |||
@@ -197,7 +197,7 @@ void MR_PopulateDrvRaidMap(struct megasas_instance *instance) | |||
197 | 197 | ||
198 | memset(drv_map, 0, fusion->drv_map_sz); | 198 | memset(drv_map, 0, fusion->drv_map_sz); |
199 | memset(pDrvRaidMap->ldTgtIdToLd, | 199 | memset(pDrvRaidMap->ldTgtIdToLd, |
200 | 0xff, (sizeof(u16) * MAX_LOGICAL_DRIVES_DYN)); | 200 | 0xff, (sizeof(u16) * MAX_LOGICAL_DRIVES_DYN)); |
201 | 201 | ||
202 | if (instance->max_raid_mapsize) { | 202 | if (instance->max_raid_mapsize) { |
203 | fw_map_dyn = fusion->ld_map[(instance->map_id & 1)]; | 203 | fw_map_dyn = fusion->ld_map[(instance->map_id & 1)]; |
@@ -224,34 +224,37 @@ void MR_PopulateDrvRaidMap(struct megasas_instance *instance) | |||
224 | fw_map_dyn->dev_hndl_info = | 224 | fw_map_dyn->dev_hndl_info = |
225 | (struct MR_DEV_HANDLE_INFO *)(raid_map_data + le32_to_cpu(desc_table->raid_map_desc_offset)); | 225 | (struct MR_DEV_HANDLE_INFO *)(raid_map_data + le32_to_cpu(desc_table->raid_map_desc_offset)); |
226 | memcpy(pDrvRaidMap->devHndlInfo, | 226 | memcpy(pDrvRaidMap->devHndlInfo, |
227 | fw_map_dyn->dev_hndl_info, | 227 | fw_map_dyn->dev_hndl_info, |
228 | sizeof(struct MR_DEV_HANDLE_INFO) * | 228 | sizeof(struct MR_DEV_HANDLE_INFO) * |
229 | le32_to_cpu(desc_table->raid_map_desc_elements)); | 229 | le32_to_cpu(desc_table->raid_map_desc_elements)); |
230 | break; | 230 | break; |
231 | case RAID_MAP_DESC_TYPE_TGTID_INFO: | 231 | case RAID_MAP_DESC_TYPE_TGTID_INFO: |
232 | fw_map_dyn->ld_tgt_id_to_ld = | 232 | fw_map_dyn->ld_tgt_id_to_ld = |
233 | (u16 *) (raid_map_data + | 233 | (u16 *)(raid_map_data + |
234 | le32_to_cpu(desc_table->raid_map_desc_offset)); | 234 | le32_to_cpu(desc_table->raid_map_desc_offset)); |
235 | for (j = 0; j < le32_to_cpu(desc_table->raid_map_desc_elements); j++) { | 235 | for (j = 0; j < le32_to_cpu(desc_table->raid_map_desc_elements); j++) { |
236 | pDrvRaidMap->ldTgtIdToLd[j] = | 236 | pDrvRaidMap->ldTgtIdToLd[j] = |
237 | le16_to_cpu(fw_map_dyn->ld_tgt_id_to_ld[j]); | 237 | le16_to_cpu(fw_map_dyn->ld_tgt_id_to_ld[j]); |
238 | } | 238 | } |
239 | break; | 239 | break; |
240 | case RAID_MAP_DESC_TYPE_ARRAY_INFO: | 240 | case RAID_MAP_DESC_TYPE_ARRAY_INFO: |
241 | fw_map_dyn->ar_map_info = | 241 | fw_map_dyn->ar_map_info = |
242 | (struct MR_ARRAY_INFO *) | 242 | (struct MR_ARRAY_INFO *) |
243 | (raid_map_data + le32_to_cpu(desc_table->raid_map_desc_offset)); | 243 | (raid_map_data + le32_to_cpu(desc_table->raid_map_desc_offset)); |
244 | memcpy(pDrvRaidMap->arMapInfo, | 244 | memcpy(pDrvRaidMap->arMapInfo, |
245 | fw_map_dyn->ar_map_info, | 245 | fw_map_dyn->ar_map_info, |
246 | sizeof(struct MR_ARRAY_INFO) * le32_to_cpu(desc_table->raid_map_desc_elements)); | 246 | sizeof(struct MR_ARRAY_INFO) * |
247 | le32_to_cpu(desc_table->raid_map_desc_elements)); | ||
247 | break; | 248 | break; |
248 | case RAID_MAP_DESC_TYPE_SPAN_INFO: | 249 | case RAID_MAP_DESC_TYPE_SPAN_INFO: |
249 | fw_map_dyn->ld_span_map = | 250 | fw_map_dyn->ld_span_map = |
250 | (struct MR_LD_SPAN_MAP *) | 251 | (struct MR_LD_SPAN_MAP *) |
251 | (raid_map_data + le32_to_cpu(desc_table->raid_map_desc_offset)); | 252 | (raid_map_data + |
253 | le32_to_cpu(desc_table->raid_map_desc_offset)); | ||
252 | memcpy(pDrvRaidMap->ldSpanMap, | 254 | memcpy(pDrvRaidMap->ldSpanMap, |
253 | fw_map_dyn->ld_span_map, | 255 | fw_map_dyn->ld_span_map, |
254 | sizeof(struct MR_LD_SPAN_MAP) * le32_to_cpu(desc_table->raid_map_desc_elements)); | 256 | sizeof(struct MR_LD_SPAN_MAP) * |
257 | le32_to_cpu(desc_table->raid_map_desc_elements)); | ||
255 | break; | 258 | break; |
256 | default: | 259 | default: |
257 | dev_dbg(&instance->pdev->dev, "wrong number of desctableElements %d\n", | 260 | dev_dbg(&instance->pdev->dev, "wrong number of desctableElements %d\n", |
@@ -262,7 +265,7 @@ void MR_PopulateDrvRaidMap(struct megasas_instance *instance) | |||
262 | 265 | ||
263 | } else if (instance->supportmax256vd) { | 266 | } else if (instance->supportmax256vd) { |
264 | fw_map_ext = | 267 | fw_map_ext = |
265 | (struct MR_FW_RAID_MAP_EXT *) fusion->ld_map[(instance->map_id & 1)]; | 268 | (struct MR_FW_RAID_MAP_EXT *)fusion->ld_map[(instance->map_id & 1)]; |
266 | ld_count = (u16)le16_to_cpu(fw_map_ext->ldCount); | 269 | ld_count = (u16)le16_to_cpu(fw_map_ext->ldCount); |
267 | if (ld_count > MAX_LOGICAL_DRIVES_EXT) { | 270 | if (ld_count > MAX_LOGICAL_DRIVES_EXT) { |
268 | dev_dbg(&instance->pdev->dev, "megaraid_sas: LD count exposed in RAID map in not valid\n"); | 271 | dev_dbg(&instance->pdev->dev, "megaraid_sas: LD count exposed in RAID map in not valid\n"); |
@@ -275,12 +278,12 @@ void MR_PopulateDrvRaidMap(struct megasas_instance *instance) | |||
275 | pDrvRaidMap->ldTgtIdToLd[i] = | 278 | pDrvRaidMap->ldTgtIdToLd[i] = |
276 | (u16)fw_map_ext->ldTgtIdToLd[i]; | 279 | (u16)fw_map_ext->ldTgtIdToLd[i]; |
277 | memcpy(pDrvRaidMap->ldSpanMap, fw_map_ext->ldSpanMap, | 280 | memcpy(pDrvRaidMap->ldSpanMap, fw_map_ext->ldSpanMap, |
278 | sizeof(struct MR_LD_SPAN_MAP) * ld_count); | 281 | sizeof(struct MR_LD_SPAN_MAP) * ld_count); |
279 | memcpy(pDrvRaidMap->arMapInfo, fw_map_ext->arMapInfo, | 282 | memcpy(pDrvRaidMap->arMapInfo, fw_map_ext->arMapInfo, |
280 | sizeof(struct MR_ARRAY_INFO) * MAX_API_ARRAYS_EXT); | 283 | sizeof(struct MR_ARRAY_INFO) * MAX_API_ARRAYS_EXT); |
281 | memcpy(pDrvRaidMap->devHndlInfo, fw_map_ext->devHndlInfo, | 284 | memcpy(pDrvRaidMap->devHndlInfo, fw_map_ext->devHndlInfo, |
282 | sizeof(struct MR_DEV_HANDLE_INFO) * | 285 | sizeof(struct MR_DEV_HANDLE_INFO) * |
283 | MAX_RAIDMAP_PHYSICAL_DEVICES); | 286 | MAX_RAIDMAP_PHYSICAL_DEVICES); |
284 | 287 | ||
285 | /* New Raid map will not set totalSize, so keep expected value | 288 | /* New Raid map will not set totalSize, so keep expected value |
286 | * for legacy code in ValidateMapInfo | 289 | * for legacy code in ValidateMapInfo |
@@ -347,7 +350,7 @@ u8 MR_ValidateMapInfo(struct megasas_instance *instance) | |||
347 | dev_dbg(&instance->pdev->dev, "megasas: map info structure size 0x%x", | 350 | dev_dbg(&instance->pdev->dev, "megasas: map info structure size 0x%x", |
348 | le32_to_cpu(pDrvRaidMap->totalSize)); | 351 | le32_to_cpu(pDrvRaidMap->totalSize)); |
349 | dev_dbg(&instance->pdev->dev, "is not matching expected size 0x%x\n", | 352 | dev_dbg(&instance->pdev->dev, "is not matching expected size 0x%x\n", |
350 | (unsigned int) expected_size); | 353 | (unsigned int)expected_size); |
351 | dev_err(&instance->pdev->dev, "megasas: span map %x, pDrvRaidMap->totalSize : %x\n", | 354 | dev_err(&instance->pdev->dev, "megasas: span map %x, pDrvRaidMap->totalSize : %x\n", |
352 | (unsigned int)sizeof(struct MR_LD_SPAN_MAP), | 355 | (unsigned int)sizeof(struct MR_LD_SPAN_MAP), |
353 | le32_to_cpu(pDrvRaidMap->totalSize)); | 356 | le32_to_cpu(pDrvRaidMap->totalSize)); |
@@ -770,7 +773,7 @@ static u8 mr_spanset_get_phy_params(struct megasas_instance *instance, u32 ld, | |||
770 | 773 | ||
771 | *pdBlock += stripRef + le64_to_cpu(MR_LdSpanPtrGet(ld, span, map)->startBlk); | 774 | *pdBlock += stripRef + le64_to_cpu(MR_LdSpanPtrGet(ld, span, map)->startBlk); |
772 | if (instance->is_ventura) { | 775 | if (instance->is_ventura) { |
773 | ((struct RAID_CONTEXT_G35 *) pRAID_Context)->span_arm = | 776 | ((struct RAID_CONTEXT_G35 *)pRAID_Context)->span_arm = |
774 | (span << RAID_CTX_SPANARM_SPAN_SHIFT) | physArm; | 777 | (span << RAID_CTX_SPANARM_SPAN_SHIFT) | physArm; |
775 | io_info->span_arm = | 778 | io_info->span_arm = |
776 | (span << RAID_CTX_SPANARM_SPAN_SHIFT) | physArm; | 779 | (span << RAID_CTX_SPANARM_SPAN_SHIFT) | physArm; |
@@ -888,7 +891,7 @@ u8 MR_GetPhyParams(struct megasas_instance *instance, u32 ld, u64 stripRow, | |||
888 | 891 | ||
889 | *pdBlock += stripRef + le64_to_cpu(MR_LdSpanPtrGet(ld, span, map)->startBlk); | 892 | *pdBlock += stripRef + le64_to_cpu(MR_LdSpanPtrGet(ld, span, map)->startBlk); |
890 | if (instance->is_ventura) { | 893 | if (instance->is_ventura) { |
891 | ((struct RAID_CONTEXT_G35 *) pRAID_Context)->span_arm = | 894 | ((struct RAID_CONTEXT_G35 *)pRAID_Context)->span_arm = |
892 | (span << RAID_CTX_SPANARM_SPAN_SHIFT) | physArm; | 895 | (span << RAID_CTX_SPANARM_SPAN_SHIFT) | physArm; |
893 | io_info->span_arm = | 896 | io_info->span_arm = |
894 | (span << RAID_CTX_SPANARM_SPAN_SHIFT) | physArm; | 897 | (span << RAID_CTX_SPANARM_SPAN_SHIFT) | physArm; |
@@ -1329,7 +1332,7 @@ u8 megasas_get_best_arm_pd(struct megasas_instance *instance, | |||
1329 | * keep driver in sync with Firmware | 1332 | * keep driver in sync with Firmware |
1330 | */ | 1333 | */ |
1331 | if ((bestArm == arm && pend0 > pend1 + lb_pending_cmds) || | 1334 | if ((bestArm == arm && pend0 > pend1 + lb_pending_cmds) || |
1332 | (bestArm != arm && pend1 > pend0 + lb_pending_cmds)) | 1335 | (bestArm != arm && pend1 > pend0 + lb_pending_cmds)) |
1333 | bestArm ^= 1; | 1336 | bestArm ^= 1; |
1334 | 1337 | ||
1335 | /* Update the last accessed block on the correct pd */ | 1338 | /* Update the last accessed block on the correct pd */ |
diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index c7f4cc7608d6..9928766445d6 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c | |||
@@ -446,8 +446,6 @@ megasas_alloc_cmdlist_fusion(struct megasas_instance *instance) | |||
446 | return -ENOMEM; | 446 | return -ENOMEM; |
447 | } | 447 | } |
448 | 448 | ||
449 | |||
450 | |||
451 | for (i = 0; i < max_mpt_cmd; i++) { | 449 | for (i = 0; i < max_mpt_cmd; i++) { |
452 | fusion->cmd_list[i] = kzalloc(sizeof(struct megasas_cmd_fusion), | 450 | fusion->cmd_list[i] = kzalloc(sizeof(struct megasas_cmd_fusion), |
453 | GFP_KERNEL); | 451 | GFP_KERNEL); |
@@ -1433,8 +1431,8 @@ fail_alloc_mfi_cmds: | |||
1433 | 1431 | ||
1434 | void | 1432 | void |
1435 | map_cmd_status(struct fusion_context *fusion, | 1433 | map_cmd_status(struct fusion_context *fusion, |
1436 | struct scsi_cmnd *scmd, u8 status, u8 ext_status, | 1434 | struct scsi_cmnd *scmd, u8 status, u8 ext_status, |
1437 | u32 data_length, u8 *sense) | 1435 | u32 data_length, u8 *sense) |
1438 | { | 1436 | { |
1439 | u8 cmd_type; | 1437 | u8 cmd_type; |
1440 | int resid; | 1438 | int resid; |
@@ -2033,8 +2031,8 @@ megasas_set_pd_lba(struct MPI2_RAID_SCSI_IO_REQUEST *io_request, u8 cdb_len, | |||
2033 | 2031 | ||
2034 | /** stream detection on read and and write IOs */ | 2032 | /** stream detection on read and and write IOs */ |
2035 | static void megasas_stream_detect(struct megasas_instance *instance, | 2033 | static void megasas_stream_detect(struct megasas_instance *instance, |
2036 | struct megasas_cmd_fusion *cmd, | 2034 | struct megasas_cmd_fusion *cmd, |
2037 | struct IO_REQUEST_INFO *io_info) | 2035 | struct IO_REQUEST_INFO *io_info) |
2038 | { | 2036 | { |
2039 | struct fusion_context *fusion = instance->ctrl_context; | 2037 | struct fusion_context *fusion = instance->ctrl_context; |
2040 | u32 device_id = io_info->ldTgtId; | 2038 | u32 device_id = io_info->ldTgtId; |
@@ -2048,63 +2046,59 @@ static void megasas_stream_detect(struct megasas_instance *instance, | |||
2048 | struct STREAM_DETECT *current_sd; | 2046 | struct STREAM_DETECT *current_sd; |
2049 | /* find possible stream */ | 2047 | /* find possible stream */ |
2050 | for (i = 0; i < MAX_STREAMS_TRACKED; ++i) { | 2048 | for (i = 0; i < MAX_STREAMS_TRACKED; ++i) { |
2051 | stream_num = | 2049 | stream_num = (*track_stream >> |
2052 | (*track_stream >> (i * BITS_PER_INDEX_STREAM)) & | 2050 | (i * BITS_PER_INDEX_STREAM)) & |
2053 | STREAM_MASK; | 2051 | STREAM_MASK; |
2054 | current_sd = ¤t_ld_sd->stream_track[stream_num]; | 2052 | current_sd = ¤t_ld_sd->stream_track[stream_num]; |
2055 | /* if we found a stream, update the raid | 2053 | /* if we found a stream, update the raid |
2056 | * context and also update the mruBitMap | 2054 | * context and also update the mruBitMap |
2057 | */ | ||
2058 | /* boundary condition */ | ||
2059 | if ((current_sd->next_seq_lba) && | ||
2060 | (io_info->ldStartBlock >= current_sd->next_seq_lba) && | ||
2061 | (io_info->ldStartBlock <= (current_sd->next_seq_lba+32)) && | ||
2062 | (current_sd->is_read == io_info->isRead)) { | ||
2063 | |||
2064 | if ((io_info->ldStartBlock != current_sd->next_seq_lba) | ||
2065 | && ((!io_info->isRead) || (!is_read_ahead))) | ||
2066 | /* | ||
2067 | * Once the API availible we need to change this. | ||
2068 | * At this point we are not allowing any gap | ||
2069 | */ | ||
2070 | continue; | ||
2071 | |||
2072 | SET_STREAM_DETECTED(cmd->io_request->RaidContext.raid_context_g35); | ||
2073 | current_sd->next_seq_lba = | ||
2074 | io_info->ldStartBlock + io_info->numBlocks; | ||
2075 | /* | ||
2076 | * update the mruBitMap LRU | ||
2077 | */ | 2055 | */ |
2078 | shifted_values_mask = | 2056 | /* boundary condition */ |
2079 | (1 << i * BITS_PER_INDEX_STREAM) - 1; | 2057 | if ((current_sd->next_seq_lba) && |
2080 | shifted_values = ((*track_stream & shifted_values_mask) | 2058 | (io_info->ldStartBlock >= current_sd->next_seq_lba) && |
2081 | << BITS_PER_INDEX_STREAM); | 2059 | (io_info->ldStartBlock <= (current_sd->next_seq_lba + 32)) && |
2082 | index_value_mask = | 2060 | (current_sd->is_read == io_info->isRead)) { |
2083 | STREAM_MASK << i * BITS_PER_INDEX_STREAM; | 2061 | |
2084 | unshifted_values = | 2062 | if ((io_info->ldStartBlock != current_sd->next_seq_lba) && |
2085 | *track_stream & ~(shifted_values_mask | | 2063 | ((!io_info->isRead) || (!is_read_ahead))) |
2086 | index_value_mask); | 2064 | /* |
2087 | *track_stream = | 2065 | * Once the API availible we need to change this. |
2088 | unshifted_values | shifted_values | stream_num; | 2066 | * At this point we are not allowing any gap |
2089 | return; | 2067 | */ |
2068 | continue; | ||
2090 | 2069 | ||
2070 | SET_STREAM_DETECTED(cmd->io_request->RaidContext.raid_context_g35); | ||
2071 | current_sd->next_seq_lba = | ||
2072 | io_info->ldStartBlock + io_info->numBlocks; | ||
2073 | /* | ||
2074 | * update the mruBitMap LRU | ||
2075 | */ | ||
2076 | shifted_values_mask = | ||
2077 | (1 << i * BITS_PER_INDEX_STREAM) - 1; | ||
2078 | shifted_values = ((*track_stream & shifted_values_mask) | ||
2079 | << BITS_PER_INDEX_STREAM); | ||
2080 | index_value_mask = | ||
2081 | STREAM_MASK << i * BITS_PER_INDEX_STREAM; | ||
2082 | unshifted_values = | ||
2083 | *track_stream & ~(shifted_values_mask | | ||
2084 | index_value_mask); | ||
2085 | *track_stream = | ||
2086 | unshifted_values | shifted_values | stream_num; | ||
2087 | return; | ||
2091 | } | 2088 | } |
2092 | |||
2093 | } | 2089 | } |
2094 | /* | 2090 | /* |
2095 | * if we did not find any stream, create a new one | 2091 | * if we did not find any stream, create a new one |
2096 | * from the least recently used | 2092 | * from the least recently used |
2097 | */ | 2093 | */ |
2098 | stream_num = | 2094 | stream_num = (*track_stream >> |
2099 | (*track_stream >> ((MAX_STREAMS_TRACKED - 1) * BITS_PER_INDEX_STREAM)) & | 2095 | ((MAX_STREAMS_TRACKED - 1) * BITS_PER_INDEX_STREAM)) & |
2100 | STREAM_MASK; | 2096 | STREAM_MASK; |
2101 | current_sd = ¤t_ld_sd->stream_track[stream_num]; | 2097 | current_sd = ¤t_ld_sd->stream_track[stream_num]; |
2102 | current_sd->is_read = io_info->isRead; | 2098 | current_sd->is_read = io_info->isRead; |
2103 | current_sd->next_seq_lba = io_info->ldStartBlock + io_info->numBlocks; | 2099 | current_sd->next_seq_lba = io_info->ldStartBlock + io_info->numBlocks; |
2104 | *track_stream = | 2100 | *track_stream = (((*track_stream & ZERO_LAST_STREAM) << 4) | stream_num); |
2105 | (((*track_stream & ZERO_LAST_STREAM) << 4) | stream_num); | ||
2106 | return; | 2101 | return; |
2107 | |||
2108 | } | 2102 | } |
2109 | 2103 | ||
2110 | /** | 2104 | /** |
diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.h b/drivers/scsi/megaraid/megaraid_sas_fusion.h index 1441c35c58a3..8e8c35f6b872 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.h +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.h | |||
@@ -904,7 +904,7 @@ struct MR_LD_RAID { | |||
904 | */ | 904 | */ |
905 | struct MR_IO_AFFINITY cpuAffinity; | 905 | struct MR_IO_AFFINITY cpuAffinity; |
906 | /* Bit definiations are specified by MR_IO_AFFINITY */ | 906 | /* Bit definiations are specified by MR_IO_AFFINITY */ |
907 | u8 reserved3[0x80-0x40]; /* 0x40 - 0x7f */ | 907 | u8 reserved3[0x80 - 0x40]; /* 0x40 - 0x7f */ |
908 | }; | 908 | }; |
909 | 909 | ||
910 | struct MR_LD_SPAN_MAP { | 910 | struct MR_LD_SPAN_MAP { |