Skip to contentSkip to conversation

megaraid_sas: Make PI enabled VD 8 byte DMA aligned

bug report Dan Carpenter 2 participants 2 messages Feb 14, 2017 – Feb 15, 2017 SCSI

lore
Share & tools
lore
#0 lore raw

Hello [email protected],

The patch 0b48d12d0365: "megaraid_sas: Make PI enabled VD 8 byte DMA aligned" from Oct 15, 2015, leads to the following static checker warning:

drivers/scsi/megaraid/megaraid_sas_base.c:1784 megasas_set_dynamic_target_properties()
warn: if statement not indented

drivers/scsi/megaraid/megaraid_sas_base.c
1757 void megasas_set_dynamic_target_properties(struct scsi_device *sdev) 1758 {

  1759          u16 pd_index = 0, ld;
  1760          u32 device_id;
  1761          struct megasas_instance *instance;
  1762          struct fusion_context *fusion;
  1763          struct MR_PRIV_DEVICE *mr_device_priv_data;
  1764          struct MR_PD_CFG_SEQ_NUM_SYNC *pd_sync;
  1765          struct MR_LD_RAID *raid;
  1766          struct MR_DRV_RAID_MAP_ALL *local_map_ptr;
  1767  
  1768          instance = megasas_lookup_instance(sdev->host->host_no);
  1769          fusion = instance->ctrl_context;
  1770          mr_device_priv_data = sdev->hostdata;
  1771  
  1772          if (!fusion || !mr_device_priv_data)
  1773                  return;
  1774  
  1775          if (MEGASAS_IS_LOGICAL(sdev)) {
  1776                  device_id = ((sdev->channel % 2) * MEGASAS_MAX_DEV_PER_CHANNEL)
  1777                                          + sdev->id;
  1778                  local_map_ptr = fusion->ld_drv_map[(instance->map_id & 1)];
  1779                  ld = MR_TargetIdToLdGet(device_id, local_map_ptr);
  1780                  if (ld >= instance->fw_supported_vd_count)
  1781                          return;
  1782                  raid = MR_LdRaidGet(ld, local_map_ptr);
  1783  
  1784                  if (raid->capability.ldPiMode == MR_PROT_INFO_TYPE_CONTROLLER)
  1785                  blk_queue_update_dma_alignment(sdev->request_queue, 0x7);
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1786  
  1787                  mr_device_priv_data->is_tm_capable =
  1788                          raid->capability.tmCapable;
  1789          } else if (instance->use_seqnum_jbod_fp) {
  1790                  pd_index = (sdev->channel * MEGASAS_MAX_DEV_PER_CHANNEL) +
  1791                          sdev->id;
  1792                  pd_sync = (void *)fusion->pd_seq_sync
  1793                                  [(instance->pd_seq_map_id - 1) & 1];
  1794                  mr_device_priv_data->is_tm_capable =
  1795                          pd_sync->seq[pd_index].capability.tmCapable;
  1796          }
  1797  }

regards,
dan carpenter

#1 lore raw
Quoted 9 lines

-----Original Message-----
From: Dan Carpenter [mailto:[email protected]]
Sent: Tuesday, February 14, 2017 9:54 PM
To: [email protected]
Cc: [email protected]; [email protected]
Subject: [bug report] megaraid_sas: Make PI enabled VD 8 byte DMA aligned

Hello [email protected],

Quoted 7 lines

The patch 0b48d12d0365: "megaraid_sas: Make PI enabled VD 8 byte DMA aligned" from Oct 15, 2015, leads to the following static checker warning:

drivers/scsi/megaraid/megaraid_sas_base.c:1784
megasas_set_dynamic_target_properties()
warn: if statement not indented

I will post patch to fix this indentation issue.

Quoted 3 lines

drivers/scsi/megaraid/megaraid_sas_base.c
1757 void megasas_set_dynamic_target_properties(struct scsi_device

*sdev)

Quoted 13 lines

1758 {

 1759          u16 pd_index = 0, ld;
 1760          u32 device_id;
 1761          struct megasas_instance *instance;
 1762          struct fusion_context *fusion;
 1763          struct MR_PRIV_DEVICE *mr_device_priv_data;
 1764          struct MR_PD_CFG_SEQ_NUM_SYNC *pd_sync;
 1765          struct MR_LD_RAID *raid;
 1766          struct MR_DRV_RAID_MAP_ALL *local_map_ptr;
 1767
 1768          instance = megasas_lookup_instance(sdev->host->host_no);
 1769          fusion = instance->ctrl_context;
 1770          mr_device_priv_data = sdev->hostdata;
Quoted 9 lines

1771
1772 if (!fusion || !mr_device_priv_data)
1773 return;
1774
1775 if (MEGASAS_IS_LOGICAL(sdev)) {
1776 device_id = ((sdev->channel % 2) *
MEGASAS_MAX_DEV_PER_CHANNEL)
1777 + sdev->id;
1778 local_map_ptr =

fusion->ld_drv_map[(instance->map_id & 1)];

Quoted 1 line

1779 ld = MR_TargetIdToLdGet(device_id,

local_map_ptr);

Quoted 7 lines

1780 if (ld >= instance->fw_supported_vd_count)
1781 return;
1782 raid = MR_LdRaidGet(ld, local_map_ptr);
1783
1784 if (raid->capability.ldPiMode ==
MR_PROT_INFO_TYPE_CONTROLLER)
1785

blk_queue_update_dma_alignment(sdev->request_queue, 0x7);

Quoted 12 lines

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1786
1787 mr_device_priv_data->is_tm_capable =
1788 raid->capability.tmCapable;
1789 } else if (instance->use_seqnum_jbod_fp) {
1790 pd_index = (sdev->channel *
MEGASAS_MAX_DEV_PER_CHANNEL) +
1791 sdev->id;
1792 pd_sync = (void *)fusion->pd_seq_sync
1793 [(instance->pd_seq_map_id - 1) &

1];

Quoted 2 lines

1794 mr_device_priv_data->is_tm_capable =
1795

pd_sync->seq[pd_index].capability.tmCapable;

Quoted 6 lines

1796 }
1797 }

regards,
dan carpenter